<?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: Scopes and Variables in Activiti? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46824#M26384</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;If you invoke the setVariable method with a process instance ID then you set a global variable for the whole process instance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;setVariableLocal can be used for example in a Java service task in a sub process to set a local variable that can be used by other tasks in the same sub process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scopes are things like the process instance scope, a sub process scope or a single task scope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jul 2011 12:23:47 GMT</pubDate>
    <dc:creator>trademak</dc:creator>
    <dc:date>2011-07-14T12:23:47Z</dc:date>
    <item>
      <title>Scopes and Variables in Activiti?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46823#M26383</link>
      <description>Hi,I'm new to Activiti and trying to learn more about scopes and variables. I've been browsing the user guide, API doc an forum, found some hints but haven't been able to grasp the overall concept. Here's what I learn so far:It is possible to define variabels in process and in task scope. Both, the</description>
      <pubDate>Thu, 14 Jul 2011 08:14:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46823#M26383</guid>
      <dc:creator>danielbehrwind</dc:creator>
      <dc:date>2011-07-14T08:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Scopes and Variables in Activiti?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46824#M26384</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;If you invoke the setVariable method with a process instance ID then you set a global variable for the whole process instance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;setVariableLocal can be used for example in a Java service task in a sub process to set a local variable that can be used by other tasks in the same sub process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Scopes are things like the process instance scope, a sub process scope or a single task scope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2011 12:23:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46824#M26384</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2011-07-14T12:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Scopes and Variables in Activiti?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46825#M26385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I know this is probably a dead thread, but maybe we can bring it back to life.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was hoping for some additional clarification here. My scenario is I have a multi-instance subprocess, that contains a multi instance user task. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Subprocess&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;collection: myObjects&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;variable; myObject&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Service Task&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//get information from the myObject POJO create a local variable 'users'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;UserTask&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;collection: users&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;variable: user&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;assignee: ${user}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this is resulting in an unknown property for user. Is this a scope issue?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks inadvance for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 17:07:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46825#M26385</guid>
      <dc:creator>mstein</dc:creator>
      <dc:date>2012-08-02T17:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Scopes and Variables in Activiti?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46826#M26386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I struggled with a similar problem - multi-instance activiti within another multi-instance activiti just did not work. It was not initialized correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem seems to be in this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;class &lt;/SPAN&gt;&lt;STRONG&gt;MultiInstanceActivityBehavior&lt;/STRONG&gt;&lt;SPAN&gt;, method &lt;/SPAN&gt;&lt;STRONG&gt;execute(ActivityExecution execution)&lt;/STRONG&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;originally it looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&amp;nbsp; if (getLoopVariable(execution, LOOP_COUNTER) == null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; createInstances(execution);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (BpmnError error) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ErrorPropagation.propagateError(error, execution);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the inner multi-instance cycle "sees" here the loopCounter from the parent one, so it does not properly initialize its own instance. After replacing getLoopVariable call with "getLoopVariableLocal", looking e.g. like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected Integer getLoopVariableLocal(ActivityExecution execution, String variableName) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (Integer) execution.getVariableLocal(variableName);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;it seems to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have to test it more thoroughly, however.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PS: there seem to be more faults in code dealing with multi-instance things related to variable scopes, like several of "setLoopVariable" calls, which do not distinguish between scopes - they place all the information in the local scope, although some data should go to local scope, and other to the parent one. It would be worth fixing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 07:13:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46826#M26386</guid>
      <dc:creator>mederly</dc:creator>
      <dc:date>2012-10-25T07:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Scopes and Variables in Activiti?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46827#M26387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, you are probably correct about the scoping.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you create a jira so I can follow up and fix it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 08:29:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46827#M26387</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2012-10-25T08:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Scopes and Variables in Activiti?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46828#M26388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Joram,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;certainly. Here it is: &lt;/SPAN&gt;&lt;A href="https://jira.codehaus.org/browse/ACT-1426" rel="nofollow noopener noreferrer"&gt;https://jira.codehaus.org/browse/ACT-1426&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pavol&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 22:40:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46828#M26388</guid>
      <dc:creator>mederly</dc:creator>
      <dc:date>2012-10-25T22:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Scopes and Variables in Activiti?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46829#M26389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, I'll look into it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2012 06:33:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/scopes-and-variables-in-activiti/m-p/46829#M26389</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2012-10-26T06:33:07Z</dc:date>
    </item>
  </channel>
</rss>

