Lahiru Athukorala
Lahiru Athukorala

Reputation: 69

How to get process instance id in WSO2 BPS

I have a bpel process which is invoked from a spring web application. 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. 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. 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

Upvotes: 0

Views: 298

Answers (1)

vanto
vanto

Reputation: 3142

The instance ID is always available in the variable $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. It could reply with the approval status. This would be fully BPEL compliant not a hack using the PM API.

Upvotes: 1

Related Questions