<?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: Activiti parallel execution of subProcesses in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16196#M7180</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;I customized your BPMN and tried it in Activiti 5.22.0 , but I could not reproduce it.&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;The &lt;SPAN&gt;problems&lt;/SPAN&gt; may depend on your user program.&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&amp;gt; the result I have two problems:&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&amp;gt; 1. &lt;STRONG style="border: 0px; font-weight: bold;"&gt;Level2 Prescore&amp;nbsp;&lt;/STRONG&gt;service task of&amp;nbsp;&lt;STRONG style="border: 0px; font-weight: bold;"&gt;level2PrescoringProcess&amp;nbsp;&lt;/STRONG&gt;starts with significant delay (more than timer event value, tried even PT1S).&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&amp;gt; 2.&amp;nbsp;&lt;STRONG style="border: 0px; font-weight: bold;"&gt;dbTaskPrescoringProcess&amp;nbsp;&lt;/STRONG&gt;executes twice. Sometimes even after the parent process has been finished ("&lt;STRONG style="border: 0px; font-weight: bold;"&gt;Print result&lt;/STRONG&gt;" service task has been completed).&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;Is there a stack trace at the time of the above problem occurrence?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jun 2017 03:35:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-06-14T03:35:24Z</dc:date>
    <item>
      <title>Activiti parallel execution of subProcesses</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16195#M7179</link>
      <description>I'm trying to implement the following workflow:there are 3 separate subProcesses (dbTaskPrescoringProcess, level1PrescoringProcess and level2PrescoringProcess) that should be executed in concurrently. So I've added the following properties to&amp;nbsp;each process:&amp;nbsp;activiti:async="true" activiti:exclusive="f</description>
      <pubDate>Mon, 12 Jun 2017 15:23:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16195#M7179</guid>
      <dc:creator>semenchikus</dc:creator>
      <dc:date>2017-06-12T15:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti parallel execution of subProcesses</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16196#M7180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;I customized your BPMN and tried it in Activiti 5.22.0 , but I could not reproduce it.&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;The &lt;SPAN&gt;problems&lt;/SPAN&gt; may depend on your user program.&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&amp;gt; the result I have two problems:&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&amp;gt; 1. &lt;STRONG style="border: 0px; font-weight: bold;"&gt;Level2 Prescore&amp;nbsp;&lt;/STRONG&gt;service task of&amp;nbsp;&lt;STRONG style="border: 0px; font-weight: bold;"&gt;level2PrescoringProcess&amp;nbsp;&lt;/STRONG&gt;starts with significant delay (more than timer event value, tried even PT1S).&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&amp;gt; 2.&amp;nbsp;&lt;STRONG style="border: 0px; font-weight: bold;"&gt;dbTaskPrescoringProcess&amp;nbsp;&lt;/STRONG&gt;executes twice. Sometimes even after the parent process has been finished ("&lt;STRONG style="border: 0px; font-weight: bold;"&gt;Print result&lt;/STRONG&gt;" service task has been completed).&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;Is there a stack trace at the time of the above problem occurrence?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jun 2017 03:35:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16196#M7180</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-14T03:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti parallel execution of subProcesses</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16197#M7181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="padding: 0px;"&gt;Thank you very much for your reply!&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;I'm not sure how to make a stack trace at the time of the problem occurrence, so I can show the source code of my test client application (&lt;A href="https://www.dropbox.com/s/mvitangetyc3ths/ActivitiExample.zip?dl=0" rel="nofollow noopener noreferrer"&gt;client app&lt;/A&gt;) and 2 cases of running. In the Prescore service tasks I'm just emulating some long-running processing using cycle.&lt;/P&gt;&lt;P style="padding: 0px;"&gt;1. I've started process by REST&amp;nbsp;request (&lt;STRONG&gt;StartProcessController&lt;/STRONG&gt;). Both subProcesses (&lt;STRONG&gt;dbTaskPrescoringProcess&lt;/STRONG&gt; and &lt;STRONG&gt;level2PrescoringProcess&lt;/STRONG&gt;)&amp;nbsp;start normally, so &lt;STRONG&gt;Level2Prescore&lt;/STRONG&gt; service task should start approximately in 1 second (at 10:52:55) by the timer event, but it starts in 10 seconds after subProcess startup (&lt;SPAN style="color: #808080;"&gt;Level2 Prescoring started at&amp;nbsp;&lt;SPAN&gt;10:53:04.529&lt;/SPAN&gt;&lt;/SPAN&gt;).&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;SPAN style="color: #808080; font-size: 12px;"&gt;Process has started at 10:52:54.194&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080; font-size: 12px;"&gt;DB Prescoring started at 10:52:54.256...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080; font-size: 12px;"&gt;onLevel2Prescoring at 10:52:54.258&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080; font-size: 12px;"&gt;DB Prescoring finised at 10:53:04.264.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080; font-size: 12px;"&gt;Level2 Prescoring started at 10:53:04.529...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080; font-size: 12px;"&gt;Level2 Prescoring finised at 10:53:04.531.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;SPAN style="color: #000000; font-size: 15px;"&gt;1.&amp;nbsp;Similar to the first example, but here&amp;nbsp;DB prescoring service task executes 2 times without any reasons.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;SPAN style="color: #808080; font-size: 13px;"&gt;Process has started at 10:58:25.468&lt;BR /&gt;DB Prescoring started at 10:58:25.496...&lt;BR /&gt;onLevel2Prescoring at 10:58:25.518&lt;BR /&gt;Level2 Prescoring started at 10:58:34.629...&lt;BR /&gt;Level2 Prescoring finised at 10:58:34.630.&lt;BR /&gt;DB Prescoring finised at 10:58:35.510.&lt;BR /&gt;DB Prescoring started at 10:58:54.632...&lt;BR /&gt;DB Prescoring finised at 10:59:04.635.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;SPAN style="color: #000000; font-size: 15px;"&gt;Hopefully, it's my bad, because I don't understand why these issues apprear.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;SPAN style="color: #000000; font-size: 15px;"&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;SPAN style="color: #000000; font-size: 15px;"&gt;Simon&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jun 2017 09:18:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16197#M7181</guid>
      <dc:creator>semenchikus</dc:creator>
      <dc:date>2017-06-14T09:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti parallel execution of subProcesses</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16198#M7182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can solve this problem by enabling exclusion of subprocess like the following.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;activiti:exclusive="true"&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Activiti engine performs optimistic locking of process instance entity.&lt;BR /&gt;So,dbTaskPrescoringProcess and level2PrescoringProcess work concurrently in each asynchronous thread and first sub process can commit and second sub process fail to commit by optimistic locking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The JobExecutor of Activiti engine re-execute the failed job.&lt;BR /&gt;So, dbTaskPrescoringProcess is executed twice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked this exeception message in the table act_ru_job.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;ProcessInstance[5] was updated by another transaction concurrently&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Reference&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://www.activiti.org/userguide/#exclusiveJobs" rel="nofollow noopener noreferrer" target="_blank"&gt;https://www.activiti.org/userguide/#exclusiveJobs&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jun 2017 16:31:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16198#M7182</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-14T16:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti parallel execution of subProcesses</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16199#M7183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, making subProcesses exclusive will resolve the second problem. Unfortunately&amp;nbsp;in this case &lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;dbTaskPrescoringProcess &lt;/SPAN&gt;and&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;level2PrescoringProcess&lt;/SPAN&gt;&amp;nbsp;cannot be executed at the same time, but I need to execute these subProcesses at the same time... I will try to move them into separate processes instead of subprocesses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jun 2017 17:16:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16199#M7183</guid>
      <dc:creator>semenchikus</dc:creator>
      <dc:date>2017-06-14T17:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti parallel execution of subProcesses</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16200#M7184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmm, looks like moving my subprocesses to separate processes will be quite tricky because I need to work with shared data between each process. Are there any possible ways to implement multiple parallel asynchronous tasks/subProcesses/processes/whatever that will be really concurrent and have shared data (like variables) feature?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jun 2017 18:33:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16200#M7184</guid>
      <dc:creator>semenchikus</dc:creator>
      <dc:date>2017-06-14T18:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti parallel execution of subProcesses</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16201#M7185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sorry that finally I completely understood what you want to do.&lt;/P&gt;&lt;P&gt;You want to process them completely in parallel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jun 2017 22:09:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16201#M7185</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-14T22:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti parallel execution of subProcesses</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16202#M7186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, the task is really tricky&amp;nbsp;&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;&amp;nbsp;Still have no idea how to implement this design...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jun 2017 07:59:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16202#M7186</guid>
      <dc:creator>semenchikus</dc:creator>
      <dc:date>2017-06-15T07:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti parallel execution of subProcesses</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16203#M7187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, it is not a very good method, but it may be solved by raising the revision of the exclusive control target entity.&lt;/P&gt;&lt;P&gt;For example,in DbTaskPrescoringDelegate.class, you should add the following code.&lt;BR /&gt;But, if you use the same variable between parallel executions, you should raise the VariableInstanceEntity and HistoricVariableInstanceEntity too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;ExecutionEntity execution = Context.getCommandContext().getDbSqlSession().findInCache(ExecutionEntity.class, delegateExecution.getId());&lt;BR /&gt;ExecutionEntity rootExecution = execution.getParent().getParent();&lt;/P&gt;&lt;P&gt;rootExecution.setRevision(rootExecution.getRevisionNext());&lt;BR /&gt;Context.getCommandContext().getDbSqlSession().update(rootExecution);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Jun 2017 13:19:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16203#M7187</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-17T13:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti parallel execution of subProcesses</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16204#M7188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This method doesn't seem safe enough to be used in production unfortunately. I'm thinking about start different processes for each business task and work with&amp;nbsp;shared data using&amp;nbsp;DB. Or even make custom solution&amp;nbsp;using&amp;nbsp;JMS instead of Activiti because the business tasks have strict timeout of execution (in milliseconds, &amp;lt;1s) and there is no Timer Catch Event with &amp;lt; 1 second waiting value in the Activiti...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, thank you very much for this solution! You are an expert in this framework.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jun 2017 09:25:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/activiti-parallel-execution-of-subprocesses/m-p/16204#M7188</guid>
      <dc:creator>semenchikus</dc:creator>
      <dc:date>2017-06-19T09:25:30Z</dc:date>
    </item>
  </channel>
</rss>

