Hello,
I have following scenario.
I have process that sometimes creates subprocess. The subprocess has several async actions (I call ESB service). The super process checks result value of the subprocess and according that value the superprocess continues.
I sometimes want to end superprocess prematurely with possible running subprocess. And that causes problems. The superprocess instance receives end, it ends root token and after that it ends the subprocess instance. After the subprocess instance ends, subprocess signals token of the superprocess which has been ended already, and that is wrong.
I have made following change to the org.jbpm.graph.exe.ProcessInstance
I have changed method ProcessInstance.end() slightly.
public void end() { // if the subproces does not exist, end root token if (rootToken.getSubProcessInstance() == null) { rootToken.end(); .... the code is unchanged } else // if subprocess instance exists, only end subprocess. The subprocess will signal this process later rootToken.getSubProcessInstance().end(); }