1 2 Previous Next 18 Replies Latest reply on Jan 10, 2008 6:55 AM by Arutha Belron

    ESB & jBPM variables integration problem

    Arutha Belron Newbie

      Good afternoon,
      I've been running into a problem the past two days; here's the situation: I'm running jBoss ESB with jBoss jBPM. I've got a process definition running, and I'm calling a service on the buss from that process for serializing an object and attaching it to the message. When I get to the next node of the process however, this attached object is gone.

      I know what the problem is, I've had the same thing about three months back , but the same solution does not seem to apply, mainly because the labels changed, most likely ^^

      Here's the post I made back then, in essense the same problem with an older ESB version: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079172#4079172

      I'm currently running Jboss ESB4.2 MR3 with jBPM integrated.

      Basically, the two main components in this application are the bus definition(jboss-esb.xml) and the jBPM definition (process.xml)

      The node where things go bad in the process definition:

      Code:

      <node name="ZorgringFormatConversionNode">
       <event type="node-enter">
       <action name="esbAction" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
       <esbCategoryName>ZorgRingConnectServices</esbCategoryName>
       <esbServiceName>ConversionToZorgringFormatService</esbServiceName>
       <millisToWaitForResponse>5000</millisToWaitForResponse>
       <jbpmToEsbVars>
       <mapping jbpm-name="theBody" esb-name="BODY_CONTENT" />
       <mapping jbpm-name="zorgringformat" esb-name="defaultEntry" />
       </jbpmToEsbVars>
       <returnVars>
       <mapping jbpm-name="theBody" esb-name="BODY_CONTENT" />
       <mapping jbpm-name="zorgringformat" esb-name="defaultEntry" />
       </returnVars>
       </action>
       </event>
       <transition name="" to="MEDFormatConversionNode"/>
       </node>




      This node calls a service on the bus, this service calls an actionclass which attaches the object to the message and returns the message to the service. Next, the process goes to the next node. By then, the object is gone.


      I'm sure this has to do with the jbpmToEsbVars and returnVars I'm declaring. I do this on the ESB once when initialising the business process:

      Code:

      <action name="signal_the_new_process_instance"
       class="org.jboss.soa.esb.services.jbpm.actions.BpmProcessor">
       <property name="command" value="SignalCommand" />
       <property name="process-definition-name" value="processMessageDefinition"/>
       <property name="esb-to-jbpm">
       <variables>
       <variable esb-name="eVar1" jbpm-name="counter" value="45" />
       <variable esb-name="BODY_CONTENT" jbpm-name="theBody" />
       <variable esb-name="defaultEntry" jbpm-name="zorgringformat" />
       </variables>
       </property>
       </action>





      And I declare the same jbpmToEsbVars and returnVars on each node. When I'm adding the object, I attach it with the label "zorgringformat"(retrieving it in the same actionclass right after I added it works, so it's simply lost in the process somewhere). Any idea what I'm doing wrong?

        • 1. Re: ESB & jBPM variables integration problem
          Kurt Stam Master

          Instead of:

          <property name="esb-to-jbpm">
           <variables>
           <variable esb-name="eVar1" jbpm-name="counter" value="45" />
           <variable esb-name="BODY_CONTENT" jbpm-name="theBody" />
           <variable esb-name="defaultEntry" jbpm-name="zorgringformat" />
           </variables>
          


          Can you try something like:

          <property name="object-paths">
           <object-path esb="eVar1" bpm="counter" value="45"/>
          </property>
          


          --Kurt

          • 2. Re: ESB & jBPM variables integration problem
            Arutha Belron Newbie


            Hey, thanks for the quick reply.
            So, I've tried out your suggestion in using the 'object-path' syntax, it gives a nullpointer when walking through the nodes now, most likely because the BODY_CONTENT is not mapped as well this time and I end up with an empty message.

            What I basically changed in the process that 1) initializes my Business process and 2) signals the process to begin is:

            <property name="esb-to-jbpm">
             <variables>
             <variable esb-name="eVar1" jbpm-name="counter" value="45" />
             <variable esb-name="BODY_CONTENT" jbpm-name="theBody" />
             <variable esb-name="zorgringformat" jbpm-name="zorgringformat" />
             </variables>
             </property>


            into:

            <property name="object-paths">
             <object-path esb="eVar1" bpm="counter" value="45"/>
             <object-path esb="BODY_CONTENT" bpm="theBody" />
             <object-path esb="zorgringformat" bpm="zorgringformatBPM" />
             </property>


            and changing the labels (ie zorgringformatBPM) correspondingly in the business process definition, of course. This change causes a nullpointer directly.

            A note, I do not make any mappings in service #2, called in the second node of the business process, the or in the original case , because there is no specific routing action to assign this property to, since the business process definition defines the next step. Not sure if this matters.

            • 3. Re: ESB & jBPM variables integration problem
              Arutha Belron Newbie


              & I think I forgot to mention, I'm running jboss-4.0.5.GA.

              • 4. Re: ESB & jBPM variables integration problem
                Mark Little Master

                Can you upgrade to the latest versions of AS and ESB?

                • 5. Re: ESB & jBPM variables integration problem
                  Arutha Belron Newbie


                  Might be a good thing, tried to avoid that until I got this line-up workong.
                  Building it on JbossAS 4.2.2GA & JbossESB4.2.1GA now.

                  • 6. Re: ESB & jBPM variables integration problem
                    Arutha Belron Newbie


                    I had this problem yesterday too, seems the labs.jboss.com site is slow, sometimes not loading. I managed to get the AS off, but jBoss ESB download won't load, perhaps overloaded or under maintenance.

                    • 7. Re: ESB & jBPM variables integration problem
                      Arutha Belron Newbie


                      Ok, I've taken a leap back.
                      I'm basically running two processes, but while debugging I'm stuck at the end of the first. This is what I'm seeing:

                      Caused by: org.jbpm.JbpmException: couldn't signal token 'Token(/)' : node EndState(messagesEndNode)' doesn't have a default transition


                      Something that was fixed when going from 4.2 to 4.2.1.
                      Yet, I'm running a newly downloaded and installed JbossAS 4.2.2 with a fresh configured Jboss ESB 4.2.1 deployed to it.

                      I have no idea why this message pops up.

                      • 8. Re: ESB & jBPM variables integration problem
                        Kurt Stam Master

                        No idea either, note though that ESB is only tested with JBossAS-4.2.1. (We try to keep the version number in line with the version we test on) --Kurt

                        • 9. Re: ESB & jBPM variables integration problem
                          Arutha Belron Newbie

                           

                          "mark.little@jboss.com" wrote:
                          Can you upgrade to the latest versions of AS and ESB?


                          Though I saw there was an integrated download with JbossAS 4.2.1 that should've tipped me off more: Grmbl...

                          • 10. Re: ESB & jBPM variables integration problem
                            Arutha Belron Newbie


                            Running it on JbossAS4.2.1GA gives a similar result.

                            • 11. Re: ESB & jBPM variables integration problem
                              Kurt Stam Master

                              Can you post your processdefinition.xml and the relevant section of your jboss-esb.xml?

                              • 12. Re: ESB & jBPM variables integration problem
                                Arutha Belron Newbie


                                My ESB usage and configuration is based on a much earlier version. I've been trying the relevant samples Business Orchestration and they all seem to work. I'm going to synchronize the jboss-ESB xml, will most likely solve some problems, perhaps this one too.

                                • 13. Re: ESB & jBPM variables integration problem
                                  Arutha Belron Newbie


                                  A belated update,
                                  I've been running Jboss ESB 4.2.1GA and Jboss AS 4.2.1,
                                  but the problem remains; in the next node of the business process, the serialized object is no longer present.

                                  The related business process nodes in the code:

                                  <node name="ZorgringFormatConversionNode">
                                   <action name="esbAction"
                                   class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
                                   <esbCategoryName>
                                   ZorgringConnectServices
                                   </esbCategoryName>
                                   <esbServiceName>ConversionToZorgringFormatService</esbServiceName>
                                   <jbpmToEsbVars>
                                   <mapping jbpm="theBody" esb="BODY_CONTENT" />
                                   <mapping jbpm="theZorgringformat" esb="zorgringformat" />
                                   </jbpmToEsbVars>
                                   <returnVars>
                                   <mapping jbpm="theBody" esb="BODY_CONTENT" />
                                   <mapping jbpm="theZorgringformat" esb="zorgringformat" />
                                   </returnVars>
                                   </action>
                                   <transition to="MEDFormatConversionNode"></transition>
                                   </node>
                                  
                                   <node name="MEDFormatConversionNode">
                                   <action name="esbAction"
                                   class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
                                   <esbCategoryName>
                                   ZorgringConnectServices
                                   </esbCategoryName>
                                   <esbServiceName>ConversionToMEDFormatService</esbServiceName>
                                   <jbpmToEsbVars>
                                   <mapping jbpm="theBody" esb="BODY_CONTENT" />
                                   <mapping jbpm="theZorgringformat" esb="zorgringformat" />
                                   </jbpmToEsbVars>
                                   <returnVars>
                                   <mapping jbpm="theBody" esb="BODY_CONTENT" />
                                   <mapping jbpm="theZorgringformat" esb="zorgringformat" />
                                   </returnVars>
                                   </action>
                                   <transition to="ForwardNode"></transition>
                                   </node>


                                  The related ESB-specification code:

                                  <service category="ZorgringConnectServices" name="ConversionToZorgringFormatService"
                                   description="TestService">
                                   <listeners>
                                   <jms-listener name="ESB-Listener" busidref="zorgringFormatChannel"
                                   maxThreads="1"/>
                                   </listeners>
                                   <actions>
                                   <action name="routeAction" class="org.jboss.soa.esb.actions.StaticRouter">
                                   <property name="destinations">
                                   <route-to service-category="ZorgringConnectServices" service-name="Signal_Service" />
                                   </property>
                                  
                                   <property name="object-paths">
                                   <object-path esb="BODY_CONTENT" bpm="theBody" />
                                   <object-path esb="contentsAsString" bpm="theData" />
                                   <object-path esb="zorgringformat" bpm="theZorgringformat" />
                                   </property>
                                   </action>
                                   </actions>
                                   </service>
                                  
                                   <service category="ZorgringConnectServices" name="ConversionToMEDFormatService"
                                   description="TestService">
                                   <listeners>
                                   <jms-listener name="ESB-Listener" busidref="medFormatChannel"
                                   maxThreads="1"/>
                                   </listeners>
                                   <actions>
                                   <action name="routeAction" class="org.jboss.soa.esb.actions.StaticRouter">
                                   <property name="destinations">
                                   <route-to service-category="ZorgringConnectServices" service-name="Signal_Service" />
                                   </property>
                                  
                                   <property name="object-paths">
                                   <object-path esb="BODY_CONTENT" bpm="theBody" />
                                   <object-path esb="contentsAsString" bpm="theData" />
                                   <object-path esb="zorgringformat" bpm="theZorgringformat" />
                                   </property>
                                   </action>
                                   </actions>
                                   </service>



                                  The Signal_Service-service is a service signalling the business process to go to the next step given the jbpmtokenid attached to the message that corresponds to a business process instance. The mechanism itself works fine.

                                  • 14. Re: ESB & jBPM variables integration problem
                                    Kurt Stam Master

                                    Your config files look good to me. The handling to BODY_CONTENT was changed, so maybe there is a bug in there somewhere. You can either try debugging it with logging or the debugger, or no longer use BODY_CONTENT at all, but simply another named parameter. Either way, when you get it to work, can you file a jira if it turns out to be a bug?

                                    thx,

                                    --Kurt

                                    1 2 Previous Next