<?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: Forwarding variables to the next task in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/forwarding-variables-to-the-next-task/m-p/25933#M12840</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This would indeed work, but only if the three parallel paths dont share the same variable names.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If using task-local vars, then the solution of Frederik can be used.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Feb 2011 09:43:01 GMT</pubDate>
    <dc:creator>jbarrez</dc:creator>
    <dc:date>2011-02-14T09:43:01Z</dc:date>
    <item>
      <title>Forwarding variables to the next task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/forwarding-variables-to-the-next-task/m-p/25930#M12837</link>
      <description>I have a workflow with three parallel paths.&amp;nbsp; I want to assign task variables at any time, but have those variables be forwarded to the next task.&amp;nbsp; Is this possible?</description>
      <pubDate>Fri, 11 Feb 2011 18:29:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/forwarding-variables-to-the-next-task/m-p/25930#M12837</guid>
      <dc:creator>kpagratis</dc:creator>
      <dc:date>2011-02-11T18:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Forwarding variables to the next task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/forwarding-variables-to-the-next-task/m-p/25931#M12838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This doesn't happen out of the box. The best way I can think of is adding a TaskListener to the tasks, flushing the variables to the execution and loading them again in next task eg:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;userTask id="firstTask" name="My Task" &amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:taskListener event="complete" class="org.activiti.FlushVarsListener" /&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt;&amp;lt;/userTask&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;userTask id="nextTask" name="My Task" &amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:taskListener event="complete" class="org.activiti.ReadVarsListener" /&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt;&amp;lt;/userTask&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;CODE&gt;&lt;BR /&gt;public class FlushListener implements TaskListener {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; public void notify(DelegateTask delegateTask) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(Entry&amp;lt;String, Object&amp;gt; var : delegateTask.getVariables().entrySet()) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delegateTask.getExecution().setVariable(var.getKey(), var.getValue());&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;public class ReadVarsListener implements TaskListener {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; public void notify(DelegateTask delegateTask) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delegateTask.setVariableLocal("previousTaskVar", delegateTask.getExecution().getVariable("taskVar"));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; …&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 20:52:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/forwarding-variables-to-the-next-task/m-p/25931#M12838</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-02-11T20:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Forwarding variables to the next task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/forwarding-variables-to-the-next-task/m-p/25932#M12839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Frederik, are you sure?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you don't declare variables and you set the variable value the first time, then the variables are created in the process instance scope.&amp;nbsp; Which means that they will be visible in the next task.&amp;nbsp; no?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In other words, I think it should just work out of the box as the default behavior.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Feb 2011 14:32:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/forwarding-variables-to-the-next-task/m-p/25932#M12839</guid>
      <dc:creator>tombaeyens</dc:creator>
      <dc:date>2011-02-12T14:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Forwarding variables to the next task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/forwarding-variables-to-the-next-task/m-p/25933#M12840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This would indeed work, but only if the three parallel paths dont share the same variable names.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If using task-local vars, then the solution of Frederik can be used.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 09:43:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/forwarding-variables-to-the-next-task/m-p/25933#M12840</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2011-02-14T09:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Forwarding variables to the next task</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/forwarding-variables-to-the-next-task/m-p/25934#M12841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks for the reply.&amp;nbsp; I'll try it out.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 17:12:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/forwarding-variables-to-the-next-task/m-p/25934#M12841</guid>
      <dc:creator>kpagratis</dc:creator>
      <dc:date>2011-02-14T17:12:45Z</dc:date>
    </item>
  </channel>
</rss>

