Cdn_Dev
Cdn_Dev

Reputation: 765

Retrieve all project variables via REST call (jbpm)

For our project we are looking to:

On the user interface we are hoping to include a feature that does this:

We've toyed around a bit and so far have been unsuccessful in pulling the data back that we'd like.

Upvotes: 0

Views: 1922

Answers (2)

Cdn_Dev
Cdn_Dev

Reputation: 765

So far we've tried:

  • experimenting with the native remote api
  • persisting process data into our own database using persistence strategies

Initially we were unsuccessful with both, but eventually we decided on an implementation that passed a process id throughout our entire workflow, and creating a one to one mapping between each task model and the process id. In other words, for each jbpm workflow task we built our own form on the front end, and persisted data to our own database. The only thing that that tied the entire project together and allowed us to query for all of the data, was the process id that we initialized in the beginning.

This meant that jbpm ended up handling little to nothing about our app, other than the movement between tasks, and tying it all together via project id.

Upvotes: 1

ZombieBsAs
ZombieBsAs

Reputation: 171

You can use one of these two options to retrieve the Process Variables in the REST api:

/rest/runtime/{deploymentId}/withvars/process/instance/{procInstanceId}

returns the Process Instance with all its Variables, and:

/rest/history/instance/{procInstanceId}/variable

returns a list of variable history records for a process instance.

You can have the documentation here: jBPM Remote API

Upvotes: 1

Related Questions