<?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 Implementing asynchronous service task. need help in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/implementing-asynchronous-service-task-need-help/m-p/73751#M48177</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 am trying to implement a process where two asynchronous tasks run in parallel.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The process layout looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[attachment=0]parallel-process.tiff[/attachment]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If the &lt;/SPAN&gt;&lt;EM&gt;activiti:async&lt;/EM&gt;&lt;SPAN&gt; is not set, all the tasks are executed sequentially.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I set the &lt;/SPAN&gt;&lt;EM&gt;activiti:async=true&lt;/EM&gt;&lt;SPAN&gt; for the parallel tasks, the first task executes but the code for the parallel tasks is never called.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I feel I am missing something trivial here. I looked thru the tutorial and the examples but I can't figure it out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to this (just started couple of days ago) so have mercy if the answer is too obvious&amp;nbsp; &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code I used to run the process is a slight modification from the 10 min. tutorial:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;public static void main(String[] args) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create Activiti process engine&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProcessEngine processEngine = ProcessEngineConfiguration&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .createStandaloneProcessEngineConfiguration()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .buildProcessEngine();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Get Activiti services&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RepositoryService repositoryService = processEngine.getRepositoryService();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RuntimeService runtimeService = processEngine.getRuntimeService();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Deploy the process definition&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DeploymentBuilder dep = repositoryService.createDeployment();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dep.addClasspathResource("process-1.bpmn20.xml");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dep.deploy();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Start a process instance&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String procId = runtimeService.startProcessInstanceByKey("Process-1").getId();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;…..&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;The process definition is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;&amp;lt;definitions xmlns="&lt;A href="http://www.omg.org/spec/BPMN/20100524/MODEL" rel="nofollow noopener noreferrer"&gt;http://www.omg.org/spec/BPMN/20100524/MODEL&lt;/A&gt;" xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;" xmlns:activiti="&lt;A href="http://activiti.org/bpmn" rel="nofollow noopener noreferrer"&gt;http://activiti.org/bpmn&lt;/A&gt;" xmlns:bpmndi="&lt;A href="http://www.omg.org/spec/BPMN/20100524/DI" rel="nofollow noopener noreferrer"&gt;http://www.omg.org/spec/BPMN/20100524/DI&lt;/A&gt;" xmlns&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;mgdc="&lt;A href="http://www.omg.org/spec/DD/20100524/DC" rel="nofollow noopener noreferrer"&gt;http://www.omg.org/spec/DD/20100524/DC&lt;/A&gt;" xmlns&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;mgdi="&lt;A href="http://www.omg.org/spec/DD/20100524/DI" rel="nofollow noopener noreferrer"&gt;http://www.omg.org/spec/DD/20100524/DI&lt;/A&gt;" typeLanguage="&lt;A href="http://www.w3.org/2001/XMLSchema" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;" expressionLanguage="&lt;A href="http://www.w3.org/1999/XPath" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/1999/XPath&lt;/A&gt;" targetNamespace="&lt;A href="http://www.activiti.org/test" rel="nofollow noopener noreferrer"&gt;http://www.activiti.org/test&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;process id="Process-1" name="process-1"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;documentation&amp;gt;Place documentation for the 'process-1' process here.&amp;lt;/documentation&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;startEvent id="startevent1" name="Start"&amp;gt;&amp;lt;/startEvent&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="servicetask1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;parallelGateway id="parallelgateway1" name="Parallel Gateway"&amp;gt;&amp;lt;/parallelGateway&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow3" name="" sourceRef="parallelgateway1" targetRef="servicetask3"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow4" name="" sourceRef="parallelgateway1" targetRef="servicetask2"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow5" name="" sourceRef="servicetask1" targetRef="parallelgateway1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;inclusiveGateway id="inclusivegateway1" name="Inclusive Gateway"&amp;gt;&amp;lt;/inclusiveGateway&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow6" name="" sourceRef="servicetask3" targetRef="inclusivegateway1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow7" name="" sourceRef="servicetask2" targetRef="inclusivegateway1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endEvent id="endevent2" name="End"&amp;gt;&amp;lt;/endEvent&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow8" name="" sourceRef="inclusivegateway1" targetRef="endevent2"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;serviceTask id="servicetask1" name="Task 1" activiti:class="com.tieroneoss.tnp.workflow.TnpServiceTask"&amp;gt;&amp;lt;/serviceTask&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;serviceTask id="servicetask2" name="Parallel Task 2" activiti:async="true" activiti:class="com.tieroneoss.tnp.workflow.TnpService3"&amp;gt;&amp;lt;/serviceTask&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;serviceTask id="servicetask3" name="Parallel Task 1" activiti:async="true" activiti:class="com.tieroneoss.tnp.workflow.TnpService5"&amp;gt;&amp;lt;/serviceTask&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/process&amp;gt;&lt;BR /&gt;&amp;lt;/definitions&amp;gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;So I have two questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. What am I missing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. I assume that at some point in the &lt;/SPAN&gt;&lt;EM&gt;execute()&lt;/EM&gt;&lt;SPAN&gt; method of the java class implementing the service I have to call something like &lt;/SPAN&gt;&lt;EM&gt;task.complete()&lt;/EM&gt;&lt;SPAN&gt;. How do I get the instance of the task that is executing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking forward for your input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TIA.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ion&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Jan 2012 14:35:27 GMT</pubDate>
    <dc:creator>imoraru</dc:creator>
    <dc:date>2012-01-06T14:35:27Z</dc:date>
    <item>
      <title>Implementing asynchronous service task. need help</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/implementing-asynchronous-service-task-need-help/m-p/73751#M48177</link>
      <description>Hi,I am trying to implement a process where two asynchronous tasks run in parallel.The process layout looks like this:[attachment=0]parallel-process.tiff[/attachment]If the activiti:async is not set, all the tasks are executed sequentially.If I set the activiti:async=true for the parallel tasks, the</description>
      <pubDate>Fri, 06 Jan 2012 14:35:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/implementing-asynchronous-service-task-need-help/m-p/73751#M48177</guid>
      <dc:creator>imoraru</dc:creator>
      <dc:date>2012-01-06T14:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing asynchronous service task. need help</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/implementing-asynchronous-service-task-need-help/m-p/73752#M48178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Finally I figured it out: the job executor was not started.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have replaced this code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;ProcessEngine processEngine = ProcessEngineConfiguration&lt;BR /&gt;.createStandaloneProcessEngineConfiguration()&lt;BR /&gt;.buildProcessEngine();&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;withe the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;ProcessEngine processEngine = ProcessEngineConfiguration&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .createProcessEngineConfigurationFromResource("activiti.cfg.xml")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .buildProcessEngine();&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;in the &lt;/SPAN&gt;&lt;EM&gt;activiti.cfg.xml&lt;/EM&gt;&lt;SPAN&gt; I made sure I have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&amp;lt;property name="jobExecutorActivate" value="true" /&amp;gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Now that it's working, I noticed that the task is completed when the &lt;/SPAN&gt;&lt;EM&gt;execute()&lt;/EM&gt;&lt;SPAN&gt; method returns.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I still would like to know how I can get a handle to the task instance in the &lt;/SPAN&gt;&lt;EM&gt;execute()&lt;/EM&gt;&lt;SPAN&gt; method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This would be helpful especially when the same Java class is used in more then one task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can't seem to get this information from the DelegateExecution variable that is passed in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ion&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 17:59:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/implementing-asynchronous-service-task-need-help/m-p/73752#M48178</guid>
      <dc:creator>imoraru</dc:creator>
      <dc:date>2012-01-06T17:59:44Z</dc:date>
    </item>
  </channel>
</rss>

