2

如何获取在 IBM BPM 8.5 中启动流程的用户。我想将我的任务重新分配给实际启动该过程的用户。在 IBM BPM 中如何实现?

4

5 回答 5

2

有几种方法可以获取谁发起了 Task,但谁发起了流程 Instance则有些不同。您可以执行以下操作之一:

  1. 添加一个私有变量并在启动的 POST 处为其分配 tw.system.user_loginName。您可以为启动流程的用户访问该变量。(如果任务由某些 REST API 或 UCA 启动,则该变量将为该场景的 null 或未定义。)

  2. 在开始事件之后放置一个跟踪组。添加一个输入变量作为 username ,为其分配一个与 tw.system.user_loginName 相同的值。因此,每当进程启动时,条目将被插入到 DB 表中。您可以从 PerformanceDB 中的该视图中检索此值。

也可能有一些表,记录流程实例详细信息,您可以在其中直接找到 user_id。

于 2015-08-27T09:46:32.910 回答
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".

于 2014-06-02T03:08:40.013 回答
1

如果要将进程中的第一个任务路由给启动进程的用户,最简单的方法是将起点放在通道中,然后在活动上选择路由到“Last User In Lane”。这将为您处理用例,而无需您进行簿记以跟踪用户。

我已经有一段时间没有实现这个了,所以我不记得如果你在第一个任务之前有系统步骤,它是否会优雅地工作,但这可以通过将系统步骤移动到要执行的人工服务中来轻松处理作为该调用的一部分,而不是作为 BPD 中的一个单独步骤。

于 2015-02-20T15:28:43.103 回答
0

您可以使用这行代码来实现相同的目的:

tw.system.user_loginName

于 2015-02-20T09:49:49.773 回答
0

将变量定义为字符串类型并使用脚本任务来定义使用此任务的登录用户并将其分配给您定义的变量,以在所有流程中作为任务的发起者保留给您。

于 2014-11-21T20:30:58.513 回答