<?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 confused about local and global variable scope in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/confused-about-local-and-global-variable-scope/m-p/157117#M111316</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;with reference of this following userguide link&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://activiti.org/userguide/index.html#N14509" rel="nofollow noopener noreferrer"&gt;http://activiti.org/userguide/index.html#N14509&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.activiti.org/content/scopes-and-variables-activiti" rel="nofollow noopener noreferrer"&gt;http://forums.activiti.org/content/scopes-and-variables-activiti&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am quite confused about variable scope…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to get all variable from a task&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the sub process scripttask i defined two local variable like&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; execution.setVariableLocal("TestLocalVariabl1", "Test1"); &lt;BR /&gt;&amp;nbsp;&amp;nbsp; execution.setVariableLocal("TestLocalVariable2", "Test2");&lt;BR /&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;while try to get all local variables from task its return nothing…&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://#######:6080/activiti-rest/service/runtime/tasks/223837/variables?scope=local" rel="nofollow noopener noreferrer"&gt;http://#######:6080/activiti-rest/service/runtime/tasks/223837/variables?scope=local&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but when try get all global variables from task those local variables are return as response body&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "name": "TestLocalVariabl1",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "type": "string",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "value": "Test1",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "scope": "global"&lt;BR /&gt;&amp;nbsp; },&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "name": "TestLocalVariable2",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "type": "string",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "value": "Test2",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "scope": "global"&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&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;/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;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jan 2014 11:38:15 GMT</pubDate>
    <dc:creator>sarkar92</dc:creator>
    <dc:date>2014-01-15T11:38:15Z</dc:date>
    <item>
      <title>confused about local and global variable scope</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/confused-about-local-and-global-variable-scope/m-p/157117#M111316</link>
      <description>with reference of this following userguide linkhttp://activiti.org/userguide/index.html#N14509andhttp://forums.activiti.org/content/scopes-and-variables-activitiI am quite confused about variable scope…I am trying to get all variable from a taskIn the sub process scripttask i defined two local varia</description>
      <pubDate>Wed, 15 Jan 2014 11:38:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/confused-about-local-and-global-variable-scope/m-p/157117#M111316</guid>
      <dc:creator>sarkar92</dc:creator>
      <dc:date>2014-01-15T11:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: confused about local and global variable scope</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/confused-about-local-and-global-variable-scope/m-p/157118#M111317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You're setting local variables on the execution-context, not on the task. So if you would ask for the local execution-variables of that execution, you would get them back. In your case, you have execution-local variables set which are threated as "global" variables for the task, since they are NOT set on the task local but on it's parent (or ancestor).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use this to set real task-local variables (or use the REST-API to set local task variables, see userguide):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;taskService.setVariableLocal("myVar", "localValue");&lt;BR /&gt;&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jan 2014 12:43:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/confused-about-local-and-global-variable-scope/m-p/157118#M111317</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2014-01-15T12:43:35Z</dc:date>
    </item>
  </channel>
</rss>

