Retrieve the context from an archived case


Hi everyone,

I’m using Bonita 7.3.3, and my concern deals with a custom overview page for both active and archived cases.

I succeed on making one for an active case (when I select a task and go to the third tab), but I can’t figure it out when it comes to archived cases.

I understood that the API has to be built differently.
For the next example, “caseId”, usually an URL parameter type valued "id", is set to 49001.

When the case 49001 is active, I’m using [../API/bpm/case/49001/context]. This works just fine.
The I end this case and, following the documentation, I’m using [../API/bpm/archivedCase?c=1&d=started_by&d=processDefinitionId&f=sourceObjectId%3D{{caseId}}&p=0 ] to check if the caseId references to an archived one.

It does.
It gives me a JSON containing the sourceObjectId (which was the id when the case was still active) and the id I need:

Then, I reach the following URL to get the similar JSON I’m using for active cases, and i get exactly what i need: http://localhost:8080/bonita/API/bpm/archivedCase/144003/context.

My question is:
How can i retrieve the id (144003 in the URL above) of the archived case? I get nothing if I try to create a new variable called “archivedCaseId” value “”.

Does anyone have any suggestion, or a lead to follow?
Thank you.


1 answer

This one is the BEST answer!

I'm just dumb.

Trying to make myself clear shown me what i did wrong.

var1 = ../API/bpm/archivedCase?c=1&d=started_by&d=processDefinitionId&f=sourceObjectId%3D49001&p=0.

The context has to be retrieved with this variable:
var2 = ../API/bpm/archivedCase/{{var1[0].id}}/context

Sorry for the useless post, and thank you all for your work.



Submitted by Sean McP on Wed, 01/18/2017 - 19:35

thank you for sharing,