[jboss-svn-commits] JBL Code SVN: r9661 - in labs/jbossesb/trunk/product/core: services/src/org/jboss/soa/esb/services/jbpm and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Feb 20 17:17:06 EST 2007
Author: estebanschifman
Date: 2007-02-20 17:17:06 -0500 (Tue, 20 Feb 2007)
New Revision: 9661
Added:
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/jbpm/BaseActionHandler.java
Removed:
labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/jbpm/BaseActionHandler.java
Log:
Move BaseActionHandler to actions/jbpm package
Copied: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/jbpm/BaseActionHandler.java (from rev 9658, labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/jbpm/BaseActionHandler.java)
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/jbpm/BaseActionHandler.java (rev 0)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/jbpm/BaseActionHandler.java 2007-02-20 22:17:06 UTC (rev 9661)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.actions.jbpm;
+
+import java.net.URI;
+import java.util.UUID;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.jbpm.CommandVehicle;
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.graph.exe.Token;
+
+/**
+ *
+ * Use to send messages to ESB services from jBPM applications.
+ * <p/>Assumptions:
+ * <br/> Message payload is in the context instance in a context variable.
+ * <br/>Context variables "esbCategoryName" and "esbServiceName" will be supplied at runtime.
+ *
+ * <p/> The name of the context variable that contains the user object to include in the
+ * message payload is rendered by the getContentVariableName() method
+ * so it can be changed just by extending this class and overriding that method.
+ *
+ * <br/> This action handler will by default (whenever possible) include the process name
+ * , version, processInstance id and token ID
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ *
+ */
+
+public class BaseActionHandler implements ActionHandler
+{
+
+ private static final long serialVersionUID = 1L;
+
+ public String getContentVariableName() { return "esbUserObjectVariable"; }
+
+ public String esbCategoryName;
+ public String esbServiceName;
+
+ public void execute(ExecutionContext context) throws Exception
+ {
+ if (null==esbCategoryName)
+ throw new ConfigurationException("Service category (esbCategoryName element) must not be null");
+ if (null==esbServiceName)
+ throw new ConfigurationException("Service name (esbServiceName element) must not be null");
+
+ Object userObject = context.getContextInstance().getVariable(getContentVariableName());
+ if (null==userObject)
+ throw new IllegalArgumentException("User object to be sent to ESB (variable="
+ +getContentVariableName()+") is <null>");
+
+ CommandVehicle command = new CommandVehicle(CommandVehicle.Operation.sendMessageToEsb);
+
+ ProcessDefinition process = context.getProcessDefinition();
+ if (null!=process)
+ {
+ command.setProcessDefinitionName(process.getName());
+ command.setProcessVersion (process.getVersion());
+ }
+
+ ProcessInstance instance = context.getProcessInstance();
+ if (null!=instance)
+ {
+ command.setInstanceId (context.getProcessInstance().getId());
+ }
+ Token token = context.getToken();
+
+ if (null!=token)
+ {
+ command.setTokenId (token.getId());
+ }
+
+ command.setUserObject(userObject);
+
+ Message message = command.toCommandMessage();
+ Call call = message.getHeader().getCall();
+ call.setMessageID(new URI(UUID.randomUUID().toString()));
+
+ ListenerUtil.tryToDeliver(message, esbCategoryName, esbServiceName);
+ }
+
+}
Property changes on: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/jbpm/BaseActionHandler.java
___________________________________________________________________
Name: svn:eol-style
+ native
Deleted: labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/jbpm/BaseActionHandler.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/jbpm/BaseActionHandler.java 2007-02-20 21:08:03 UTC (rev 9660)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/jbpm/BaseActionHandler.java 2007-02-20 22:17:06 UTC (rev 9661)
@@ -1,108 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.services.jbpm;
-
-import java.net.URI;
-import java.util.UUID;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.listeners.ListenerUtil;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.jbpm.CommandVehicle;
-import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.graph.exe.Token;
-
-/**
- *
- * Use to send messages to ESB services from jBPM applications.
- * <p/>Assumptions:
- * <br/> Message payload is in the context instance in a context variable.
- * <br/>Context variables "esbCategoryName" and "esbServiceName" will be supplied at runtime.
- *
- * <p/> The name of the context variable that contains the user object to include in the
- * message payload is rendered by the getContentVariableName() method
- * so it can be changed just by extending this class and overriding that method.
- *
- * <br/> This action handler will by default (whenever possible) include the process name
- * , version, processInstance id and token ID
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- *
- */
-
-public class BaseActionHandler implements ActionHandler
-{
-
- private static final long serialVersionUID = 1L;
-
- public String getContentVariableName() { return "esbUserObjectVariable"; }
-
- public String esbCategoryName;
- public String esbServiceName;
-
- public void execute(ExecutionContext context) throws Exception
- {
- if (null==esbCategoryName)
- throw new ConfigurationException("Service category (esbCategoryName element) must not be null");
- if (null==esbServiceName)
- throw new ConfigurationException("Service name (esbServiceName element) must not be null");
-
- Object userObject = context.getContextInstance().getVariable(getContentVariableName());
- if (null==userObject)
- throw new IllegalArgumentException("User object to be sent to ESB (variable="
- +getContentVariableName()+") is <null>");
-
- CommandVehicle command = new CommandVehicle(CommandVehicle.Operation.sendMessageToEsb);
-
- ProcessDefinition process = context.getProcessDefinition();
- if (null!=process)
- {
- command.setProcessDefinitionName(process.getName());
- command.setProcessVersion (process.getVersion());
- }
-
- ProcessInstance instance = context.getProcessInstance();
- if (null!=instance)
- {
- command.setInstanceId (context.getProcessInstance().getId());
- }
- Token token = context.getToken();
-
- if (null!=token)
- {
- command.setTokenId (token.getId());
- }
-
- command.setUserObject(userObject);
-
- Message message = command.toCommandMessage();
- Call call = message.getHeader().getCall();
- call.setMessageID(new URI(UUID.randomUUID().toString()));
-
- ListenerUtil.tryToDeliver(message, esbCategoryName, esbServiceName);
- }
-
-}
More information about the jboss-svn-commits
mailing list