<?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: How to control serviceTask execution in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38801#M16322</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion. I had been thinking about an option like this, so I am glad to see it as somewhat recommended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know the default JobExecutor does not handle this situation, and we are supposed to be able to supply a different one, but there is no documentation on that kind of thing. I would prefer to get to one solution instead of a solution per workflow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 May 2017 17:30:50 GMT</pubDate>
    <dc:creator>robdiana72</dc:creator>
    <dc:date>2017-05-23T17:30:50Z</dc:date>
    <item>
      <title>How to control serviceTask execution</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38799#M16320</link>
      <description>In Activiti, we have a need to control how jobs (serviceTasks) are executed. More specifically, we have some jobs that we want to limit to 2 concurrently, but other jobs may run 10 concurrently. All of these jobs are serviceTasks, no Timers or other async code. I have looked at the JobExecutor (and</description>
      <pubDate>Mon, 22 May 2017 11:29:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38799#M16320</guid>
      <dc:creator>robdiana72</dc:creator>
      <dc:date>2017-05-22T11:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to control serviceTask execution</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38800#M16321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't believe this is something you will be able to control using the Job Executor parameters.&lt;/P&gt;&lt;P&gt;These are general parameters to manage your job pool and maximum number of concurrent jobs so you can manage your memory, threads and other JVM resources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the service tasks that are restricted to two concurrent executions, I believe you will need to handle these in a different way.&lt;/P&gt;&lt;P&gt;I would have the service task b a stand alone application that reached into the process engine to see if there are any jobs waiting (or alternatively have the process add a message to a queue and have the handler monitor the queue) . The handler will then execute the job and respond (say on a message bus). The message listener in the process can then pull the payload and move on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way the self contained handler can manage how many concurrent requests it handles. The approach also throttles execution such that all messages get handled in due course, but not necessarily immediately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Camunda engine (a fork of activiti) implements this pattern as what they call external tasks:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.camunda.org/manual/7.4/user-guide/process-engine/external-tasks/" title="https://docs.camunda.org/manual/7.4/user-guide/process-engine/external-tasks/" rel="nofollow noopener noreferrer"&gt;External Tasks | docs.camunda.org&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;BR /&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 May 2017 18:23:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38800#M16321</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-05-22T18:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to control serviceTask execution</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38801#M16322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion. I had been thinking about an option like this, so I am glad to see it as somewhat recommended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know the default JobExecutor does not handle this situation, and we are supposed to be able to supply a different one, but there is no documentation on that kind of thing. I would prefer to get to one solution instead of a solution per workflow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2017 17:30:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38801#M16322</guid>
      <dc:creator>robdiana72</dc:creator>
      <dc:date>2017-05-23T17:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to control serviceTask execution</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38802#M16323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;Since the Async Job executor was introduced the ability to completely override the Job Executor seems to have gone away.&lt;BR /&gt;There used to be a setJobExecutor method in the ProcessEngineConfigurationImpl class but it appears to be missing now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, you can still overload the Job Handlers with your own implementation (which is likely all you need).&lt;/P&gt;&lt;P&gt;Custom Job handlers are registered against a given job type (e.g. ProcessEventJobHandler).&lt;/P&gt;&lt;P&gt;Hopefully this will give you what you need.&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2017 20:04:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38802#M16323</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-05-23T20:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to control serviceTask execution</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38803#M16324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; There used to be a setJobExecutor method in the ProcessEngineConfigurationImpl class but it appears to be missing now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;・Synchronous Job Executor&lt;/P&gt;&lt;P&gt;You should override DefaultJobExecutor.class and setJobExecutor to ProcessEngineConfiguration.&lt;/P&gt;&lt;P&gt;ProcessEngineConfiguration.setJobExecutor(org.activiti.engine.impl.jobexecutor.JobExecutor jobExecutor)&lt;BR /&gt;&lt;A href="https://www.activiti.org/javadocs/org/activiti/engine/ProcessEngineConfiguration.html#setJobExecutor-org.activiti.engine.impl.jobexecutor.JobExecutor-" rel="nofollow noopener noreferrer"&gt;https://www.activiti.org/javadocs/org/activiti/engine/ProcessEngineConfiguration.html#setJobExecutor-org.activiti.engine.impl.jobexecutor.JobExecutor-&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;・Async Job Executor&lt;BR /&gt;You should override DefaultAsyncJobExecutor.class and &lt;SPAN&gt;setAsyncExecutor&lt;/SPAN&gt; to ProcessEngineConfiguration.&lt;/P&gt;&lt;P&gt;ProcessEngineConfiguration.setAsyncExecutor(org.activiti.engine.impl.asyncexecutor.AsyncExecutor asyncExecutor)&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.activiti.org/javadocs/org/activiti/engine/ProcessEngineConfiguration.html#setAsyncExecutor-org.activiti.engine.impl.asyncexecutor.AsyncExecutor-" rel="nofollow noopener noreferrer"&gt;https://www.activiti.org/javadocs/org/activiti/engine/ProcessEngineConfiguration.html#setAsyncExecutor-org.activiti.engine.impl.asyncexecutor.AsyncExecutor-&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2017 23:21:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38803#M16324</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-23T23:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to control serviceTask execution</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38804#M16325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no such method in the current ProcessEngineConfiguration classes.&lt;BR /&gt;Refer:&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/main/java/org/activiti/engine/ProcessEngineConfiguration.java" title="https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/main/java/org/activiti/engine/ProcessEngineConfiguration.java" rel="nofollow noopener noreferrer"&gt;Activiti/ProcessEngineConfiguration.java at master · Activiti/Activiti · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And:&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java" title="https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java" rel="nofollow noopener noreferrer"&gt;Activiti/ProcessEngineConfigurationImpl.java at master · Activiti/Activiti · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This method appears to have disappeared in version 5.14.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 May 2017 23:35:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38804#M16325</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-05-23T23:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to control serviceTask execution</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38805#M16326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check this two lines.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/main/java/org/activiti/engine/ProcessEngineConfiguration.java#L787" title="https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/main/java/org/activiti/engine/ProcessEngineConfiguration.java#L787" rel="nofollow noopener noreferrer"&gt;https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/main/java/org/activiti/engine/ProcessEngineConfiguration.java#L787&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/main/java/org/activiti/engine/ProcessEngineConfiguration.java#L796" title="https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/main/java/org/activiti/engine/ProcessEngineConfiguration.java#L796" rel="nofollow noopener noreferrer"&gt;https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/main/java/org/activiti/engine/ProcessEngineConfiguration.java#L796&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 00:29:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38805#M16326</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-05-24T00:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to control serviceTask execution</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38806#M16327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My apologies, when I grep'd my source I could not find this reference.&lt;/P&gt;&lt;P&gt;So as long as your configuration class extends ProcessEngineConfiguration you will have the ability to define a custom JobExecutor. Interesting that the Impl class doesnt include this method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That said, as you can still plug your own Job Executor into the engine, take a look at the ManagedJobExecutor for an example of a custom module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 00:44:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38806#M16327</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-05-24T00:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to control serviceTask execution</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38807#M16328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to both of you for your help. I will be pursuing the custom JobExecutor to see if I can get that idea to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 May 2017 12:46:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-control-servicetask-execution/m-p/38807#M16328</guid>
      <dc:creator>robdiana72</dc:creator>
      <dc:date>2017-05-24T12:46:40Z</dc:date>
    </item>
  </channel>
</rss>

