<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Why ParallelMultiInstanceBehavior.leave() take all OutgoingTransitions ? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/why-parallelmultiinstancebehavior-leave-take-all/m-p/220048#M173178</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using Activiti 5.21.0 as BPM engine. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Asked to keep everything simple, i removed gateways(I know it is not good). Now the workflow is simpler. like&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[img]&lt;/SPAN&gt;&lt;A href="https://camo.githubusercontent.com/458b61e9114bec5ee84e33d827e8f6f031f60e2a/687474703a2f2f7777772e6368616e6a61722e6d652f61637469766974692f676174657761792d6e6f6e652e706e67" rel="nofollow noopener noreferrer"&gt;https://camo.githubusercontent.com/458b61e9114bec5ee84e33d827e8f6f031f60e2a/687474703a2f2f7777772e6368616e6a61722e6d652f61637469766974692f676174657761792d6e6f6e652e706e67&lt;/A&gt;&lt;SPAN&gt;[/img]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I set conditionExpression for every sequenceFlow, looking forward only one of userTask 2&amp;amp;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After looked through codes, i found that ParallelMultiInstanceBehavior.leave() act differently against other Behaviors. &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;if (joinedExecutions.size() &amp;gt;= nrOfInstances || completionConditionSatisfied(execution)) {&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; // Removing all active child executions (ie because completionCondition is true)&lt;BR /&gt;&amp;nbsp; List&amp;lt;ExecutionEntity&amp;gt; executionsToRemove = new ArrayList&amp;lt;ExecutionEntity&amp;gt;();&lt;BR /&gt;&amp;nbsp; for (ActivityExecution childExecution : executionEntity.getParent().getExecutions()) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (childExecution.isActive()) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; executionsToRemove.add((ExecutionEntity) childExecution);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; for (ExecutionEntity executionToRemove : executionsToRemove) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (LOGGER.isDebugEnabled()) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOGGER.debug("Execution {} still active, but multi-instance is completed. Removing this execution.", executionToRemove);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; executionToRemove.inactivate();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; executionToRemove.deleteCascade("multi-instance completed");&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; executionEntity.takeAll(executionEntity.getActivity().getOutgoingTransitions(), joinedExecutions);&lt;BR /&gt;} &lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wonder if there are some reason when leaving ParallelMultiInstance, every outgoing should be taken. Is it possible to filter OutgoingTransitions using conditions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greetings.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Aug 2016 07:05:58 GMT</pubDate>
    <dc:creator>johnfan</dc:creator>
    <dc:date>2016-08-04T07:05:58Z</dc:date>
    <item>
      <title>Why ParallelMultiInstanceBehavior.leave() take all OutgoingTransitions ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/why-parallelmultiinstancebehavior-leave-take-all/m-p/220048#M173178</link>
      <description>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/687474703a2f2f7777772e6368616e6a61722e6d652f61637469766974692f6761746</description>
      <pubDate>Thu, 04 Aug 2016 07:05:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/why-parallelmultiinstancebehavior-leave-take-all/m-p/220048#M173178</guid>
      <dc:creator>johnfan</dc:creator>
      <dc:date>2016-08-04T07:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why ParallelMultiInstanceBehavior.leave() take all OutgoingTransitions ?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/why-parallelmultiinstancebehavior-leave-take-all/m-p/220049#M173179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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&amp;nbsp;seems fix this issue. Today I'll double check it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Dec 2017 02:04:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/why-parallelmultiinstancebehavior-leave-take-all/m-p/220049#M173179</guid>
      <dc:creator>bisgoon</dc:creator>
      <dc:date>2017-12-14T02:04:36Z</dc:date>
    </item>
  </channel>
</rss>

