<?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 Global variables of multi-instance and callActivity? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74918#M49159</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;EM&gt;activiti&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;ut&lt;/EM&gt;&lt;SPAN&gt; in a &lt;/SPAN&gt;&lt;EM&gt;callActivity&lt;/EM&gt;&lt;SPAN&gt; allows the possibility to write a result from a subprocess back to its parent process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, &lt;/SPAN&gt;&lt;EM&gt;activiti&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;ut&lt;/EM&gt;&lt;SPAN&gt; does not work in a multi-instance of &lt;/SPAN&gt;&lt;EM&gt;callActivity&lt;/EM&gt;&lt;SPAN&gt;, which means there are no ways to write the result back to the main process when you are in a loop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think it is very important. One of the Scenario I can think of, is to terminate the loop under some result receiving from a sub-process. For example, when an activity inside a subprocess fails, you may want to set a variable to say the loop to terminate immediately (with &lt;/SPAN&gt;&lt;EM&gt;&amp;lt;completionCondition&amp;gt;&lt;/EM&gt;&lt;SPAN&gt;)…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;[size=150]Solution[/size]&lt;/STRONG&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;One possible solution I've already tested successfully, is to pass a &lt;/SPAN&gt;&lt;STRONG&gt;list&lt;/STRONG&gt;&lt;SPAN&gt; from our main to the sub process (well, you can say, pass by the value of a reference)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[attachment=1]activiti.jpg[/attachment]&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;lt;callActivity id="callactivity1" name="Call activity" calledElement="subProcess"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:in source="list" target="list"&amp;gt;&amp;lt;/activiti:in&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;multiInstanceLoopCharacteristics isSequential="true"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;loopDataInputRef&amp;gt;…&amp;lt;/loopDataInputRef&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;completionCondition&amp;gt;${list.size()!=0}&amp;lt;/completionCondition&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/multiInstanceLoopCharacteristics&amp;gt;&lt;BR /&gt;&amp;lt;/callActivity&amp;gt;&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&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;SPAN&gt;By doing this way, every changes to the list inside the subprocess will be visible to the main process. List is now like a global variable for the main and all sub process of the loop. Also, I can trigger the loop to terminate immediately when, for example, the list is not empty as above.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[size=150]&lt;/SPAN&gt;&lt;STRONG&gt;Problems:&lt;/STRONG&gt;&lt;SPAN&gt;[/size]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But another problem, when you use a &lt;/SPAN&gt;&lt;EM&gt;userTask&lt;/EM&gt;&lt;SPAN&gt; inside the subprocess, then whatever changes to the &lt;/SPAN&gt;&lt;STRONG&gt;list&lt;/STRONG&gt;&lt;SPAN&gt; before the userTask, the list will be empty after that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[attachment=0]activiti2.jpg[/attachment]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess, at the userTask, a transaction is completed and all data are persisted to the database. After that, the list we want to reference to, may be not the same list anymore. The above scenario is for sequential loop. For a parallel loop, it is a little bit different. But I want to discuss about sequential loop first. Any ideas to solve the problems would be helpful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 22 May 2011 16:56:33 GMT</pubDate>
    <dc:creator>ryu</dc:creator>
    <dc:date>2011-05-22T16:56:33Z</dc:date>
    <item>
      <title>Global variables of multi-instance and callActivity?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74918#M49159</link>
      <description>activiti&lt;IMG id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;ut in a callActivity allows the possibility to write a result from a subprocess back to its parent process.However, activiti&lt;IMG id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;ut does not work in a multi-instance of callActivity, which means there are no ways to write the result back to the main process when you are in a loop.I think it i</description>
      <pubDate>Sun, 22 May 2011 16:56:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74918#M49159</guid>
      <dc:creator>ryu</dc:creator>
      <dc:date>2011-05-22T16:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Global variables of multi-instance and callActivity?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74919#M49160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The simplest solution imo would be to allow for expressions in the activiti&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;ut, allowing to write variables like activiti&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;ut="myVar-${loopCounter}". Would that cover your use case?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 08:06:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74919#M49160</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2011-05-24T08:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Global variables of multi-instance and callActivity?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74920#M49161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm very glad that you replied to this topic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Your suggestion is to write variable from every sub process to different variables of the main process. It's a good idea,. But sadly, the problem is, the element &lt;/SPAN&gt;&lt;EM&gt;activiti&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;ut&lt;/EM&gt;&lt;SPAN&gt; does not work. &lt;/SPAN&gt;&lt;EM&gt;activiti&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;ut&lt;/EM&gt;&lt;SPAN&gt; does not write any thing when being used in a multi-instance, even a value like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:smileysurprised:ut sourceExpression="${&amp;amp;quot;HelloWorld&amp;amp;quot:smileywink:}" target="i"&amp;gt;&amp;lt;/activiti:smileysurprised:ut&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;STRONG&gt;i&lt;/STRONG&gt;&lt;SPAN&gt; is the variable of the main process. If it works,&amp;nbsp; it doesn't matter how many times i is overwritten, we should have "HelloWorld" in &lt;/SPAN&gt;&lt;STRONG&gt;i&lt;/STRONG&gt;&lt;SPAN&gt; in the end. But not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So when I looked back in the source code of &lt;/SPAN&gt;&lt;EM&gt;MultiInstanceActivityBehavior&lt;/EM&gt;&lt;SPAN&gt;, seems like there are no functions to set variables to its parent process when a sub process "leave"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2011 09:31:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74920#M49161</guid>
      <dc:creator>ryu</dc:creator>
      <dc:date>2011-05-24T09:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Global variables of multi-instance and callActivity?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74921#M49162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Then that is indeed a but. Could you create a jira issue for it so we can track it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 10:01:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74921#M49162</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2011-05-25T10:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Global variables of multi-instance and callActivity?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74922#M49163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;yes Jira: &lt;/SPAN&gt;&lt;A href="http://jira.codehaus.org/browse/ACT-825" rel="nofollow noopener noreferrer"&gt;http://jira.codehaus.org/browse/ACT-825&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2011 10:14:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74922#M49163</guid>
      <dc:creator>ryu</dc:creator>
      <dc:date>2011-05-25T10:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Global variables of multi-instance and callActivity?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74923#M49164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can anyone suggest solution for this issue. I am unable to access the output parameter from callActivity in Multi instance loop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to create parallel tasks dynamically using callActivity and if any one of the tasks is Rejected, I want to complete all the tasks and instance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Nov 2015 13:40:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74923#M49164</guid>
      <dc:creator>chockyc91</dc:creator>
      <dc:date>2015-11-28T13:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Global variables of multi-instance and callActivity?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74924#M49165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Late reply but might be useful for someone else....&lt;/P&gt;&lt;P&gt;One way of dealing with it would be to write a delegate or script to do the following...&lt;/P&gt;&lt;P&gt;execution below is from the subprocess&lt;/P&gt;&lt;P&gt;superExecutionId = execution.getSuperExecutionId();&lt;BR /&gt; runtimeService.setVariable(superExecutionId, someVariableName, someValue);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 15:38:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/global-variables-of-multi-instance-and-callactivity/m-p/74924#M49165</guid>
      <dc:creator>maheshramani</dc:creator>
      <dc:date>2017-02-27T15:38:08Z</dc:date>
    </item>
  </channel>
</rss>

