<?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: Sub process cannot resolve variable passed by 'callAtivity' in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/sub-process-cannot-resolve-variable-passed-by-callativity/m-p/12405#M5444</link>
    <description>&lt;P&gt;Sorry,&lt;SPAN&gt;&amp;nbsp;I solved problem by setting variable scope.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But for giving information about this, I'll append sample code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I completed task like below,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;taskService.complete(task.getId(), taskParam);&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;In my BPMN,&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;bpmn:userTask id="myTask" name="My Task" activiti:assignee="assigneeProperty"&amp;gt;
    &amp;lt;bpmn:extensionElements&amp;gt;
        &amp;lt;activiti:taskListener
                expression="${mySpringService.methodToTrigger(execution)}"
                event="complete"/&amp;gt;
    &amp;lt;/bpmn:extensionElements&amp;gt;
    &amp;lt;bpmn:incoming&amp;gt;incomingFlow&amp;lt;/bpmn:incoming&amp;gt;
    &amp;lt;bpmn:outgoing&amp;gt;outGoingFlow&amp;lt;/bpmn:outgoing&amp;gt;
&amp;lt;/bpmn:userTask&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In my service&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;@Service
public class MySpringService {&lt;BR /&gt;
    public void methodToTrigger(DelegateExecution execution) {&lt;BR /&gt;        // In task listener, I can get value &lt;BR /&gt;        // But in &lt;SPAN&gt;execution listener, I cannot get value but can set process variable.&lt;BR /&gt;&lt;/SPAN&gt;        // In both cases, getVariableLocal always returns null.
        Object object = execution.getVariable(variableKey);
        log.debug(object);
    }
}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;But I solved like below.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;// Specify variable scope as local
taskService.complete(task.getId(), taskParam, true);&lt;/PRE&gt;&lt;PRE&gt;@Service
public class MySpringService {

    public void methodToTrigger(DelegateExecution execution) {
        // Get variable local
        Object object = execution.getVariableLocal(variableKey);
        log.debug(object);
    }
}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your help!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jan 2021 09:07:17 GMT</pubDate>
    <dc:creator>zzangs33</dc:creator>
    <dc:date>2021-01-06T09:07:17Z</dc:date>
    <item>
      <title>Sub process cannot resolve variable passed by 'callAtivity'</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/sub-process-cannot-resolve-variable-passed-by-callativity/m-p/12401#M5440</link>
      <description>&lt;P&gt;I'm using `activiti-spring-boot-starter:7.1.0.M6`.&lt;/P&gt;&lt;P&gt;As I read [document][1], to pass process varibles to sub-process, I need to use&lt;/P&gt;&lt;P&gt;&amp;lt;!-- Main Process --&amp;gt;&lt;BR /&gt;&amp;lt;bpmn:callActivity id="mainActivity" name="TASK_NAME" calledElement="subProcess"&amp;gt;&lt;BR /&gt;&amp;lt;bpmn:extensionElements&amp;gt;&lt;BR /&gt;&amp;lt;activiti:in target="subVarName" source="mainVarName"/&amp;gt;&lt;BR /&gt;&amp;lt;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 target="mainVarName2" source="subVarName2"/&amp;gt;&lt;BR /&gt;&amp;lt;/bpmn:extensionElements&amp;gt;&lt;BR /&gt;&amp;lt;bpmn:incoming&amp;gt;flow1&amp;lt;/bpmn:incoming&amp;gt;&lt;BR /&gt;&amp;lt;bpmn&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;utgoing&amp;gt;flow2&amp;lt;/bpmn&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;utgoing&amp;gt;&lt;BR /&gt;&amp;lt;/bpmn:callActivity&amp;gt;&lt;/P&gt;&lt;P&gt;After I passed the variable, I thought it would be OK that process call `subVarName` in bpmn, but it wasn't.&lt;/P&gt;&lt;P&gt;I got `UnknownPropertyException` when engine referred `subVareName`.&lt;/P&gt;&lt;P&gt;&amp;lt;!-- Sub Process --&amp;gt;&lt;BR /&gt;&amp;lt;bpmn:serviceTask id="subActivity" name="SUB_TASK_NAME"&lt;BR /&gt;activiti:expression="${mySpringService.method(subVarName, execution)}"&amp;gt;&lt;BR /&gt;&amp;lt;bpmn:incoming&amp;gt;subFlow1&amp;lt;/bpmn:incoming&amp;gt;&lt;BR /&gt;&amp;lt;bpmn&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;utgoing&amp;gt;subFlow2&amp;lt;/bpmn&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;utgoing&amp;gt;&lt;BR /&gt;&amp;lt;/bpmn:serviceTask&amp;gt;&lt;/P&gt;&lt;P&gt;I already checked that `mainVarName` is not null because it is used by prior service task in main process.&lt;/P&gt;&lt;P&gt;Please let me know what I missed... Thanks!&lt;/P&gt;&lt;P&gt;[1]: &lt;A href="https://www.activiti.org/userguide/#bpmnCallActivityPassVariables" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.activiti.org/userguide/#bpmnCallActivityPassVariables&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Dec 2020 12:36:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/sub-process-cannot-resolve-variable-passed-by-callativity/m-p/12401#M5440</guid>
      <dc:creator>zzangs33</dc:creator>
      <dc:date>2020-12-26T12:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sub process cannot resolve variable passed by 'callAtivity'</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/sub-process-cannot-resolve-variable-passed-by-callativity/m-p/12402#M5441</link>
      <description>&lt;P&gt;The guide you are referring to belongs to an older version. i don't see similar topic in Activiti7. can you please post this on the gitter channel?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 07:12:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/sub-process-cannot-resolve-variable-passed-by-callativity/m-p/12402#M5441</guid>
      <dc:creator>abbask01</dc:creator>
      <dc:date>2021-01-04T07:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sub process cannot resolve variable passed by 'callAtivity'</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/sub-process-cannot-resolve-variable-passed-by-callativity/m-p/12403#M5442</link>
      <description>&lt;P&gt;I solved problem by using 'taskListener'.&lt;/P&gt;&lt;P&gt;And what I missed is that subprocess from 'callActivity' cannot receive variables. I saw that kind of description in this community.&lt;/P&gt;&lt;P&gt;By the way, is there any difference of 'DelegationExecution' between 'taskListener' and 'ExecutionListener'?&lt;/P&gt;&lt;P&gt;When I completed task with task parameters, the former can retrieve variables but it disappeared, the latter does contrary.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 17:37:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/sub-process-cannot-resolve-variable-passed-by-callativity/m-p/12403#M5442</guid>
      <dc:creator>zzangs33</dc:creator>
      <dc:date>2021-01-05T17:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sub process cannot resolve variable passed by 'callAtivity'</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/sub-process-cannot-resolve-variable-passed-by-callativity/m-p/12404#M5443</link>
      <description>&lt;P&gt;I believe task listener uses&amp;nbsp;&lt;A title="DelegateTask" href="http://javadox.com/org.activiti/activiti-engine/5.16/org/activiti/engine/delegate/DelegateTask.html" target="_self" rel="nofollow noopener noreferrer"&gt;DelegateTask&lt;/A&gt; whereas execution listener uses&amp;nbsp;&lt;A title="DelegateExecution" href="http://javadox.com/org.activiti/activiti-engine/5.16/org/activiti/engine/delegate/DelegateExecution.html" target="_self" rel="nofollow noopener noreferrer"&gt;DelegateExecution&lt;/A&gt;, so the tasklistener might have access to locally scoped task variables. could you please share some sample code for better clarity on behavior?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 06:52:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/sub-process-cannot-resolve-variable-passed-by-callativity/m-p/12404#M5443</guid>
      <dc:creator>abbask01</dc:creator>
      <dc:date>2021-01-06T06:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sub process cannot resolve variable passed by 'callAtivity'</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/sub-process-cannot-resolve-variable-passed-by-callativity/m-p/12405#M5444</link>
      <description>&lt;P&gt;Sorry,&lt;SPAN&gt;&amp;nbsp;I solved problem by setting variable scope.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But for giving information about this, I'll append sample code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I completed task like below,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;taskService.complete(task.getId(), taskParam);&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;In my BPMN,&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;bpmn:userTask id="myTask" name="My Task" activiti:assignee="assigneeProperty"&amp;gt;
    &amp;lt;bpmn:extensionElements&amp;gt;
        &amp;lt;activiti:taskListener
                expression="${mySpringService.methodToTrigger(execution)}"
                event="complete"/&amp;gt;
    &amp;lt;/bpmn:extensionElements&amp;gt;
    &amp;lt;bpmn:incoming&amp;gt;incomingFlow&amp;lt;/bpmn:incoming&amp;gt;
    &amp;lt;bpmn:outgoing&amp;gt;outGoingFlow&amp;lt;/bpmn:outgoing&amp;gt;
&amp;lt;/bpmn:userTask&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In my service&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;@Service
public class MySpringService {&lt;BR /&gt;
    public void methodToTrigger(DelegateExecution execution) {&lt;BR /&gt;        // In task listener, I can get value &lt;BR /&gt;        // But in &lt;SPAN&gt;execution listener, I cannot get value but can set process variable.&lt;BR /&gt;&lt;/SPAN&gt;        // In both cases, getVariableLocal always returns null.
        Object object = execution.getVariable(variableKey);
        log.debug(object);
    }
}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;But I solved like below.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;// Specify variable scope as local
taskService.complete(task.getId(), taskParam, true);&lt;/PRE&gt;&lt;PRE&gt;@Service
public class MySpringService {

    public void methodToTrigger(DelegateExecution execution) {
        // Get variable local
        Object object = execution.getVariableLocal(variableKey);
        log.debug(object);
    }
}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your help!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 09:07:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/sub-process-cannot-resolve-variable-passed-by-callativity/m-p/12405#M5444</guid>
      <dc:creator>zzangs33</dc:creator>
      <dc:date>2021-01-06T09:07:17Z</dc:date>
    </item>
  </channel>
</rss>

