4 Replies Latest reply on Dec 14, 2009 8:10 AM by h.wolffenbuttel

    JBossESB with jBPM intergration fails?

    h.wolffenbuttel

      Hi,

      The implementation for intergrating jBPM with the ESB seems not to work like the userguide explains. My setup is reasonably simple: one service with a http port for recieving SOAP messages, a BpmProcessor action, a jBPM proces deployed with an implementation of an ActionHandler.

      The BpmProcessor configuration is as follows:

       <action class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor" name="StartVraagProcess">
       <property name="command" value="StartProcessInstanceCommand"/>
       <property name="process-definition-name" value="StUFBGVraagProces"/>
       <property name="esbToBpmVars">
       <mapping bpm="VRAAG_0204" esb="VRAAG_0204"/>
       </property>
       <property name="bpmToEsbVars">
       <mapping bpm="VRAAG_0204" esb="VRAAG_0204"/>
       <mapping bpm="ANTWOORD_0204" esb="ANTWOORD_0204"/>
       </property>
       </action>
      


      The implementation of the action handler:
      public class AnswerActionHandler implements ActionHandler {
      
       /**
       *
       */
       private static final long serialVersionUID = -588324065379402333L;
      
       public void execute(ExecutionContext exCtx) throws Exception {
       Token token = exCtx.getToken();
       ContextInstance context = token.getProcessInstance().getContextInstance();
       SynchroonAntwoordBericht syncAnswerMessage = null;
       String answerXML = (String)context.getVariable("Answer",token);
       if( answerXML!= null ){
       SynchroonAntwoordBericht answerMessage = ESBUtil.getMessage(answerXML);
       syncAnswerMessage = answerMessage ;
       }
       context.setVariable("ANTWOORD_0204", syncAnswerMessage , token);
       }
      }
      


      The syncAnswerMessage is filled with data, but when I look at the data in the ESB the data of the syncAnswerMessage is not added to the message as I would have expected.

      The question is if the property "bpmToEsbVars" works with the "StartProcessInstanceCommand" command. The userguide shows the same configuration what could mean it should work.

      What puzzled me is that the actionpipeline does not wait for the bpmprocess to be finished. Since I would like to return a Synchronous answer this would be desireable. There is a way for nodes to wait for an answer but is there also a way for the actionpipeline to wait for the bmp process?

      Regards,

      Hans