JbossESB & jBPM: waiting for jBPM to end processinstance
tunstall Mar 14, 2008 7:04 AMI'm using the newest GPD in Eclipse which has an extra "ESB Service" node, not just the usual "Node". I entered my ESB Service details (service, category, input/output variable mapping), haven't changed anything else (e.g. in the start/end node).
I configured my ESB service following the bpm_orchestration1 quickstart example as follows:
jboss-esb.xml file, services part:
<services> <service category="BPM_Orchestration_Deploy_Service" name="Deploy_Service" description="BPM Orchestration Sample 1: Use this service to deploy a process instance"> <listeners> <fs-listener name="Gateway" busidref="deployGwChannel" maxThreads="1" is-gateway="true" /> <fs-listener name="ESB-Listener" busidref="deployEsbChannel" maxThreads="1" /> </listeners> <actions> <action name="DeployFromFile" class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor"> <property name="command" value="DeployProcessDefinition" /> <property name="process-definition-file" value="/processdefinition.xml" /> </action> </actions> </service> <service category="ESB" name="BCS_Starter_Service" description="BPM Orchestration Sample 1: Use this service to start a process instance"> <listeners> <jms-listener name="BCS-Gateway" busidref="bcs_GwChannel" maxThreads="1" is-gateway="true" /> <jms-listener name="BCS-Listener" busidref="bcs_EsbChannel" maxThreads="1" /> </listeners> <actions> <action name="spy2" class="mypackage.MessageSpy" /> <!-- move the body.getContents() into jBPM --> <action name="create_new_process_instance" class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor"> <property name="command" value="NewProcessInstanceCommand" /> <property name="process-definition-name" value="processDefinition2" /> <property name="actor" value="FrankSinatra" /> <property name="object-paths"> <!-- esb-name maps to getBody().get("eVar1") --> <object-path esb="eVar1" bpm="counter" value="45" /> <object-path esb="BODY_CONTENT" bpm="theBody" /> </property> </action> <action name="signal_the_new_process_instance" class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor"> <property name="command" value="SignalCommand" /> <property name="process-definition-name" value="processDefinition2" /> <property name="object-paths"> <!-- esb-name maps to getBody().get("eVar1") --> <object-path esb="eVar1" bpm="counter" value="45" /> <object-path esb="BODY_CONTENT" bpm="theBody" /> </property> </action> </actions> </service> </services>
processdefinition.xml
<?xml version="1.0" encoding="UTF-8"?> <process-definition xmlns="" name="processDefinition2"> <start-state name="start"> <transition to="esb_test"></transition> </start-state> <node name="esb_test"> <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler"> <esbCategoryName>ESB</esbCategoryName> <jbpmToEsbVars> <mapping jbpm="theBody" esb="BODY_CONTENT"></mapping> </jbpmToEsbVars> <returnVars> <mapping jbpm="theBody" esb="BODY_CONTENT"></mapping> </returnVars> <esbServiceName>BCS_MyTestService</esbServiceName> </action> <transition to="end1"></transition> </node> <end-state name="end1"></end-state> </process-definition>
My problem here now is the following: basically I want an ESB service, which starts a BPM, waits until the BPM is finished, and uses the message processed by the BPM in the ESB return message. When using "normal" nodes (not ESB nodes) I can configure a timeout, but with that "ESB Service" node there is no timeout to wait. Right now the ESB service continues running right after the BPM was started, but before any data was returned. Did I forget to configure a necessary action or node-enter/-leave?