Bonita 6 WEB REST API - Get cases and their case variables.

1
0
-1

Here's the current Bonita 6 WEB REST API call: {server address}/case?p=0&o=start&f[]=state:started&f[]=processDefinitionId:{processId}

It returns the following sample results: [ { "id": "9049", "end_date": "", "startedBySubstitute": "1", "start": "2014-08-04 11:25:47.625", "state": "started", "rootCaseId": "9049", "started_by": "1", "processDefinitionId": "6542310678011325631", "last_update_date": "2014-08-04 11:25:47.625" }, ... ]

In Bonita 5, I could make a queryRuntimeAPI getProcessInstances call that would return all the cases with their associated client variables. In Bonita 6, it returns the cases with only the system variables (case's Id, processDefinitionId, start date, etc).

Because I need to get large amounts of cases back in Bonita 6 and all their case variables, it’s not optimal for me to get all cases and individually make API calls for each case’s client variables. Does anyone have a suggestion on how to get a list of cases with all their variables included in the results for Bonita 6? Is there a flag or url param I need to set in the Bonita 6 WEB REST API call to do so? Is there a batch request WEB REST API call available?

I've tried "&d=" in my Search call to expand the data returned, but the only one I've found that seems to be supported is processDefinitionId. I could just be using the wrong name for that param though, but I haven't had much luck in blind guessing.

1 answer

1
0
-1
This one is the BEST answer!

hello, in bonita 6, on the Case REST API, You can deploy three different object using the "&d=": - "started_by" - "startedBySubstitute" - "processDefinitionId"

but there is no way to get all cases with all their variables in one API call (neither in the REST API nor in the ENGINE API) As a workaround, you could build your own java servlet to deploy on your server. This servlet will, - call the engine API to get all cases, - then call the engine API to get all the variables for each cases, - and return all the data to your web client

Hope this helps. Regards,

Julien.

Comments

Submitted by cstorar on Mon, 09/08/2014 - 17:23

Thank you for the answer Julien. I'll look into the workaround you suggested.

Notifications