4 Replies Latest reply on Jan 16, 2009 11:49 AM by Kevin Conner

    missing jbpmTokenId when Signaling to jbpm

    Alejandro Montenegro Novice

      Hi,
      I have been fighting for a while with how to signal a jbpm process from an esb

      My process definition is:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition xmlns="" name="scoring">
      
      
       <start-state name="Servicio de Scoring">
       <task name="Ingresar Informacion Inicial">
       <controller>
       <variable access="read,write,required" name="rut"></variable>
       <variable access="read,write,required" name="digitoVerificador"></variable>
       <variable access="read,write,required" name="numSerie"></variable>
       </controller>
       </task>
       <transition to="EvaluacionG" name="to EvaluacionG"></transition>
       </start-state>
      
      <!-- Calling a service -->
       <node name="EvaluacionG">
       <action class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
       <esbServiceName>EvaluacionG</esbServiceName>
       <esbCategoryName>ScoringService</esbCategoryName>
       <bpmToEsbVars>
       <mapping bpm="rut" esb="BODY_CONTENT" />
       </bpmToEsbVars>
       </action>
       <transition to="InfoAdicional"></transition>
       </node>
      
       <task-node name="InfoAdicional">
       <task name="Ingresar Informacion Adicional">
       .....
      


      and my service is:

      <?xml version = "1.0" encoding = "UTF-8"?>
      <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
      
       <providers>
       <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
       <jms-bus busid="quickstartEsbChannel">
       <jms-message-filter
       dest-type="QUEUE"
       dest-name="queue/quickstart_helloworld_Request_esb"
       />
       </jms-bus>
      
       </jms-provider>
       </providers>
      
       <services>
       <service
       category="ScoringService"
       name="EvaluacionG"
       description="Hello World">
       <listeners>
       <jms-listener name="helloWorld"
       busidref="quickstartEsbChannel"
       />
       </listeners>
       <actions mep="OneWay">
       <action name="action2" class="org.jboss.soa.esb.actions.SystemPrintln">
       <property name="printfull" value="true"/>
       </action>
       <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
       <property name="message" value="Message before action XXX" />
       </action>
       <action name="send_signal" class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
       <property name="command" value="SignalCommand" />
       </action>
       </actions>
       </service>
       </services>
      
      </jbossesb>
      


      Based on Burr's comment on http://www.jboss.com/index.html?module=bb&op=viewtopic&t=116868 jbpmTokenId should be injected by the ESBActionHandler, so I don't why the signal is not captured by the jbpm and process stay frozen.

      any help is appretiated.

      Alejandro

        • 1. Re: missing jbpmTokenId when Signaling to jbpm
          Kevin Conner Master

          You should no longer be signalling the process directly as the interactions are now controlled by jBPM. Have you looked at the bpm quickstarts?

          We will shortly be adding some functionality for querying and cancelling a process instance, in addition to what is currently possible, but the signal command will be permanently removed as it is unsafe. It should have been removed when the jBPM integration was rewritten but we missed it.

          Kev

          • 2. Re: missing jbpmTokenId when Signaling to jbpm
            Alejandro Montenegro Novice

            actually there is no reference for the SignalCommand at the Service Guide only at the Programmers Guide.

            • 3. Re: missing jbpmTokenId when Signaling to jbpm
              Alejandro Montenegro Novice

              So actually I removed the SignalCommand

              <?xml version = "1.0" encoding = "UTF-8"?>
              <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
              
               <providers>
               <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
               <jms-bus busid="quickstartEsbChannel">
               <jms-message-filter
               dest-type="QUEUE"
               dest-name="queue/quickstart_helloworld_Request_esb"
               />
               </jms-bus>
              
               </jms-provider>
               </providers>
              
               <services>
               <service
               category="ScoringService"
               name="EvaluacionG"
               description="Hello World">
               <listeners>
               <jms-listener name="helloWorld"
               busidref="quickstartEsbChannel"
               />
               </listeners>
               <actions mep="OneWay">
               <action name="action1"
               class="org.jboss.soa.esb.samples.quickstart.helloworld.MyJMSListenerAction"
               process="displayMessage"
               />
               </actions>
               </service>
               </services>
              </jbossesb>
              


              But the process still got frozen after executing the action in the service, its like it's not able to signal jBPM.
              The only difference I see is that I start the process at the jBPM console, so I'm not sure if I have to some way pass the process id to the ESB or this is automatically done by ESBActionHandler, and if so what could be wrong as it get frozen after executing the service, and the only way to continue the execution is by signaling at the jbpm console.

              any advice?

              • 4. Re: missing jbpmTokenId when Signaling to jbpm
                Kevin Conner Master

                When you start a process, either through the console or ESB, you are ceding control to that business process. From that point onwards the business process should be responsible for invoking the ESB (and other) services as required.

                Have you looked at the bpm quickstarts? We have a number which show how to integrate with the ESB.