1 Reply Latest reply on Apr 10, 2013 1:32 AM by bird86

    How to retrieve userid from within BPMN?

    Apol Chakrab Newbie

      I have used the following to retrieve the process id, unique id, node id, and node name from on-exit action of a human task node in a the BPMN workflow:

       

      kcontext.getProcessInstance().getId()

      kcontext.getNodeInstance().getNode().getMetaData("UniqueId")

      kcontext.getNodeInstance().getNode().getId()

      kcontext.getNodeInstance().getNode().getName()

       

      Now I need to retrieve the  userid who is the "assignee" of a human task node in the on-exit action of the node. The task is assigned to a group and I need to know which user is actually claiming and submitting the task.

       

      In the "Messages" panel in the jBPM console, I can see the "assignee" who claims and submits the task, I don't know how to grab that value from within the BPMN process.

       

      Please help. 

        • 1. Re: How to retrieve userid from within BPMN?
          bird86 Newbie

          You can create a variable "assignee" in process.

           

          results.put("assignee", userId);

          localTaskService.completeWithResults(taskId, userId, results);

           

          you put the userId in results map, and then you can get the value of the variable "assignee"  in the on-exit action of the node.

           

          the snippet code in the on-exit action:

          System.out.println("the assignee of the task node is"+assignee);