[jboss-user] [JBoss jBPM] - End process with running subprocess

kadlecp do-not-reply at jboss.com
Sun Aug 3 17:27:06 EDT 2008


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();
  | }

It is important that I check result value of sub process (I have special variable). If the subprocess is ended prematuraly, I read the result value (it's not set) and the superprocess can do what ever action I can. And moreover I can be sure that subprocess ends before the super process.

What do you think? It could be new feature request...


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168338#4168338

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4168338

More information about the jboss-user mailing list