<?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: BPM runtime information - timing of database commit in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127153#M89449</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are implementing something similar. In our case we are firing a message to the JMS queue, after that there comes a receive task or a message catching event. When reply returns, we find the process as you do and trigger it with the payload. I don't think java service task is useful for your scenario. I've faced this 'flush' problem in another case. You need to have a wait state like those to overcome this. Form user guide:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;It's important to note that the Activiti engine will continue process execution steps until it reaches a wait state, such as the user task. At such a wait state, the current state of the process instance is stored in the database.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;You can search for 'wait state' in user guide.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Apr 2013 17:50:37 GMT</pubDate>
    <dc:creator>gokceng1</dc:creator>
    <dc:date>2013-04-03T17:50:37Z</dc:date>
    <item>
      <title>BPM runtime information - timing of database commit</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127152#M89448</link>
      <description>Hi, we are using Activiti 5.11 and are modeling a business process with three tasks:Task 1 - Java service task that sends a JMS messageTask 2 - Receive Task that puts the BPM in a 'wait' stateTask 3 - Java service task that gets called by the JMS listener for the message sent in Task 1; this task lo</description>
      <pubDate>Wed, 03 Apr 2013 15:35:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127152#M89448</guid>
      <dc:creator>kkompel</dc:creator>
      <dc:date>2013-04-03T15:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: BPM runtime information - timing of database commit</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127153#M89449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are implementing something similar. In our case we are firing a message to the JMS queue, after that there comes a receive task or a message catching event. When reply returns, we find the process as you do and trigger it with the payload. I don't think java service task is useful for your scenario. I've faced this 'flush' problem in another case. You need to have a wait state like those to overcome this. Form user guide:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;It's important to note that the Activiti engine will continue process execution steps until it reaches a wait state, such as the user task. At such a wait state, the current state of the process instance is stored in the database.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;You can search for 'wait state' in user guide.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2013 17:50:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127153#M89449</guid>
      <dc:creator>gokceng1</dc:creator>
      <dc:date>2013-04-03T17:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: BPM runtime information - timing of database commit</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127154#M89450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply.&amp;nbsp; Task 2 (after the JMS message is sent from Task 1) is already a Receive task, so it is indeed putting the BPM in a wait state and writing to the database.&amp;nbsp; The problem is that the listener for the JMS message is triggered *before* Task 2 has had a chance write to the database; so in the listener if we try to look up any information about the process instance from the database, it throws an exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(I am editing the original post to indicate more clearly that Task 2 is a Receive Task, not a Java service task)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2013 18:10:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127154#M89450</guid>
      <dc:creator>kkompel</dc:creator>
      <dc:date>2013-04-03T18:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: BPM runtime information - timing of database commit</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127155#M89451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Why is there a waitstate if things go so quickly? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But anyway, What you should do is make the putting of the message in the jms queue use the same transaction as the engine. That way the message is actually put in the queue (committed) when task2 is done.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2013 19:16:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127155#M89451</guid>
      <dc:creator>ronald_van_kuij</dc:creator>
      <dc:date>2013-04-03T19:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: BPM runtime information - timing of database commit</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127156#M89452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Task 1 is sending the JMS message and Task 2 is the Receive task, both in the same BPM, so they should both be in the same transaction already..?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2013 19:37:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127156#M89452</guid>
      <dc:creator>kkompel</dc:creator>
      <dc:date>2013-04-03T19:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: BPM runtime information - timing of database commit</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127157#M89453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Again, as long as a process hasn't reached a wait-state, they transaction is NOT YET committed. The (external) signal-trigger from the API uses a different transaction. This is what transactions are supposed to do: isolate uncommitted changes from independent operations to prevent oncomitted-data reads.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A receive-task is designed to respond to external process-events, which can occur at any point time and require the state to be committed. This is just the way it is…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Possible solutions to your problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;Use a service-task instead of a receive-task that does some kind of polling (with potential timeout) for the message to arrive. This will ensure the Task2 is executed in the same transaction as Task1. Keep in mind, this keeps open a transaction/db-connection for potentially a long time.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Make the piece of logic that calls the "signal" smarter and build in a retry-mechanism in case the response comes back quicker than activiti can finish the process. In activiti-terms, the process isn't waiting until the transaction is committed.&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2013 08:52:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127157#M89453</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-04-04T08:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: BPM runtime information - timing of database commit</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127158#M89454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for the reply.&amp;nbsp; We did end up building retry-logic in the code before signalling the BPM to resume (to ensure that the required data is in the database from Task 2); thanks for validating that this is indeed [one of] the preferred approach.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2013 14:02:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127158#M89454</guid>
      <dc:creator>kkompel</dc:creator>
      <dc:date>2013-04-04T14:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: BPM runtime information - timing of database commit</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127159#M89455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are implementing this type of logic with a userTask for a "system" user. We put a listener on the task assignment that shoots off a JMS message to invoke the remote service.&amp;nbsp; Then when other service is done, it simply completes the task and the workflow continues.&amp;nbsp; Kind of modeling the way amazon workflow service handles tasks. It makes for nice transaction boundaries and nice tracking of work that is in progress.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2013 16:40:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127159#M89455</guid>
      <dc:creator>groopk</dc:creator>
      <dc:date>2013-04-04T16:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: BPM runtime information - timing of database commit</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127160#M89456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Task 1 is sending the JMS message and Task 2 is the Receive task, both in the same BPM, so they should both be in the same transaction already..?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;No, the CREATION of te receivetask should be in the same transaction. Not the execution of it. The timing 'problem' disappears then. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is btw not a specific Activiti issue. Would happen in many similar other circumstances as well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Apr 2013 06:46:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127160#M89456</guid>
      <dc:creator>ronald_van_kuij</dc:creator>
      <dc:date>2013-04-05T06:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: BPM runtime information - timing of database commit</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127161#M89457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you have a code sample for programmatically creating a receive task or putting a process instance in "wait" state?&amp;nbsp; I tried the 'suspend' and 'reactivate' actions on the runtime service but they are not helping.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Apr 2013 15:41:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127161#M89457</guid>
      <dc:creator>kkompel</dc:creator>
      <dc:date>2013-04-05T15:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: BPM runtime information - timing of database commit</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127162#M89458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Huh? Why is this relevant…? I miss the context of this question.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Apr 2013 17:38:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/bpm-runtime-information-timing-of-database-commit/m-p/127162#M89458</guid>
      <dc:creator>ronald_van_kuij</dc:creator>
      <dc:date>2013-04-05T17:38:06Z</dc:date>
    </item>
  </channel>
</rss>

