2

How to get the user who initiated the process in IBM BPM 8.5. I want to reassign my task to the user who actually initiated the process. How it can be achieved in IBM BPM?

JoshMc
  • 10,239
  • 2
  • 19
  • 38
SikanderAhmed
  • 361
  • 1
  • 5
  • 14

5 Answers5

2

There are several ways to get that who initiated a Task , But who initiated a process Instance is somewhat different. You can perform one out of the following :

  1. Add a private variable and assign it tw.system.user_loginName at the POST of start. you can access that variable for user who initiated the process.(It will be null or undefined for the scenario if task is initiated by some REST API or UCA.)

  2. Place a Tracking group after Start event . Add a input variable to it as username , assign it a value same as tw.system.user_loginName. So whenever Process is started entry will be inserted to DB Table.You can retrieve this value from that view in PerformanceDB.

Also there might be some table ,logging the process Instances details , where you can find the user_id directly.

Jyoti Yadav
  • 126
  • 8
1

I suggest you to look in getStarter() method of ProcessInstanceData API.

Official Documentation on API

This link on IBM Developerworks should help you too: Process Starter

Unfortunately there's not an Out Of The Box way to do this - nothing is recorded in the Process Instance that indicates "who" started a process. I presume this is because there are many ways to launch a process instance - from the Portal, via a Message Event, from an API call, etc.

Perhaps the best way to handle this is to add a required Input parameter to your BPD, and supply "who" started the process when you launch it. Unfortunately you can't supply any inputs from the OOTB Portal "New", but you can easilty build your own "launcher".

Community
  • 1
  • 1
artild
  • 365
  • 1
  • 9
  • Thanks Artild!! I achieved this by keeping a parameter in my Business Object and sets the name of the user who ever launches the process. That's the best way to do it i guess. – SikanderAhmed Jun 02 '14 at 07:29
  • @SikanderAhmed you should probably mark this as the answer if this is the solution you've used. – Cleanshooter Sep 30 '15 at 20:26
1

If you want to route the first task in process to the user that started the process the easiest approach is to simply put the start point in the lane, and on the activity select routing to "Last User In Lane". This will take care of the use case for you without requiring that you do the book keeping to track the user.

Its been a while since I've implemented this, so I can't remember if it will work elegantly if you have system steps before the first task, but this can easily be handled by moving the system steps into the human service to be executed as part of that call, rather than as a separate step in the BPD.

Drux
  • 486
  • 2
  • 6
0

Define variable as string type and using script task to define the login user that use this task and assign it to your defined variable to keep to you in all of the process as initiator of the task.

0

You can use this line of code to achieve the same:

tw.system.user_loginName

Opal
  • 81,889
  • 28
  • 189
  • 210