<?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 ProcessInstance only returned after task ended in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/processinstance-only-returned-after-task-ended/m-p/197451#M150581</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;SPAN&gt;I am trying to use Activiti as a sort of "pimped up" state machine -&amp;gt; the Process only contains ServiceTasks which point towards Java Delegates. In order to monitor the state of a running process I would like to access the processInstance Object after it is started. However when starting my process via &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;ProcessInstance procInst = runtime.startProcessInstanceByKey("myProcess");&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;procInst is only returned after the process ended. I activated the Async Executor via:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;ProcessEngineConfiguration config = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();&lt;BR /&gt;config.setAsyncExecutorEnabled(true);&lt;BR /&gt;config.setAsyncExecutorActivate(true);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And set the first service task in the Diagram to asynchronous, still no luck &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is, if this is due to the process only containing Service Tasks (I read that startProcessInstanceByKey() is blocking and it will return only when process engine has nothing more to do (for instance, it reached user task which requires user interaction)), if so is there a workaround ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or should this actually work, i.e. I am doing something wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Konrad&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Jun 2015 08:23:10 GMT</pubDate>
    <dc:creator>kkdw</dc:creator>
    <dc:date>2015-06-02T08:23:10Z</dc:date>
    <item>
      <title>ProcessInstance only returned after task ended</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/processinstance-only-returned-after-task-ended/m-p/197451#M150581</link>
      <description>Hello,I am trying to use Activiti as a sort of "pimped up" state machine -&amp;gt; the Process only contains ServiceTasks which point towards Java Delegates. In order to monitor the state of a running process I would like to access the processInstance Object after it is started. However when starting my</description>
      <pubDate>Tue, 02 Jun 2015 08:23:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/processinstance-only-returned-after-task-ended/m-p/197451#M150581</guid>
      <dc:creator>kkdw</dc:creator>
      <dc:date>2015-06-02T08:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: ProcessInstance only returned after task ended</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/processinstance-only-returned-after-task-ended/m-p/197452#M150582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, when your service task is async, the method call returns before the service task is executed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that the ProcessInstance object is a stale object, it wont be updated with the latest values, unless you refetch it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2015 19:46:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/processinstance-only-returned-after-task-ended/m-p/197452#M150582</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2015-06-02T19:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: ProcessInstance only returned after task ended</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/processinstance-only-returned-after-task-ended/m-p/197453#M150583</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;SPAN&gt;Thanks a lot for your answer. I had indeed a bug in my code - now making the first service task asynchronous - will return the ProcessInstance object back. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Konrad&amp;nbsp; &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2015 20:02:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/processinstance-only-returned-after-task-ended/m-p/197453#M150583</guid>
      <dc:creator>kkdw</dc:creator>
      <dc:date>2015-06-03T20:02:35Z</dc:date>
    </item>
  </channel>
</rss>

