<?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 Re: Service tasks in parallel executed multiple times  in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16789#M7442</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to me one path available is to create a reproducer test case and see if this is a bug in the engine. The closest I could find to an existing test is&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/gateway/ParallelGatewayTest.java" title="https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/gateway/ParallelGatewayTest.java" rel="nofollow noopener noreferrer"&gt;Activiti/ParallelGatewayTest.java at develop · Activiti/Activiti · GitHub&lt;/A&gt;&amp;nbsp;&amp;nbsp;which uses&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/gateway/ParallelGatewayTest.testAsyncBehavior.bpmn20.xml" title="https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/gateway/ParallelGatewayTest.testAsyncBehavior.bpmn20.xml" rel="nofollow noopener noreferrer"&gt;Activiti/ParallelGatewayTest.testAsyncBehavior.bpmn20.xml at develop · Activiti/Activiti · GitHub&lt;/A&gt;&amp;nbsp;. But it's not service tasks, I didn't find an example of that (I&amp;nbsp;searched the codebase for &lt;SPAN style="color: #0000ff; background-color: #e4e4ff; font-weight: bold;"&gt;activiti&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #efefef; font-weight: bold;"&gt;:async&lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #efefef; font-weight: bold;"&gt;="true" &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #e4e4ff; font-weight: bold;"&gt;activiti&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #efefef; font-weight: bold;"&gt;:exclusive&lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #efefef; font-weight: bold;"&gt;="false"&lt;/SPAN&gt;). Another path, and perhaps you can try both, might be to set a process variable specific for each of&amp;nbsp;your parallel service tasks when they get run so that you know when it has been invoked and can hopefully use the variable to stop it from being run a second time if it has already completed correctly. I am speculating but it could be that in this instance your service tasks are completing&amp;nbsp;adequately for your purposes&amp;nbsp;but getting retried because the Activiti thinks that one might have failed. (Another path might be to set exclusive=true but presumably you don't want to do that as you're looking for the performance gain of running these tasks in parallel.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Dec 2017 09:16:04 GMT</pubDate>
    <dc:creator>ryandawson</dc:creator>
    <dc:date>2017-12-18T09:16:04Z</dc:date>
    <item>
      <title>Service tasks in parallel executed multiple times</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16783#M7436</link>
      <description>I am trying to use my service tasks in parallel. By research, I learnt that to use servicetasks in parallel, I need to make changes such as&amp;nbsp;async=true and exlusive= false. After these changes, I managed to execute my service tasks in parallel but what I recognized now is, randomly, some service task</description>
      <pubDate>Fri, 15 Dec 2017 11:57:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16783#M7436</guid>
      <dc:creator>osaxdelta</dc:creator>
      <dc:date>2017-12-15T11:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Service tasks in parallel executed multiple times</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16784#M7437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you post what your bpmn is and the content of your service tasks?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm thinking maybe you mean something&amp;nbsp;that fits one of the examples&amp;nbsp;under these engine tests -&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/multiinstance/MultiInstanceTest.java" title="https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/multiinstance/MultiInstanceTest.java" rel="nofollow noopener noreferrer"&gt;Activiti/MultiInstanceTest.java at develop · Activiti/Activiti · GitHub&lt;/A&gt;&amp;nbsp; which use BPMN from&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Activiti/Activiti/tree/develop/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/multiinstance" title="https://github.com/Activiti/Activiti/tree/develop/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/multiinstance" rel="nofollow noopener noreferrer"&gt;Activiti/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/multiinstance at develop · Activiti/Activiti ·…&lt;/A&gt;&amp;nbsp;. But Possibly you mean something different.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2017 18:21:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16784#M7437</guid>
      <dc:creator>ryandawson</dc:creator>
      <dc:date>2017-12-15T18:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Service tasks in parallel executed multiple times</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16785#M7438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; async=true and exlusive= false&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In parallel, if you make the above settings for each of the two service tasks, they are executed simultaneously on each asynchronous thread.&lt;BR /&gt;And if you place a parallel gateway after the service task and join it, you should get an exclusive error trying to update the process instance entity at the same time.&lt;/P&gt;&lt;P&gt;(ex)&amp;nbsp;&lt;SPAN&gt;ProcessInstance[15001] was updated by another transaction concurrently&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you get&amp;nbsp;an exclusive error, the asynchronous&amp;nbsp;service&amp;nbsp;task should retry.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://connect.hyland.com/legacyfs/online/alfresco/18249_Parallel_async_service_tasks.png" style="width: 620px; height: 211px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, if you&amp;nbsp;&lt;SPAN&gt;place a activity that wait a action like user task, you shouldn't get an exclusive error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://connect.hyland.com/legacyfs/online/alfresco/18250_Parallel_async_service_tasks.png_with_user_task.png" style="width: 620px; height: 206px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For detail, please check the following document.&lt;BR /&gt;&lt;A href="https://www.activiti.org/userguide/#exclusiveJobs" rel="nofollow noopener noreferrer"&gt;https://www.activiti.org/userguide/#exclusiveJobs&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Dec 2017 12:45:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16785#M7438</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-16T12:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Service tasks in parallel executed multiple times</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16786#M7439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After reading Daisuke's reply below I'm pretty sure that I misinterpreted and you mean processing of different service tasks in parallel, not multiple instances executing the same service logic as I had first thought. My apologies, Daisuke's reply is much more useful &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Dec 2017 12:17:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16786#M7439</guid>
      <dc:creator>ryandawson</dc:creator>
      <dc:date>2017-12-17T12:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Service tasks in parallel executed multiple times</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16787#M7440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In our current application, our service tasks are only used to send http rest request to other services. So, I am afraid using user tasks after service task for wait action is not an option. In other words, our processes&amp;nbsp;will consist only service tasks and they are automated. There won't be any user interaction after running the process( Some of our service tasks might be 10 or more&amp;nbsp;hours long. So, retrying service task that have already done will be disastrous ) Is there any other solution like increasing database thread-pool capacity or disabling database update etc.?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2017 08:14:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16787#M7440</guid>
      <dc:creator>osaxdelta</dc:creator>
      <dc:date>2017-12-18T08:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Service tasks in parallel executed multiple times</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16788#M7441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes I meant service tasks in parallel. Sorry I did not make it so clear.&amp;nbsp;Thank you anyways &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2017 08:19:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16788#M7441</guid>
      <dc:creator>osaxdelta</dc:creator>
      <dc:date>2017-12-18T08:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Service tasks in parallel executed multiple times</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16789#M7442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to me one path available is to create a reproducer test case and see if this is a bug in the engine. The closest I could find to an existing test is&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/gateway/ParallelGatewayTest.java" title="https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/gateway/ParallelGatewayTest.java" rel="nofollow noopener noreferrer"&gt;Activiti/ParallelGatewayTest.java at develop · Activiti/Activiti · GitHub&lt;/A&gt;&amp;nbsp;&amp;nbsp;which uses&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/gateway/ParallelGatewayTest.testAsyncBehavior.bpmn20.xml" title="https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/test/resources/org/activiti/engine/test/bpmn/gateway/ParallelGatewayTest.testAsyncBehavior.bpmn20.xml" rel="nofollow noopener noreferrer"&gt;Activiti/ParallelGatewayTest.testAsyncBehavior.bpmn20.xml at develop · Activiti/Activiti · GitHub&lt;/A&gt;&amp;nbsp;. But it's not service tasks, I didn't find an example of that (I&amp;nbsp;searched the codebase for &lt;SPAN style="color: #0000ff; background-color: #e4e4ff; font-weight: bold;"&gt;activiti&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #efefef; font-weight: bold;"&gt;:async&lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #efefef; font-weight: bold;"&gt;="true" &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #e4e4ff; font-weight: bold;"&gt;activiti&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #efefef; font-weight: bold;"&gt;:exclusive&lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #efefef; font-weight: bold;"&gt;="false"&lt;/SPAN&gt;). Another path, and perhaps you can try both, might be to set a process variable specific for each of&amp;nbsp;your parallel service tasks when they get run so that you know when it has been invoked and can hopefully use the variable to stop it from being run a second time if it has already completed correctly. I am speculating but it could be that in this instance your service tasks are completing&amp;nbsp;adequately for your purposes&amp;nbsp;but getting retried because the Activiti thinks that one might have failed. (Another path might be to set exclusive=true but presumably you don't want to do that as you're looking for the performance gain of running these tasks in parallel.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2017 09:16:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16789#M7442</guid>
      <dc:creator>ryandawson</dc:creator>
      <dc:date>2017-12-18T09:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Service tasks in parallel executed multiple times</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16790#M7443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will present a solution that is compatible with only your use case.&lt;BR /&gt;It is not a general-purpose solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Some of our service tasks might be 10 or more hours long.&lt;BR /&gt;&amp;gt; So, retrying service task that have already done will be disastrous&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can shift the element to retry.&lt;BR /&gt;Please place the element that doesn't wait like service task or non throwing event after each your service tasks(long time processing).And, you must set the element async=true.&lt;/P&gt;&lt;P&gt;If so, your service tasks(long time processing) will not retry and the additional element may retry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://connect.hyland.com/legacyfs/online/alfresco/18264_solution_process.png" style="width: 620px; height: 254px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2017 12:45:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16790#M7443</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-18T12:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Service tasks in parallel executed multiple times</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16791#M7444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much!!!! This approach was very useful to us!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2017 13:40:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/service-tasks-in-parallel-executed-multiple-times/m-p/16791#M7444</guid>
      <dc:creator>osaxdelta</dc:creator>
      <dc:date>2017-12-18T13:40:59Z</dc:date>
    </item>
  </channel>
</rss>

