简体   繁体   English

如何在WSO2 BPS中获取流程实例ID

[英]How to get process instance id in WSO2 BPS

I have a bpel process which is invoked from a spring web application. 我有一个从Spring Web应用程序调用的bpel进程。 In my process there is an approval flow. 在我的流程中,有一个批准流程。 In my web app I want to analyze the process to determine where the process is currently being. 在我的Web应用程序中,我想分析流程以确定该流程当前在哪里。 For an example : If the process has two approvals to be received I want to know whether the first approval has been returned or likewise. 例如:如果流程有两个批准要接收,我想知道是否已经返回了第一个批准。 So I want to keep process instance id in my application database. 所以我想将流程实例ID保留在我的应用程序数据库中。 Then I can invoke some admin services to get data about the process. 然后,我可以调用一些管理服务来获取有关该过程的数据。

Is there any way that I can achieve this target ? 有什么办法可以实现这个目标?

And at the same time I want to get confirmed whether there is any admin service to get process status. 同时,我想确认是否有任何管理服务来获取进程状态。 I know that it is possible to do it with Human tasks. 我知道可以通过人工任务来做到这一点。

I'm using WSO2 BPS 3.2.0 我正在使用WSO2 BPS 3.2.0

The instance ID is always available in the variable $ode:pid . 实例ID始终在$ode:pid变量中可用。 In order to query a process for state, I would refrain from using the admin API but would rather implement an event handler at the root (or a lower) scope, that listens for something like a getStatus operation and uses the PIID as correlation property. 为了查询进程的状态,我将避免使用admin API,而是在根(或较低)范围内实现事件处理程序,该事件处理程序侦听诸如getStatus操作之类的内容并将PIID用作关联属性。 It could reply with the approval status. 它可以回复批准状态。 This would be fully BPEL compliant not a hack using the PM API. 这将完全符合BPEL,而不是使用PM API的黑客。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM