<?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 callActivity not setting the start user in second execution in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/callactivity-not-setting-the-start-user-in-second-execution/m-p/242698#M195828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using Activiti 5.19 embeded in Alfresco.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm doing some test to check if calling activities dynamically could solve one of our use cases.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I defined a workflow that simply takes a process name from a config variable and calls that activity. The activity itself executes a little script task and then starts an Alfresco User Task. When the task is completed the activity ends and it goes back to the parent process. Then the parent process checks the config again and executes the next activity and so on…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The first time the callActivity is used everything works fine but the second time the callActivity starts the subprocess without setting an owner (start_user_id in table ACT_HI_PROCINST is null in the DB ) for child process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the process XML (without the graphical part for brevity):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;&amp;lt;definitions xmlns="&lt;A href="http://www.omg.org/spec/BPMN/20100524/MODEL" rel="nofollow noopener noreferrer"&gt;http://www.omg.org/spec/BPMN/20100524/MODEL&lt;/A&gt;" xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;" xmlns:xsd="&lt;A href="http://www.w3.org/2001/XMLSchema" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;" xmlns:activiti="&lt;A href="http://activiti.org/bpmn" rel="nofollow noopener noreferrer"&gt;http://activiti.org/bpmn&lt;/A&gt;" xmlns:bpmndi="&lt;A href="http://www.omg.org/spec/BPMN/20100524/DI" rel="nofollow noopener noreferrer"&gt;http://www.omg.org/spec/BPMN/20100524/DI&lt;/A&gt;" xmlns:omgdc="&lt;A href="http://www.omg.org/spec/DD/20100524/DC" rel="nofollow noopener noreferrer"&gt;http://www.omg.org/spec/DD/20100524/DC&lt;/A&gt;" xmlns:omgdi="&lt;A href="http://www.omg.org/spec/DD/20100524/DI" rel="nofollow noopener noreferrer"&gt;http://www.omg.org/spec/DD/20100524/DI&lt;/A&gt;" typeLanguage="&lt;A href="http://www.w3.org/2001/XMLSchema" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;" expressionLanguage="&lt;A href="http://www.w3.org/1999/XPath" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/1999/XPath&lt;/A&gt;" targetNamespace="&lt;A href="http://activiti.org/bpmn" rel="nofollow noopener noreferrer"&gt;http://activiti.org/bpmn&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;process id="testProcessChooseProcess" name="Proceso selector de trámites" isExecutable="true"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;startEvent id="chooserStartEvent" name="Process chooser start event" activiti:formKey="twf:submitChooseProcess"&amp;gt;&amp;lt;/startEvent&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"&amp;gt;&amp;lt;/exclusiveGateway&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;callActivity id="callNextActivity" name="Call next activity" calledElement="${nextActivity}"&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="bpm_sendEMailNotifications" target="bpm_sendEMailNotifications"&amp;gt;&amp;lt;/activiti:in&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:in source="bpm_workflowDueDate" target="bpm_workflowDueDate"&amp;gt;&amp;lt;/activiti:in&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:in source="bpm_assignee" target="bpm_assignee"&amp;gt;&amp;lt;/activiti:in&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:in source="bpm_workflowPriority" target="bpm_workflowPriority"&amp;gt;&amp;lt;/activiti:in&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:in source="bpm_workflowDescription" target="bpm_workflowDescription"&amp;gt;&amp;lt;/activiti:in&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:in source="initiator" target="initiator"&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;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/callActivity&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="nextProcessSequence" name="Call next process" sourceRef="exclusivegateway1" targetRef="callNextActivity"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;conditionExpression xsi:type="tFormalExpression"&amp;gt;&amp;lt;![CDATA[${nextActivity != null}]]&amp;gt;&amp;lt;/conditionExpression&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endEvent id="endevent1" name="End"&amp;gt;&amp;lt;/endEvent&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="noMoreProcessesSequence" name="No more processes" sourceRef="exclusivegateway1" targetRef="finalTaskAssigment"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;conditionExpression xsi:type="tFormalExpression"&amp;gt;&amp;lt;![CDATA[${nextActivity == null}]]&amp;gt;&amp;lt;/conditionExpression&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;serviceTask id="alfrescoScripttask1" name="Get next activiti" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate"&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:field name="script"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:string&amp;gt;&amp;lt;![CDATA[logger.log("Parsing twf_processConfig v17…");&lt;BR /&gt;var nextActivity = 'dummyUserProcess';&lt;BR /&gt;execution.setVariable('nextActivity', nextActivity);&lt;BR /&gt;logger.log("Next activity will be: " + nextActivity);]&amp;gt;&amp;lt;/activiti:string&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/activiti:field&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;lt;/serviceTask&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow1" sourceRef="chooserStartEvent" targetRef="alfrescoScripttask1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow2" sourceRef="alfrescoScripttask1" targetRef="exclusivegateway1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;userTask id="finalTaskAssigment" name="Final user task" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:adhocTask"&amp;gt;&amp;lt;/userTask&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow4" sourceRef="finalTaskAssigment" targetRef="endevent1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow6" sourceRef="callNextActivity" targetRef="alfrescoScripttask1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/process&amp;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;/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;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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jun 2016 16:39:55 GMT</pubDate>
    <dc:creator>iblanco</dc:creator>
    <dc:date>2016-06-13T16:39:55Z</dc:date>
    <item>
      <title>callActivity not setting the start user in second execution</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/callactivity-not-setting-the-start-user-in-second-execution/m-p/242698#M195828</link>
      <description>I'm using Activiti 5.19 embeded in Alfresco.I'm doing some test to check if calling activities dynamically could solve one of our use cases.So I defined a workflow that simply takes a process name from a config variable and calls that activity. The activity itself executes a little script task and t</description>
      <pubDate>Mon, 13 Jun 2016 16:39:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/callactivity-not-setting-the-start-user-in-second-execution/m-p/242698#M195828</guid>
      <dc:creator>iblanco</dc:creator>
      <dc:date>2016-06-13T16:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: callActivity not setting the start user in second execution</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/callactivity-not-setting-the-start-user-in-second-execution/m-p/242699#M195829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What do you mean with 'second time'? I only see one call activity? Or does it loop back (That's what I assume)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 12:56:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/callactivity-not-setting-the-start-user-in-second-execution/m-p/242699#M195829</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-06-20T12:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: callActivity not setting the start user in second execution</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/callactivity-not-setting-the-start-user-in-second-execution/m-p/242700#M195830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Joram:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, it does loop back after executing each activity. The called activity is just a process with a single user task so whenever the user task is completed the parent process is resumed and calls the activity again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I execute my process as user "admin". When the activity is called for the first time the called activity has the start_user_id set as "admin" as expected (both processes, the "parent" process and the called process, both have the user set correctly). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I end the user task, once more with user "admin", the execution of the parent process resumes as expected and the callActivity is called once more but this time the child process has no "start_user_id" set at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems to me like if "resuming the parent" would cause the loss of the authentication. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried to debug the issue across Activiti code and saw that the current authenticated user is saved in a ThreadLocal variable. Maybe there is some kind of thread when resuming the execution or something like that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 13:10:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/callactivity-not-setting-the-start-user-in-second-execution/m-p/242700#M195830</guid>
      <dc:creator>iblanco</dc:creator>
      <dc:date>2016-06-20T13:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: callActivity not setting the start user in second execution</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/callactivity-not-setting-the-start-user-in-second-execution/m-p/242701#M195831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&amp;gt; I've tried to debug the issue across Activiti code and saw that the current authenticated user is saved in a ThreadLocal variable. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That is correct.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How are you running this? Via Explorer? Unit test?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 09:38:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/callactivity-not-setting-the-start-user-in-second-execution/m-p/242701#M195831</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-06-22T09:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: callActivity not setting the start user in second execution</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/callactivity-not-setting-the-start-user-in-second-execution/m-p/242702#M195832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm deploying and running it in Alfresco 5.1g.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 09:39:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/callactivity-not-setting-the-start-user-in-second-execution/m-p/242702#M195832</guid>
      <dc:creator>iblanco</dc:creator>
      <dc:date>2016-06-22T09:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: callActivity not setting the start user in second execution</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/callactivity-not-setting-the-start-user-in-second-execution/m-p/242703#M195833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've added a unit test for it here, but I cannot reproduce it on the Activiti engine: &lt;/SPAN&gt;&lt;A href="https://github.com/Activiti/Activiti/commit/a6c8fda1e64497f50e76bb1ada77044d4a77cdaf" rel="nofollow noopener noreferrer"&gt;https://github.com/Activiti/Activiti/commit/a6c8fda1e64497f50e76bb1ada77044d4a77cdaf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would be interesting to see what the differences are between this and your case.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2016 15:58:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/callactivity-not-setting-the-start-user-in-second-execution/m-p/242703#M195833</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-07-01T15:58:39Z</dc:date>
    </item>
  </channel>
</rss>

