Skip to content

Commit 357edab

Browse files
Merge branch 'main' of github.com:flowable/flowable-engine into flowable-release-7.0.0
2 parents 527bb1f + 08c20eb commit 357edab

12 files changed

+840
-37
lines changed

modules/flowable-engine/src/main/java/org/flowable/engine/impl/dynamic/AbstractDynamicStateManager.java

Lines changed: 126 additions & 26 deletions
Large diffs are not rendered by default.

modules/flowable-engine/src/main/java/org/flowable/engine/impl/dynamic/MoveExecutionEntityContainer.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public class MoveExecutionEntityContainer {
4343
protected String newOwnerId;
4444
protected Map<String, ExecutionEntity> continueParentExecutionMap = new HashMap<>();
4545
protected Map<String, FlowElementMoveEntry> moveToFlowElementMap = new LinkedHashMap<>();
46+
protected Map<String, Map<String, Object>> flowElementLocalVariableMap = new HashMap<>();
4647
protected List<String> newExecutionIds = new ArrayList<>();
4748

4849
public MoveExecutionEntityContainer(List<ExecutionEntity> executions, List<String> moveToActivityIds) {
@@ -206,6 +207,18 @@ public void addNewExecutionId(String executionId) {
206207
this.newExecutionIds.add(executionId);
207208
}
208209

210+
public Map<String, Map<String, Object>> getFlowElementLocalVariableMap() {
211+
return flowElementLocalVariableMap;
212+
}
213+
214+
public void setFlowElementLocalVariableMap(Map<String, Map<String, Object>> flowElementLocalVariableMap) {
215+
this.flowElementLocalVariableMap = flowElementLocalVariableMap;
216+
}
217+
218+
public void addLocalVariableMap(String activityId, Map<String, Object> localVariables) {
219+
this.flowElementLocalVariableMap.put(activityId, localVariables);
220+
}
221+
209222
public static class FlowElementMoveEntry {
210223

211224
protected FlowElement originalFlowElement;

modules/flowable-engine/src/main/java/org/flowable/engine/impl/dynamic/ProcessInstanceChangeState.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class ProcessInstanceChangeState {
3434
protected Map<String, List<ExecutionEntity>> processInstanceActiveEmbeddedExecutions;
3535
protected List<MoveExecutionEntityContainer> moveExecutionEntityContainers;
3636
protected HashMap<String, ExecutionEntity> createdEmbeddedSubProcess = new HashMap<>();
37+
protected HashMap<String, ExecutionEntity> createdMultiInstanceRootExecution = new HashMap<>();
3738
protected HashMap<StartEvent, ExecutionEntity> pendingEventSubProcessesStartEvents = new HashMap<>();
3839

3940
public ProcessInstanceChangeState() {
@@ -100,6 +101,18 @@ public void addCreatedEmbeddedSubProcess(String key, ExecutionEntity executionEn
100101
this.createdEmbeddedSubProcess.put(key, executionEntity);
101102
}
102103

104+
public HashMap<String, ExecutionEntity> getCreatedMultiInstanceRootExecution() {
105+
return createdMultiInstanceRootExecution;
106+
}
107+
108+
public void setCreatedMultiInstanceRootExecution(HashMap<String, ExecutionEntity> createdMultiInstanceRootExecution) {
109+
this.createdMultiInstanceRootExecution = createdMultiInstanceRootExecution;
110+
}
111+
112+
public void addCreatedMultiInstanceRootExecution(String key, ExecutionEntity executionEntity) {
113+
this.createdMultiInstanceRootExecution.put(key, executionEntity);
114+
}
115+
103116
public Map<String, List<ExecutionEntity>> getProcessInstanceActiveEmbeddedExecutions() {
104117
return processInstanceActiveEmbeddedExecutions;
105118
}

modules/flowable-engine/src/main/java/org/flowable/engine/impl/persistence/entity/ExecutionEntityImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ public boolean isEnded() {
10661066
return isEnded;
10671067
}
10681068

1069-
public boolean setIsEnded() {
1069+
public boolean getIsEnded() {
10701070
return isEnded;
10711071
}
10721072

modules/flowable-engine/src/test/java/org/flowable/engine/test/api/runtime/migration/ProcessInstanceMigrationMultiInstanceTest.java

Lines changed: 520 additions & 8 deletions
Large diffs are not rendered by default.

modules/flowable-engine/src/test/java/org/flowable/engine/test/api/runtime/migration/ProcessInstanceMigrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,15 +1441,15 @@ public void testSimpleMigrationWithMultiInstanceTask() {
14411441
.contains("parallelTasks");
14421442

14431443
if (HistoryTestHelper.isHistoryLevelAtLeast(HistoryLevel.ACTIVITY, processEngineConfiguration)) {
1444-
checkActivityInstances(procDefTwoTasks, processInstance, "userTask", "beforeMultiInstance", "parallelTasks", "parallelTasks", "parallelTasks", "parallelTasks");
1444+
checkActivityInstances(procDefTwoTasks, processInstance, "userTask", "beforeMultiInstance", "parallelTasks", "parallelTasks");
14451445

14461446
checkTaskInstance(procDefTwoTasks, processInstance, "beforeMultiInstance", "parallelTasks", "parallelTasks", "parallelTasks", "parallelTasks");
14471447
}
14481448

14491449
completeProcessInstanceTasks(processInstance.getId());
14501450

14511451
if (HistoryTestHelper.isHistoryLevelAtLeast(HistoryLevel.ACTIVITY, processEngineConfiguration)) {
1452-
checkActivityInstances(procDefTwoTasks, processInstance, "userTask", "beforeMultiInstance", "parallelTasks", "parallelTasks", "parallelTasks", "parallelTasks");
1452+
checkActivityInstances(procDefTwoTasks, processInstance, "userTask", "beforeMultiInstance", "parallelTasks", "parallelTasks");
14531453

14541454
checkTaskInstance(procDefTwoTasks, processInstance, "beforeMultiInstance", "parallelTasks", "parallelTasks", "parallelTasks", "parallelTasks");
14551455
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<definitions id="definition"
3+
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
4+
xmlns:flowable="http://flowable.org/bpmn"
5+
targetNamespace="Examples">
6+
7+
<process id="parallelMultiInstanceSubProcess">
8+
9+
<startEvent id="theStart"/>
10+
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="beforeMultiInstance"/>
11+
<userTask id="beforeMultiInstance"/>
12+
<sequenceFlow sourceRef="beforeMultiInstance" targetRef="callActivity"/>
13+
14+
<callActivity id="callActivity" calledElement="oneTaskProcess">
15+
<multiInstanceLoopCharacteristics isSequential="false" flowable:collection="myCollection" flowable:elementVariable="myElement" />
16+
</callActivity>
17+
18+
<sequenceFlow id="flow2" sourceRef="callActivity" targetRef="afterMultiInstance"/>
19+
<userTask id="afterMultiInstance"/>
20+
<sequenceFlow id="flow3" sourceRef="afterMultiInstance" targetRef="theEnd"/>
21+
<endEvent id="theEnd"/>
22+
23+
</process>
24+
25+
</definitions>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<definitions id="definition"
3+
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
4+
xmlns:flowable="http://flowable.org/bpmn"
5+
targetNamespace="Examples">
6+
7+
<process id="parallelMultiInstanceSubProcess">
8+
9+
<startEvent id="theStart"/>
10+
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="beforeMultiInstance"/>
11+
<userTask id="beforeMultiInstance"/>
12+
<sequenceFlow sourceRef="beforeMultiInstance" targetRef="task"/>
13+
14+
<serviceTask id="task" flowable:expression="${'test'}" flowable:async="true">
15+
<multiInstanceLoopCharacteristics isSequential="false" flowable:collection="myCollection" flowable:elementVariable="myElement" />
16+
</serviceTask>
17+
18+
<sequenceFlow id="flow2" sourceRef="task" targetRef="afterMultiInstance"/>
19+
<userTask id="afterMultiInstance"/>
20+
<sequenceFlow id="flow3" sourceRef="afterMultiInstance" targetRef="theEnd"/>
21+
<endEvent id="theEnd"/>
22+
23+
</process>
24+
25+
</definitions>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<definitions id="definition"
3+
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
4+
xmlns:flowable="http://flowable.org/bpmn"
5+
targetNamespace="Examples">
6+
7+
<process id="parallelMultiInstanceSubProcess">
8+
9+
<startEvent id="theStart"/>
10+
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="beforeMultiInstance"/>
11+
<userTask id="beforeMultiInstance"/>
12+
<sequenceFlow sourceRef="beforeMultiInstance" targetRef="parallelMISubProcess"/>
13+
14+
<subProcess id="parallelMISubProcess" name="Multi Instance Sequential SubProcess">
15+
<multiInstanceLoopCharacteristics isSequential="false" flowable:collection="myCollection" flowable:elementVariable="myElement" />
16+
<startEvent id="parallelSubProcStart"/>
17+
<sequenceFlow id="subFlow1" sourceRef="parallelSubProcStart" targetRef="subtask"/>
18+
<callActivity id="subtask" calledElement="oneTaskProcess" />
19+
<sequenceFlow id="subFlow2" sourceRef="subtask" targetRef="parallelSubProcEnd"/>
20+
<endEvent id="parallelSubProcEnd"/>
21+
</subProcess>
22+
23+
<sequenceFlow id="flow2" sourceRef="parallelMISubProcess" targetRef="afterMultiInstance"/>
24+
<userTask id="afterMultiInstance"/>
25+
<sequenceFlow id="flow3" sourceRef="afterMultiInstance" targetRef="theEnd"/>
26+
<endEvent id="theEnd"/>
27+
28+
</process>
29+
30+
</definitions>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<definitions id="definition"
3+
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
4+
xmlns:flowable="http://flowable.org/bpmn"
5+
targetNamespace="Examples">
6+
7+
<process id="parallelMultiInstanceSubProcess">
8+
9+
<startEvent id="theStart"/>
10+
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="beforeMultiInstance"/>
11+
<userTask id="beforeMultiInstance"/>
12+
<sequenceFlow sourceRef="beforeMultiInstance" targetRef="parallelMISubProcess"/>
13+
14+
<subProcess id="parallelMISubProcess" name="Multi Instance Sequential SubProcess">
15+
<multiInstanceLoopCharacteristics isSequential="false" flowable:collection="myCollection" flowable:elementVariable="myElement" />
16+
<startEvent id="parallelSubProcStart"/>
17+
<sequenceFlow id="subFlow1" sourceRef="parallelSubProcStart" targetRef="subTask1"/>
18+
<userTask id="subTask1"/>
19+
<sequenceFlow id="subFlow2" sourceRef="subTask1" targetRef="parallelSubProcEnd"/>
20+
<endEvent id="parallelSubProcEnd"/>
21+
</subProcess>
22+
23+
<sequenceFlow id="flow2" sourceRef="parallelMISubProcess" targetRef="afterMultiInstance"/>
24+
<userTask id="afterMultiInstance"/>
25+
<sequenceFlow id="flow3" sourceRef="afterMultiInstance" targetRef="theEnd"/>
26+
<endEvent id="theEnd"/>
27+
28+
</process>
29+
30+
</definitions>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<definitions id="definition"
3+
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
4+
xmlns:flowable="http://flowable.org/bpmn"
5+
targetNamespace="Examples">
6+
7+
<process id="parallelMultiInstanceSubProcess">
8+
9+
<startEvent id="theStart"/>
10+
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="beforeMultiInstance"/>
11+
<userTask id="beforeMultiInstance"/>
12+
<sequenceFlow sourceRef="beforeMultiInstance" targetRef="parallelMISubProcess"/>
13+
14+
<subProcess id="parallelMISubProcess" name="Multi Instance Sequential SubProcess">
15+
<multiInstanceLoopCharacteristics isSequential="false" flowable:collection="myCollection" flowable:elementVariable="myElement" />
16+
<startEvent id="parallelSubProcStart"/>
17+
<sequenceFlow id="subFlow1" sourceRef="parallelSubProcStart" targetRef="subtask"/>
18+
<serviceTask id="subtask" flowable:expression="${'test'}" flowable:async="true" />
19+
<sequenceFlow id="subFlow2" sourceRef="subtask" targetRef="parallelSubProcEnd"/>
20+
<endEvent id="parallelSubProcEnd"/>
21+
</subProcess>
22+
23+
<sequenceFlow id="flow2" sourceRef="parallelMISubProcess" targetRef="afterMultiInstance"/>
24+
<userTask id="afterMultiInstance"/>
25+
<sequenceFlow id="flow3" sourceRef="afterMultiInstance" targetRef="theEnd"/>
26+
<endEvent id="theEnd"/>
27+
28+
</process>
29+
30+
</definitions>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<definitions id="definition"
3+
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
4+
xmlns:flowable="http://flowable.org/bpmn"
5+
targetNamespace="Examples">
6+
7+
<process id="parallelMultiInstanceSubProcess">
8+
9+
<startEvent id="theStart"/>
10+
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="beforeMultiInstance"/>
11+
<userTask id="beforeMultiInstance"/>
12+
<sequenceFlow sourceRef="beforeMultiInstance" targetRef="task"/>
13+
14+
<userTask id="task" flowable:assignee="kermit">
15+
<multiInstanceLoopCharacteristics isSequential="false" flowable:collection="myCollection" flowable:elementVariable="myElement" />
16+
</userTask>
17+
18+
<sequenceFlow id="flow2" sourceRef="task" targetRef="afterMultiInstance"/>
19+
<userTask id="afterMultiInstance"/>
20+
<sequenceFlow id="flow3" sourceRef="afterMultiInstance" targetRef="theEnd"/>
21+
<endEvent id="theEnd"/>
22+
23+
</process>
24+
25+
</definitions>

0 commit comments

Comments
 (0)