<?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: Get process's initiator username from Java class in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/get-process-s-initiator-username-from-java-class/m-p/231377#M184507</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hmm, if the initiator.properties.userName is available just before the service task, it should be available to in the service task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there anything special about your process why it would remove that variable?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Sep 2016 10:02:55 GMT</pubDate>
    <dc:creator>jbarrez</dc:creator>
    <dc:date>2016-09-08T10:02:55Z</dc:date>
    <item>
      <title>Get process's initiator username from Java class</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-process-s-initiator-username-from-java-class/m-p/231375#M184505</link>
      <description>Hi folks!I'm using Activiti with Alfresco Community (currently AC 5.1). I'm working in some workflows, and few of them have an userTask that needs to be assigneed to an especific user, taked from a database.Example: some users need their tasks must be approved by User A, and some users need their ta</description>
      <pubDate>Mon, 05 Sep 2016 14:23:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-process-s-initiator-username-from-java-class/m-p/231375#M184505</guid>
      <dc:creator>jsalvador</dc:creator>
      <dc:date>2016-09-05T14:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Get process's initiator username from Java class</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-process-s-initiator-username-from-java-class/m-p/231376#M184506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, I guess I find a solution, but it isn't the good way…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. I added a ScriptTask with this code, BEFORE my ServiceTask:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;execution.setVariable("workflow_starter", initiator.properties.userName);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Into my Java ServiceTask, I added the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String userName =(String) execution.getVariable("workflow_starter");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/java&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And my query uses the &amp;lt;code&amp;gt;userName&amp;lt;/code&amp;gt; variable to get the reviewer. Not clean, but works.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Sep 2016 16:21:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-process-s-initiator-username-from-java-class/m-p/231376#M184506</guid>
      <dc:creator>jsalvador</dc:creator>
      <dc:date>2016-09-05T16:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Get process's initiator username from Java class</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-process-s-initiator-username-from-java-class/m-p/231377#M184507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hmm, if the initiator.properties.userName is available just before the service task, it should be available to in the service task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there anything special about your process why it would remove that variable?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2016 10:02:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-process-s-initiator-username-from-java-class/m-p/231377#M184507</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-09-08T10:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Get process's initiator username from Java class</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-process-s-initiator-username-from-java-class/m-p/231378#M184508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Joram, nice to see you here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, at the first try, I tried to get the workflow starter's username by &amp;lt;code&amp;gt;execution.getVariable("initiator.properties.userName");&amp;lt;/code&amp;gt; but it doesn't work, and I get an ActivitiException here. So I need to try other solutions. As I said, this is not the best way to do it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Update.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And now I see the error… I wasn't casting the value as String.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2016 12:00:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-process-s-initiator-username-from-java-class/m-p/231378#M184508</guid>
      <dc:creator>jsalvador</dc:creator>
      <dc:date>2016-09-08T12:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Get process's initiator username from Java class</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/get-process-s-initiator-username-from-java-class/m-p/231379#M184509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can access to the initiator using this code in a ExecutionListener implementation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;ActivitiScriptNode initiatorScriptNode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ActivitiScriptNode&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; execution&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getVariable&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"initiator"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;NodeRef initiatorNodeRef &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; initiatorScriptNode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getNodeRef&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the delay &lt;IMG src="https://connect.hyland.com/legacyfs/online/alfresco/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 11:11:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/get-process-s-initiator-username-from-java-class/m-p/231379#M184509</guid>
      <dc:creator>alramlo</dc:creator>
      <dc:date>2019-01-10T11:11:04Z</dc:date>
    </item>
  </channel>
</rss>

