Community

creating a sub process instance throw error: org.jbpm.JbpmException: couldn't signal without specifying a leaving transition : transition is null

reply from Mehul Verma in jBPM Development - View the full discussion

I have three process say P1,P2,P3. P1 is my main process which in turn calls P2 and P2 calls P3. In my case P1 executes fine and calls P2. When P2 reaches its End node i get this error. Folliwing are the process def. files for the processes.

 

 

<?xml version="1.0" encoding="ISO-8859-1"  ?>
- <process-definition name="P-1">
- <swimlane name="TestSwimlane">
  <assignment pooled-actors="TestSwimlane" />
  </swimlane>
- <start-state name="s1">
  <task name="s1"  swimlane="TestSwimlane" />
  <transition to="t1" name="to t1" />
  </start-state>
- <task-node name="t1">
- <task name="t1"  swimlane="TestSwimlane">
  <controller allowAttachments="false" />
  </task>
- <transition to="e1" name="to e1">
- <action class="com.mypack.process.action.CallProcess" config-type="bean">
  <processName>A-2</processName>
  </action>
  </transition>
  </task-node>
  <end-state name="e1" />
  </process-definition>
Second Process:
<?xml version="1.0" encoding="ISO-8859-1"  ?>
- <process-definition name="P-2">
- <swimlane name="TestSwimlane">
  <assignment pooled-actors="TestSwimlane" />
  </swimlane>
- <start-state name="s2">
  <task name="s2"  swimlane="TestSwimlane" />
  <transition to="t2" name="to t2" />
  </start-state>
- <task-node name="t2">
- <task name="t2"  swimlane="TestSwimlane">
  <controller allowAttachments="false" />
  </task>
- <transition to="e2" name="to e2">
- <action class="com.mypack.process.action.CallProcess" config-type="bean">
  <processName>A-3</processName>
  </action>
  </transition>
  </task-node>
  <end-state name="e2" />
  </process-definition>
Third Process:
<?xml version="1.0" encoding="ISO-8859-1"  ?>
- <process-definition name="P-3">
- <swimlane name="TestSwimlane">
  <assignment pooled-actors="TestSwimlane" />
  </swimlane>
- <start-state name="s3">
  <task name="s3"  swimlane="TestSwimlane" />
  <transition to="t3" name="to t3" />
  </start-state>
- <task-node name="t3">
- <task name="t3"  swimlane="TestSwimlane">
  <controller allowAttachments="false" />
  </task>
  <transition to="e3" name="to e3" />
  </task-node>
  <end-state name="e3" />
  </process-definition>
Code :
public void execute(ExecutionContext executionContext) throws Exception {

 

        // debug("entering call process action handler");
        String name = null;

 

        try {

 

            name = getProcessName();           

 

            ProcessInstance processInst = ProcessUtil.newProcessInstance(name);
            Task task = Util.getStartTask(processInst.getProcessDefinition());

 

            Token superProcessTOken = executionContext.getToken();
            processInst.setSuperProcessToken(superProcessTOken); // If i comment this line i don't get this error.

 

           ........code to extract caller data......

            TaskInstance ti = Util.initProcess(processInst, task, values,
                    false);

 

            if (ti != null) {
                // setup the swimlane instance
                Swimlane swm = ti.getTask().getSwimlane();
                if (s != null) {
                    String assignment = swm.getPooledActorsExpression();
                    if (!Strings.isEmpty(assignment)) {
                        ti.getSwimlaneInstance().setPooledActors(
                                assignment.split(","));
                    }

 

                    ti.end();
                }
            }
I hope now you can understand.

Reply to this message by going to Community

Start a new discussion in jBPM Development at Community