[jbpm-commits] JBoss JBPM SVN: r6155 - jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Feb 2 12:32:10 EST 2010
Author: jbarrez
Date: 2010-02-02 12:32:09 -0500 (Tue, 02 Feb 2010)
New Revision: 6155
Modified:
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/EndActivity.java
Log:
JBPM-2740: work on embedded subprocess
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/EndActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/EndActivity.java 2010-02-02 12:00:18 UTC (rev 6154)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/EndActivity.java 2010-02-02 17:32:09 UTC (rev 6155)
@@ -23,6 +23,7 @@
import java.util.List;
+import org.jbpm.api.Execution;
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.model.Activity;
import org.jbpm.api.model.OpenExecution;
@@ -72,12 +73,22 @@
executionToEnd = execution;
}
+ ExecutionImpl parent = (ExecutionImpl) executionToEnd.getParent(); // save parent before it is nullified
+
if (state==null) {
execution.end(executionToEnd);
} else {
execution.end(executionToEnd, state);
}
- }
+
+ // Special case: if during concurrent execution all child executions are ended,
+ // then the parent execution must be ended too.
+ if (parent != null && parent.getExecutions().isEmpty()
+ && Execution.STATE_INACTIVE_CONCURRENT_ROOT.equals(parent.getState()) ) {
+ parent.end();
+ }
+ }
+
}
public void setEndProcessInstance(boolean endProcessInstance) {
More information about the jbpm-commits
mailing list