<?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 A sequential flow to create a process instance and then a task in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/a-sequential-flow-to-create-a-process-instance-and-then-a-task/m-p/36329#M15332</link>
    <description>&lt;P&gt;What we are doing:&lt;/P&gt;&lt;P&gt;1. We have a task listener configured for a user task which essentially send a notification to start processing some data to an external module.&lt;/P&gt;&lt;P&gt;2. Once the processing is done, the module marks this task as completed.&lt;/P&gt;&lt;P&gt;3. Essentially, our process flow contains all User Tasks configured like above.&lt;/P&gt;&lt;P&gt;What is happening:&lt;/P&gt;&lt;P&gt;1. We create a process instance, and immediately, the first task is initiated - Meaning, the task listener is invoked.&lt;/P&gt;&lt;P&gt;2. By the time process instance is stored in database, we get a request from external module to mark the task as completed. And hence we face ActivitiObjectNotFoundException. Since the process instance along with task id is not yet commited in DB.&lt;/P&gt;&lt;P&gt;Below logs for reference:&lt;/P&gt;&lt;P&gt;1. Made a call to runtimeService.startProcessInstanceById&lt;BR /&gt;2. Entering Task Listener&lt;BR /&gt;3. Message sent to external module: processId:62549 taskId:62564&lt;BR /&gt;4. Exiting Task Listener&lt;BR /&gt;5. Created processInstance id: 62549 // Call to startProcessInstanceById completed&lt;/P&gt;&lt;P&gt;Similar behaviour is observed for second task in line. While marking the current task as completed, the next task's listener is called.&lt;/P&gt;&lt;P&gt;What we intend:&lt;/P&gt;&lt;P&gt;1. Made a call to runtimeService.startProcessInstanceById&lt;BR /&gt;2. Created process instance with ID: 62549&lt;BR /&gt;3. Created Task instance with ID: 62564&lt;BR /&gt;4. Entering Task Listener&lt;BR /&gt;5. Message sent to external module: processId:62549 taskId:62564&lt;BR /&gt;6. Exiting Task Listener&lt;BR /&gt;7. Wait till the task is completed by external module and we receive such message from that module.&lt;/P&gt;&lt;P&gt;Is there a way to achieve this scenario without having customizations?&lt;/P&gt;&lt;P&gt;We are using queues to manage the communication. Hence the term message means: message on a particular queue.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Mar 2020 06:09:43 GMT</pubDate>
    <dc:creator>mrunalbadhe</dc:creator>
    <dc:date>2020-03-23T06:09:43Z</dc:date>
    <item>
      <title>A sequential flow to create a process instance and then a task</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/a-sequential-flow-to-create-a-process-instance-and-then-a-task/m-p/36329#M15332</link>
      <description>&lt;P&gt;What we are doing:&lt;/P&gt;&lt;P&gt;1. We have a task listener configured for a user task which essentially send a notification to start processing some data to an external module.&lt;/P&gt;&lt;P&gt;2. Once the processing is done, the module marks this task as completed.&lt;/P&gt;&lt;P&gt;3. Essentially, our process flow contains all User Tasks configured like above.&lt;/P&gt;&lt;P&gt;What is happening:&lt;/P&gt;&lt;P&gt;1. We create a process instance, and immediately, the first task is initiated - Meaning, the task listener is invoked.&lt;/P&gt;&lt;P&gt;2. By the time process instance is stored in database, we get a request from external module to mark the task as completed. And hence we face ActivitiObjectNotFoundException. Since the process instance along with task id is not yet commited in DB.&lt;/P&gt;&lt;P&gt;Below logs for reference:&lt;/P&gt;&lt;P&gt;1. Made a call to runtimeService.startProcessInstanceById&lt;BR /&gt;2. Entering Task Listener&lt;BR /&gt;3. Message sent to external module: processId:62549 taskId:62564&lt;BR /&gt;4. Exiting Task Listener&lt;BR /&gt;5. Created processInstance id: 62549 // Call to startProcessInstanceById completed&lt;/P&gt;&lt;P&gt;Similar behaviour is observed for second task in line. While marking the current task as completed, the next task's listener is called.&lt;/P&gt;&lt;P&gt;What we intend:&lt;/P&gt;&lt;P&gt;1. Made a call to runtimeService.startProcessInstanceById&lt;BR /&gt;2. Created process instance with ID: 62549&lt;BR /&gt;3. Created Task instance with ID: 62564&lt;BR /&gt;4. Entering Task Listener&lt;BR /&gt;5. Message sent to external module: processId:62549 taskId:62564&lt;BR /&gt;6. Exiting Task Listener&lt;BR /&gt;7. Wait till the task is completed by external module and we receive such message from that module.&lt;/P&gt;&lt;P&gt;Is there a way to achieve this scenario without having customizations?&lt;/P&gt;&lt;P&gt;We are using queues to manage the communication. Hence the term message means: message on a particular queue.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2020 06:09:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/a-sequential-flow-to-create-a-process-instance-and-then-a-task/m-p/36329#M15332</guid>
      <dc:creator>mrunalbadhe</dc:creator>
      <dc:date>2020-03-23T06:09:43Z</dc:date>
    </item>
  </channel>
</rss>

