Why ParallelMultiInstanceBehavior.leave() take all OutgoingTransitions ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2016 03:05 AM
I'm using Activiti 5.21.0 as BPM engine.
Asked to keep everything simple, i removed gateways(I know it is not good). Now the workflow is simpler. like
[img]https://camo.githubusercontent.com/458b61e9114bec5ee84e33d827e8f6f031f60e2a/687474703a2f2f7777772e63...[/img]
I set conditionExpression for every sequenceFlow, looking forward only one of userTask 2&3 would be activated depend on the exclusive condition set on the flows. It works fine only when userTask1 is not ParallelMultiInstanceTask. But if i set userTask1 parallel, when complete userTask1, no condition is calculated. userTask2 and userTask3 are both activated.
After looked through codes, i found that ParallelMultiInstanceBehavior.leave() act differently against other Behaviors.
I wonder if there are some reason when leaving ParallelMultiInstance, every outgoing should be taken. Is it possible to filter OutgoingTransitions using conditions?
Greetings.
Asked to keep everything simple, i removed gateways(I know it is not good). Now the workflow is simpler. like
[img]https://camo.githubusercontent.com/458b61e9114bec5ee84e33d827e8f6f031f60e2a/687474703a2f2f7777772e63...[/img]
I set conditionExpression for every sequenceFlow, looking forward only one of userTask 2&3 would be activated depend on the exclusive condition set on the flows. It works fine only when userTask1 is not ParallelMultiInstanceTask. But if i set userTask1 parallel, when complete userTask1, no condition is calculated. userTask2 and userTask3 are both activated.
After looked through codes, i found that ParallelMultiInstanceBehavior.leave() act differently against other Behaviors.
if (joinedExecutions.size() >= nrOfInstances || completionConditionSatisfied(execution)) { // Removing all active child executions (ie because completionCondition is true) List<ExecutionEntity> executionsToRemove = new ArrayList<ExecutionEntity>(); for (ActivityExecution childExecution : executionEntity.getParent().getExecutions()) { if (childExecution.isActive()) { executionsToRemove.add((ExecutionEntity) childExecution); } } for (ExecutionEntity executionToRemove : executionsToRemove) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Execution {} still active, but multi-instance is completed. Removing this execution.", executionToRemove); } executionToRemove.inactivate(); executionToRemove.deleteCascade("multi-instance completed"); } executionEntity.takeAll(executionEntity.getActivity().getOutgoingTransitions(), joinedExecutions);}
I wonder if there are some reason when leaving ParallelMultiInstance, every outgoing should be taken. Is it possible to filter OutgoingTransitions using conditions?
Greetings.
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2017 09:04 PM
I face the same problem like yours. yes, the takeall() won't evaluate any EL on the sequenceflow. Yesterday i update to activiti 6 and test it in a hurry. It seems fix this issue. Today I'll double check it.
