<?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 Wait for a certain Task to finish without polling in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/wait-for-a-certain-task-to-finish-without-polling/m-p/195496#M148626</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i have the following Scenario:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a relatively complex Process i implemented using the Activitiengine. it consists of roughly 12 Tasks. Lets assume they are all in sequence for simplicity.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) A User requests POST to the RESTfull Webservice at: "/rest/start".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) The Servlet starts a Processinstance with the parameters supplied.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) The User is obviously waiting for a reply from the Webserver, this reply can be formed right after Task #3 of the 12 is finished.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My implementation at the moment is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Insert a Usertask after Task #3 that consists of a Form with the reply-parameters, all read-only. (Task #1-#3 are input-checks of sorts)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The Servlet that started the Process, polls the Engine for this Task with the given Businesskey (ever 100ms it checks if the Task "Userreply" is present in the Processinstance with given Businesskey).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If the Task is present, the values are read and the reply for the User is built and sent. Then the Servlet submits the Form and the Process continues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not like this solution, because i don't like the look of Thread.sleep(100), it is unclean, error prone and bound to result in all sorts of wierd raceconditions, once the Service goes online.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My Question is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Are there any ideas on how to solve this without polling the Engine? Even a type of http-like "Long-polling" would be an improvement for me, unfortunately i don't know how to do it with Activiti&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My ideas so far:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) let the Client poll a status resource for the wanted results, but this only shift the polling to another location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) handle Task #1-#3 outside the Processengine, which would take the advantage of the engine&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any further input!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Feb 2015 07:31:53 GMT</pubDate>
    <dc:creator>luckybtard</dc:creator>
    <dc:date>2015-02-03T07:31:53Z</dc:date>
    <item>
      <title>Wait for a certain Task to finish without polling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/wait-for-a-certain-task-to-finish-without-polling/m-p/195496#M148626</link>
      <description>Hello,i have the following Scenario:There is a relatively complex Process i implemented using the Activitiengine. it consists of roughly 12 Tasks. Lets assume they are all in sequence for simplicity.1) A User requests POST to the RESTfull Webservice at: "/rest/start".2) The Servlet starts a Processi</description>
      <pubDate>Tue, 03 Feb 2015 07:31:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/wait-for-a-certain-task-to-finish-without-polling/m-p/195496#M148626</guid>
      <dc:creator>luckybtard</dc:creator>
      <dc:date>2015-02-03T07:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Wait for a certain Task to finish without polling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/wait-for-a-certain-task-to-finish-without-polling/m-p/195497#M148627</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;BLOCKQUOTE class="jive-quote"&gt;The Servlet that started the Process, polls the Engine for this Task with the given Businesskey (ever 100ms it checks if the Task "Userreply" is present in the Processinstance with given Businesskey).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to send results from the process instance execution to the servlet again? (e.g. web service task….)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 10:02:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/wait-for-a-certain-task-to-finish-without-polling/m-p/195497#M148627</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2015-02-04T10:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Wait for a certain Task to finish without polling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/wait-for-a-certain-task-to-finish-without-polling/m-p/195498#M148628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;exactly my question, can i somehow tell the Servlet to just wait for an answer, without sleeping for fixed time or polling. Something like&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;xyz.waitForTaskToPopUp("#3") &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 11:25:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/wait-for-a-certain-task-to-finish-without-polling/m-p/195498#M148628</guid>
      <dc:creator>luckybtard</dc:creator>
      <dc:date>2015-02-04T11:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Wait for a certain Task to finish without polling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/wait-for-a-certain-task-to-finish-without-polling/m-p/195499#M148629</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;I would say that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. you can implement web service and deploy it on your tomcat instance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. You can call web service from the process instance (doc: 8.5.4. Web Service Task)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 06:03:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/wait-for-a-certain-task-to-finish-without-polling/m-p/195499#M148629</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2015-02-05T06:03:35Z</dc:date>
    </item>
  </channel>
</rss>

