<?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: How to Assign a Task to the User Manager? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-assign-a-task-to-the-user-manager/m-p/315300#M2301</link>
    <description>&lt;P&gt;Do you have a stacktrace when CurrentUser["user&lt;/P&gt;</description>
    <pubDate>Fri, 13 Dec 2019 11:50:11 GMT</pubDate>
    <dc:creator>Thierry_Martins</dc:creator>
    <dc:date>2019-12-13T11:50:11Z</dc:date>
    <item>
      <title>How to Assign a Task to the User Manager?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-assign-a-task-to-the-user-manager/m-p/315299#M2300</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Assuming I have created a custom user field called &lt;CODE&gt;user:manager&lt;/CODE&gt; to store the user manager information, I would like to dynamically assign a task to him. So the scenario is: jdoe execute a task, then &lt;STRONG&gt;the second task is routed the the jdoe's manager&lt;/STRONG&gt; (corresponding to the manager property of the last task performer). My idea is ti use a workflow global variable to store the manager info, and then use &lt;CODE&gt;WorkflowVariables["manager_info"]&lt;/CODE&gt; to assign the task. I've tried a lot of options in Modeler, but not of them seems to work. In the first task, I'm using an automation chain that uses the &lt;CODE&gt;Context.SetWorkflowVar&lt;/CODE&gt; operation but none of these tries work:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;CurrentUser["user:manager"]]&lt;/CODE&gt; (gives a nullpointer)&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;CurrentUser.ActingUser&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;CurrentUser.getProperty("user:manager")&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;CurrentUser.getPrincipal().getModel().getPropertyValue("user:manager");&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;To be clear, &lt;CODE&gt;CurrentUser&lt;/CODE&gt; should refer to the user performing the first task (&lt;CODE&gt;jdoe&lt;/CODE&gt; in our case)&lt;/STRONG&gt;
What should I do?&lt;/P&gt;
&lt;P&gt;I've taken another approach, by putting the logic on the UI Side with things like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;        var manager = this.$.cnx.client.user.properties.manager;
        console.log("manager is: "+manager);
        var wf_instance_id = this.task.workflowInstanceId;
        console.log("wf_instance_id is: "+wf_instance_id);
        this.params.name = "user_level_2";
        this.params.value = manager;
        this.$.SetWorkflowVar.execute().then(function(result) {
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but it &lt;STRONG&gt;can't be recommanded&lt;/STRONG&gt; becauce it can be hacked easily, and a user could replace the manager variable with another username.&lt;/P&gt;
&lt;P&gt;Thx for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 10:20:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-assign-a-task-to-the-user-manager/m-p/315299#M2300</guid>
      <dc:creator>Gregory_Carlin</dc:creator>
      <dc:date>2019-12-13T10:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign a Task to the User Manager?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-assign-a-task-to-the-user-manager/m-p/315300#M2301</link>
      <description>&lt;P&gt;Do you have a stacktrace when CurrentUser["user&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 11:50:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-assign-a-task-to-the-user-manager/m-p/315300#M2301</guid>
      <dc:creator>Thierry_Martins</dc:creator>
      <dc:date>2019-12-13T11:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign a Task to the User Manager?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-assign-a-task-to-the-user-manager/m-p/315301#M2302</link>
      <description>&lt;P&gt;I've attached the log file with the different options I've taken. They are separated by ###&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 14:13:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-assign-a-task-to-the-user-manager/m-p/315301#M2302</guid>
      <dc:creator>Gregory_Carlin</dc:creator>
      <dc:date>2019-12-13T14:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to Assign a Task to the User Manager?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-assign-a-task-to-the-user-manager/m-p/315302#M2303</link>
      <description>&lt;P&gt;A User is not a Document...
See &lt;A href="https://doc.nuxeo.com/nxdoc/how-to-assign-a-task-to-the-user-manager/" target="test_blank"&gt;https://doc.nuxeo.com/nxdoc/how-to-assign-a-task-to-the-user-manager/&lt;/A&gt; for a simple proposal of solution to this problem of assignment of tasks to a third party to the workflow participants.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2019 08:38:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-assign-a-task-to-the-user-manager/m-p/315302#M2303</guid>
      <dc:creator>Patrick_Abgrall</dc:creator>
      <dc:date>2019-12-21T08:38:54Z</dc:date>
    </item>
  </channel>
</rss>

