<?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: Async Job Executor only executes job after lock expiration in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/async-job-executor-only-executes-job-after-lock-expiration/m-p/25355#M10989</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kamlesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply, but unfortunately this does not seem to help. I've configured the defaultASsyncJobAcquireWaitTimeInMillis parameter during the initialisation of my Spring Boot Application, but it does not seem to help. I've noticed something interesting though. It does not happen if I have two process engines, one which creates the jobs (Async Executor Disabled), and the other one executing them (Async Executor Enabled). But still, this is really strange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the rest api from where some of my workflows are launched ties itself to the executor and not the producer engine. Does anybody how I can tie the rest api to a particular workflow engine when using Spring Boot? I've marked the producerProcessEngine as primary, but that does not seem to help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bean id="producerProcessEngine" class="org.activiti.spring.ProcessEngineFactoryBean" primary="true"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;property name="processEngineConfiguration" ref="producerProcessEngineConfiguration" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/bean&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;bean id="executorProcessEngine" class="org.activiti.spring.ProcessEngineFactoryBean"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;property name="processEngineConfiguration" ref="executorProcessEngineConfiguration" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/bean&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;BR /&gt;Jürg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Oct 2017 11:58:58 GMT</pubDate>
    <dc:creator>jritter</dc:creator>
    <dc:date>2017-10-06T11:58:58Z</dc:date>
    <item>
      <title>Async Job Executor only executes job after lock expiration</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/async-job-executor-only-executes-job-after-lock-expiration/m-p/25353#M10987</link>
      <description>HiWe are currently in the process of upgrading our Activiti deployment from version 6.18 to version 6.0, which includes also the new Async Job executor. While giving activiti 6 a try, I noticed something which I could not explain:The documentation says, that if the asyncExecutor for a process engine</description>
      <pubDate>Fri, 29 Sep 2017 14:00:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/async-job-executor-only-executes-job-after-lock-expiration/m-p/25353#M10987</guid>
      <dc:creator>jritter</dc:creator>
      <dc:date>2017-09-29T14:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Async Job Executor only executes job after lock expiration</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/async-job-executor-only-executes-job-after-lock-expiration/m-p/25354#M10988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have had&amp;nbsp;similar experience with 5.22 we use. Seems the&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;asyncExecutorDefaultAsyncJobAcquireWaitTime config does not apply on asyncExecutor. I tried to check config.getAsyncExecutor().getDefaultAsyncJobAcquireWaitTimeInMillis() it still returns default value (10 sec) even though I set it to 2 sec. Any how, i then set it by&amp;nbsp;&lt;SPAN&gt;config.getAsyncExecutor().setDefaultAsyncJobAcquireWaitTimeInMillis(2000) on startup of my application and it works. That said I yet to figure out why it would not take initial config from &lt;SPAN style="background-color: #ffffff;"&gt;asyncExecutorDefaultAsyncJobAcquireWaitTime&lt;/SPAN&gt;. I use spring boot version and tried to set it by processEngineConfigurationConfigurer. Hope this helps &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;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Oct 2017 21:36:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/async-job-executor-only-executes-job-after-lock-expiration/m-p/25354#M10988</guid>
      <dc:creator>kam</dc:creator>
      <dc:date>2017-10-03T21:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Async Job Executor only executes job after lock expiration</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/async-job-executor-only-executes-job-after-lock-expiration/m-p/25355#M10989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kamlesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply, but unfortunately this does not seem to help. I've configured the defaultASsyncJobAcquireWaitTimeInMillis parameter during the initialisation of my Spring Boot Application, but it does not seem to help. I've noticed something interesting though. It does not happen if I have two process engines, one which creates the jobs (Async Executor Disabled), and the other one executing them (Async Executor Enabled). But still, this is really strange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the rest api from where some of my workflows are launched ties itself to the executor and not the producer engine. Does anybody how I can tie the rest api to a particular workflow engine when using Spring Boot? I've marked the producerProcessEngine as primary, but that does not seem to help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bean id="producerProcessEngine" class="org.activiti.spring.ProcessEngineFactoryBean" primary="true"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;property name="processEngineConfiguration" ref="producerProcessEngineConfiguration" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/bean&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;bean id="executorProcessEngine" class="org.activiti.spring.ProcessEngineFactoryBean"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;property name="processEngineConfiguration" ref="executorProcessEngineConfiguration" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/bean&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;BR /&gt;Jürg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2017 11:58:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/async-job-executor-only-executes-job-after-lock-expiration/m-p/25355#M10989</guid>
      <dc:creator>jritter</dc:creator>
      <dc:date>2017-10-06T11:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Async Job Executor only executes job after lock expiration</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/async-job-executor-only-executes-job-after-lock-expiration/m-p/25356#M10990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I experienced same, and opened a &lt;A href="https://stackoverflow.com/questions/47535257/activiti-6-sometime-waits-5-minutes-before-starting-a-process-instance" rel="nofollow noopener noreferrer"&gt;stackoverflow&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2017 20:20:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/async-job-executor-only-executes-job-after-lock-expiration/m-p/25356#M10990</guid>
      <dc:creator>haridaniel</dc:creator>
      <dc:date>2017-11-28T20:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Async Job Executor only executes job after lock expiration</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/async-job-executor-only-executes-job-after-lock-expiration/m-p/25357#M10991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems I found a workaround to address the problem:&lt;BR /&gt;-Start the process in a transaction.&lt;/P&gt;&lt;P&gt;-Suspend the process in same transaction.&lt;/P&gt;&lt;P&gt;-Activate the process after transaction commit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Implementation in spring environment:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String processInstanceId = runtimeService.startProcessInstanceByKey(processId, variableMap).getId();&lt;/P&gt;&lt;P&gt;runtimeService.suspendProcessInstanceById(processInstanceId);&lt;/P&gt;&lt;P&gt;transactionTool.afterCommit(() -&amp;gt; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;runtimeService.activateProcessInstanceById(processInstanceId);&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public class TransactionTool {&lt;/P&gt;&lt;P&gt;public void afterCommit(Runnable runnable) {&lt;BR /&gt; if (TransactionSynchronizationManager.isActualTransactionActive()) {&lt;BR /&gt; logger.trace("Transaction exists, registering runnable after commit.");&lt;BR /&gt; TransactionSynchronizationManager.registerSynchronization(&lt;BR /&gt; new TransactionSynchronizationAdapter() {&lt;BR /&gt; @Override&lt;BR /&gt; public void afterCommit() {&lt;BR /&gt; logger.trace("Commit done, executing runnable.");&lt;BR /&gt; runnable.run();&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; } else {&lt;BR /&gt; logger.trace("Transaction not exists, executing runnable in-place.");&lt;BR /&gt; runnable.run();&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2017 23:31:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/async-job-executor-only-executes-job-after-lock-expiration/m-p/25357#M10991</guid>
      <dc:creator>haridaniel</dc:creator>
      <dc:date>2017-11-30T23:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Async Job Executor only executes job after lock expiration</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/async-job-executor-only-executes-job-after-lock-expiration/m-p/25358#M10992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've done some research and provided my findings as another answer to the StackOverflow thread mentioned above&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/47535257/activiti-6-sometime-waits-5-minutes-before-starting-async-process-instance/50125043#50125043" rel="nofollow noopener noreferrer"&gt;Tasks marked as 'Async' and not 'Exclusive' causes the issue&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 23:26:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/async-job-executor-only-executes-job-after-lock-expiration/m-p/25358#M10992</guid>
      <dc:creator>oluetkeh</dc:creator>
      <dc:date>2018-05-01T23:26:50Z</dc:date>
    </item>
  </channel>
</rss>

