jbpm

Determine the User Who Starts A jBPM Workflow for OpenKM


I have created a workflow with Eclipse for OpenKM successfully. Now, I need to know how to get a reference to the user that started the workflow for the file/folder. Is there a way to use the executionContext object or even capture the username via an expression?


Solution

  • I finally figured out a way to do it after a lot more research. What you can do is create a swimlane called initiator as brought out on this page. After that, you should be able to set the swimlane of the task nodes to initiator and the person who initiated the workflow will be assigned.

    Alternatively, you can create an ActionHandler and trigger it on the start node's before-signal event. This ActionHandler can do something like the following to store the initiator's actor ID in a variable to be used in a handler or even possibly in an expression:

    context.getContextInstance().setVariable("initiator-actor-id", context.getJbpmContext().getActorId())
    

    I would love to know if anyone knows how to pull a process expression, such as is stored by the above line, in an expression.