[jboss-user] [JBoss jBPM] - cancel process instance including subprocesses

Thomas.Kriechbaum do-not-reply at jboss.com
Thu Sep 11 03:58:01 EDT 2008


what's the recommended way to cancel a process instance and it's subprocesses as well (jbpm-jpdl 3.2.2).

Within a remote interface I'm invoking the org.jbpm.command.CancelProcessInstanceCommand having cancelSubProcesses set to true.

First of all, there seams to be a bug in the method cancelSubProcesses, because the HQL-Query "GraphSession.findSubProcessInstances" requires the parameter "processInstance" and not "instanceId". I will report this issue.

The main problem is, that when canceling a sub process the super process gets a signal and continues as defined by the process definition. In my particular case, new task instances are created that are not canceled as expected.

Here is the source code from ProcessInstance.end

  | /**
  |  *ends (=cancels) this process instance and all the tokens in it.
  | **/
  |  public void end() {
  |     ...
  |       // check if this process was started as a subprocess of a super process
  |       if (superProcessToken!=null) {
  |         addCascadeProcessInstance(superProcessToken.getProcessInstance());
  |         ExecutionContext superExecutionContext = new ExecutionContext(superProcessToken);
  |         superExecutionContext.setSubProcessInstance(this);
  |         superProcessToken.signal(superExecutionContext);
  |       }
  |       ...
  |     }
  |   }

The posting  http://www.jboss.com/index.html?module=bb&op=viewtopic&t=72442 almost deals with the same question, but no replies have been sent at the moment.


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

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

More information about the jboss-user mailing list