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

    jBPM to ESB mapping

      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




        • 1. Re: jBPM to ESB mapping
          kconner

           

          "kadlecp" wrote:
          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.

          That is correct, they are currently accessible to all tokens within the process.

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

          So that they can be made available to all tokens within the process.

          "kadlecp" wrote:
          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.

          Adding a scope for this would be a good idea.


          • 2. Re: jBPM to ESB mapping
            kconner
            • 3. Re: jBPM to ESB mapping

              Shall I create feature request? I would appreciate that possibility.

              Thanks
              Pavel

              • 4. Re: jBPM to ESB mapping

                Sorry, I am too quick.

                Thank you
                Pavel