<?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 Asynchronous / Long Running Activities in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/asynchronous-long-running-activities/m-p/179861#M132991</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We are developing a product which uses the Activiti Engine (5.17).&amp;nbsp; We have implemented a number of activities that execute long lived jobs within our system.&amp;nbsp; The prototype versions of these activities were implemented using a script or JavaDelegate based task which submits the job and blocks until the job is complete.&amp;nbsp; This works OK for demo purposes but is obviously not fit for production. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I understand the Activiti Engine supports log lived jobs (asynchronous) but I'm not clear on how these should be implemented.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have identified at least 2 different approaches to this problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Use a BPMN ReceiveTask with an Activiti "start" listener:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- "start" listener submits the job;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- ReceiveTask is executed and goes into a wait state;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- job service signals Activiti engine when job is complete;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Activiti engine signals / wakes the ReceiveTask and it completes;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- process continues…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Use a BPMN ServiceTask&amp;nbsp; with a TaskActivityBehaviour extended class:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- TaskActivityBehaviour execute() method is called and submits the job;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- TaskActivityBehaviour execute() exits and execution goes into a wait state;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- job service signals Activiti engine when job is complete;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- TaskActivityBehaviour signal() method is called.&amp;nbsp; Method calls leave();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- process continues…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are either of these the official / preferred method?&amp;nbsp; Should we do it some other way?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Mar 2015 17:29:35 GMT</pubDate>
    <dc:creator>dstone_dalet_co</dc:creator>
    <dc:date>2015-03-12T17:29:35Z</dc:date>
    <item>
      <title>Asynchronous / Long Running Activities</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/asynchronous-long-running-activities/m-p/179861#M132991</link>
      <description>Hi,We are developing a product which uses the Activiti Engine (5.17).&amp;nbsp; We have implemented a number of activities that execute long lived jobs within our system.&amp;nbsp; The prototype versions of these activities were implemented using a script or JavaDelegate based task which submits the job and blocks un</description>
      <pubDate>Thu, 12 Mar 2015 17:29:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/asynchronous-long-running-activities/m-p/179861#M132991</guid>
      <dc:creator>dstone_dalet_co</dc:creator>
      <dc:date>2015-03-12T17:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Asynchronous / Long Running Activities</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/asynchronous-long-running-activities/m-p/179862#M132992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Option&amp;nbsp; is what I prefer, as it keeps database transaction not open when not needed. Your second option is actually the same, but with a step that does both in one go. I like it too &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only thing you must be careful of is that, if your external system is REALLY fast, it will try to signal quicker than that Activiti has continued the process. So you do have to build in a query + wait mechanism.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 09:19:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/asynchronous-long-running-activities/m-p/179862#M132992</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2015-03-17T09:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Asynchronous / Long Running Activities</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/asynchronous-long-running-activities/m-p/179863#M132993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for the reply.&amp;nbsp; It sounds like both options are OK but can I just clarify a few points:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Did you say you prefer option 1?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. I thought both options didn't keep the DB transaction open between the start / execute and signal. Is that not the case?&amp;nbsp; I think in a previous thread it was hinted that option 2 didn't keep the DB open (see &lt;/SPAN&gt;&lt;A href="http://forums.activiti.org/content/java-service-task-passivate-wout-receive-task" rel="nofollow noopener noreferrer"&gt;http://forums.activiti.org/content/java-service-task-passivate-wout-receive-task&lt;/A&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for warning me about the fast signal issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks, Dan&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 09:38:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/asynchronous-long-running-activities/m-p/179863#M132993</guid>
      <dc:creator>dstone_dalet_co</dc:creator>
      <dc:date>2015-03-17T09:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Asynchronous / Long Running Activities</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/asynchronous-long-running-activities/m-p/179864#M132994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1 .Yes, my personal preference is 1. But that is mere taste.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Correct, which is what I said. Im just pointing out why it's a good idea.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2015 12:32:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/asynchronous-long-running-activities/m-p/179864#M132994</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2015-03-24T12:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Asynchronous / Long Running Activities</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/asynchronous-long-running-activities/m-p/179865#M132995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for helping and reassuring me that either option is possible.&amp;nbsp; &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 12:26:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/asynchronous-long-running-activities/m-p/179865#M132995</guid>
      <dc:creator>dstone_dalet_co</dc:creator>
      <dc:date>2015-03-25T12:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Asynchronous / Long Running Activities</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/asynchronous-long-running-activities/m-p/179866#M132996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Joram, sorry if I'm asking a stupid question, but what kind of "query" would you need to do to ensure the task is already in the correct state in which it can receive the signal?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 08:46:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/asynchronous-long-running-activities/m-p/179866#M132996</guid>
      <dc:creator>boekhold</dc:creator>
      <dc:date>2015-03-26T08:46:13Z</dc:date>
    </item>
  </channel>
</rss>

