6 Replies Latest reply on Mar 18, 2009 11:59 AM by Tom S

    JBPM process composition

    Tom S Newbie

      Hello,
      I am new to JBPM and trying to use process composition. My 2 processdefinition.xml files are listed at the bottom of this post.
      When I start the process 'process-civil-inquiry-fingerprints', it starts out OK.
      Then it correctly executes the first node (startFP).
      Then it correctly starts the sub-process "process-common-elements-1"
      Then it correctly executes the first node of "process-common-elements-1" process (start)
      Then it correctly executes the second node of that process (ProcessInstanceAssign)
      Then it fails with this exception:
      java.lang.NullPointerException
      at org.jbpm.graph.node.ProcessState.leave(ProcessState.java:186)
      at org.jbpm.graph.exe.Token.signal(Token.java:192)
      at org.jbpm.graph.exe.Token.signal(Token.java:140)
      at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:270)

      What am I doing wrong?
      I would appreciate any help.
      -T


      #####################################
      <process-definition name="process-civil-inquiry-fingerprints" initial="startFP">

      <!-- Process-wide definition - begin -->



      <!-- Process-wide definition - end -->

      <start-state name='startFP'>

      </start-state>

      <process-state name="common_1">
      <sub-process name="process-common-elements-1" />

      </process-state>

      <end-state name='end' />

      </process-definition>



      ########################################
      <process-definition name="process-common-elements-1" initial="start">

      <!-- Process-wide definition - begin -->






      <!-- Process-wide definition - end -->

      <!-- Node of the type 'start-state' is alwys required. All other nodes are optional-->
      <start-state name='start'>

      </start-state>
      <!-- -->

      <task-node name='ProcessInstanceAssign'>




      </task-node>

      <task-node name='agentGet'>




      </task-node>

      <task-node name='agentCredentialsGet'>




      </task-node>

      <task-node name='processInstanceInitialize'>




      </task-node>

      <end-state name='end'>
      </end-state>

      </process-definition>

        • 1. Re: JBPM process composition
          Brad Davis Novice

          Your start states dont have any transitions...

          • 2. Re: JBPM process composition-correction
            Tom S Newbie

            Sorry, the initial post HTML ate-up parts of the definition.
            Here they are again, this time complete:

            <process-definition name="process-civil-inquiry-fingerprints" initial="startFP">
            
             <!-- Process-wide definition - begin -->
             <event type='node-leave'>
             <action class='com.think.process.impl.jbpm.ActionHandler' />
             </event>
             <!-- Process-wide definition - end -->
            
             <start-state name='startFP'>
             <transition to='common_1' />
             </start-state>
            
             <process-state name="common_1">
             <sub-process name="process-common-elements-1" />
             <transition to='end' />
             </process-state>
            
             <end-state name='end' />
            
            </process-definition>
            
            
            
            <process-definition name="process-common-elements-1" initial="start">
            
             <!-- Process-wide definition - begin -->
             <event type='node-enter'>
             <action class='com.think.process.impl.jbpm.ActionHandler' />
             </event>
             <event type='node-leave'>
             <action class='com.think.process.impl.jbpm.ActionHandler' />
             </event>
             <!-- Process-wide definition - end -->
            
             <!-- Node of the type 'start-state' is alwys required. All other nodes are optional-->
             <start-state name='start'>
             <transition to='ProcessInstanceAssign' />
             </start-state>
             <!-- -->
            
             <task-node name='ProcessInstanceAssign'>
             <task>
             <assignment class='com.think.process.impl.jbpm.AssignmentHandler' />
             </task>
             <transition to='agentGet' />
             </task-node>
            
             <task-node name='agentGet'>
             <task>
             <assignment class='com.think.process.impl.jbpm.AssignmentHandler' />
             </task>
             <transition to='agentCredentialsGet' />
             </task-node>
            
             <task-node name='agentCredentialsGet'>
             <task>
             <assignment class='com.think.process.impl.jbpm.AssignmentHandler' />
             </task>
             <transition to='processInstanceInitialize' />
             </task-node>
            
             <task-node name='processInstanceInitialize'>
             <task>
             <assignment class='com.think.process.impl.jbpm.AssignmentHandler' />
             </task>
             <transition to='end' />
             </task-node>
            
             <end-state name='end'>
             </end-state>
            
            </process-definition>
            
            
            



            • 3. Re: JBPM process composition
              Ronald van Kuijk Master

              give transition names

              • 4. Re: JBPM process composition
                Tom S Newbie

                I named all the transitions. It made no difference.

                • 5. Re: JBPM process composition
                  Ronald van Kuijk Master

                  can you make a full unit test with embedded processdefinitions and actionhandlers like in the jBPM unittests and post that here?

                  • 6. Re: JBPM process composition
                    Tom S Newbie

                    Actually, I am rethinking the usefulness of the process composition feature.
                    I have several processes that share some elements. I thought factoring the shared elements out would work
                    What I need is this:
                    1. The parent process and child process must be identifiable by the same id.
                    2. Assignments made in either process must be visible to the other process.
                    It seems the "subprocess" gets different id than the parent process. Also, it appear the assignments made in the subprocess would not be visible in the parent process.
                    So it looks I would end-up with 2 separate process id (parent + child) as well as assignment mismatch.
                    Unless I am incorrect here I think I will just add the steps to the all processes, despite the multiplication factor.
                    Am I missing something here?