JBoss Community

jBPM5 migration tool project

new comment by Giovanni Marigi View all comments on this document

I took this from jboss esb quickstart examples a very easy but informative use case.

Integration between jbpm and esb via EsbActionHandler it's what I'm dreaming :-) (and I think customers too) to have in a bpmn 2 workflow.

 

 

<?xml version="1.0" encoding="UTF-8"?>
 
<process-definition
  name="processDefinition2">
   <start-state name="start">
      <event type="node-leave">
         <action name="action1" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.process_actions.MyBPMActionHandler" config-type="bean"></action>
      </event>
      <transition to="node1"></transition>
   </start-state>

 

   <node name="node1">
      <action name="action2" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
         <esbCategoryName>BPM_Orchestration_Service1</esbCategoryName>
         <esbServiceName>Service1</esbServiceName>
         <bpmToEsbVars>
             <mapping bpm="theBody" esb="BODY_CONTENT" />
         </bpmToEsbVars>
         <esbToBpmVars>
             <mapping esb="BODY_CONTENT" bpm="theBody" />
         </esbToBpmVars>
      </action>
      <transition to="node2"></transition>
   </node>
   <node name="node2">
      <action name="action2" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
         <esbCategoryName>BPM_Orchestration_Service2</esbCategoryName>
         <esbServiceName>Service2</esbServiceName>
         <bpmToEsbVars>
             <mapping bpm="theBody" esb="BODY_CONTENT" />
         </bpmToEsbVars>
         <esbToBpmVars>
             <mapping esb="BODY_CONTENT" bpm="theBody"/>
         </esbToBpmVars>
      </action>
      <transition to="node3"></transition>
   </node>
   <node name="node3">
      <action name="action2" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
         <esbCategoryName>BPM_Orchestration_Service3</esbCategoryName>
         <esbServiceName>Service3</esbServiceName>                   
         <bpmToEsbVars>
             <mapping bpm="theBody" esb="BODY_CONTENT" />
         </bpmToEsbVars>
         <esbToBpmVars>
             <mapping esb="BODY_CONTENT" bpm="theBody"/>
         </esbToBpmVars>
      </action>
      <transition to="Send Results"></transition>
   </node>
   <end-state name="end1"></end-state>
   <node name="Send Results">
      <event type="node-enter">
         <action name="action1" class="org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.process_actions.MyBPMActionHandler" config-type="bean"></action>
      </event>
      <action name="action2" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
         <esbCategoryName>BPM_Orchestration_ResultsService</esbCategoryName>
         <esbServiceName>ResultsService</esbServiceName>                  
         <bpmToEsbVars>
             <mapping bpm="theBody" esb="BODY_CONTENT" />
         </bpmToEsbVars>
         <esbToBpmVars>
             <mapping esb="BODY_CONTENT" bpm="theBody"/>
         </esbToBpmVars>
      </action>
  
      <transition to="end1"></transition>
   </node>
</process-definition>