4 Replies Latest reply on Jun 23, 2008 5:47 AM by Pavel Kadlec

    jBPM to ESB mapping

    Pavel Kadlec Novice

      Hello,

      I have child tokens in my business process execution. I've encountered "strange" behaviour. My sample esb service is called in the scope of child token. JBPM job that is created by esb JBpmCallbackService puts output variables from that sample esb service to the scope of root token as well, and not only to the scope of child token.

      I do not understand why there are these lines in org.jboss.soa.esb.services.jbpm.cmd.AsyncProcessSignal.AsyncSignalAction

       final int variableCount = Integer.parseInt((String)contextInstance.getVariableLocally(ESB_ASYNC_SIGNAL_VARIABLE_COUNT, token)) ;
       for(int count = 0 ; count < variableCount ; count++)
       {
       final String name = (String)contextInstance.getVariableLocally(ESB_ASYNC_SIGNAL_VARIABLE_NAMES + count, token) ;
       final Object value = contextInstance.getVariableLocally(name, token) ;
       // HERE YOU PUT VARIABLES TO SCOPE OF ROOT TOKEN
       contextInstance.setVariable(name, value) ;
       }
      


      When I delete these lines, I achieve desired (from my point of view) behaviour, not to put output variables to the scope of root token.

      I deleted this line in org.jboss.soa.esb.services.jbpm.cmd.AsyncProcessSignal.createSignalJob as well

      setVariable(contextInstance, token, ESB_ASYNC_SIGNAL_VARIABLE_NAMES + (count++), name) ;
      


      Regards
      Pavel