Get BDM objects of an archived case

I need to get the BDM objects of an archived case.
Using ../API/bdm/businessDataReference/{{caseId}}/{{myObject}} works for an active case but not for an archived.
What is the API to use? I didn't find it in the documentation.

Comments

Submitted by antoine.mottier on Thu, 11/19/2015 - 11:36

To me this seems to be a valid solution.

The only limitation I can think of is that your business data will be linked to a single process instance.
So you can only search for this process data from this single instance.
I have seen some use cases where several processes manipulate a single business data. In such situation you might want to store multiple process instance ids.

I assume that you have some kind of forms to select an archived process instance and then use the SourceObjectId information to get the "live" process instance id. Is that right?

In fact this is weird (maybe a bug?), but when I display the overview page for an archived case, the URL parameter sourceObjectId stays empty. And the URL param "id" keeps the processInstanceId value...

I try to reproduce your issue but without success. In my test I have both the id (id of the latest archivedProcessInstance entry for the selected process instance) and sourceObjectId (the id of the process instance while the process was running).

I'm still using 7.1.2 efficiency, I made a bos sample if you want to try it.
To reproduce :
1- Create a process with one step
2- Add an overview page in which you get the URL parameters "id" and "sourceObjectId" and displays it
3- Launch your process
4- Before completion, id is displayed, and sourceObjectId is empty on the overview page
5- After finishing the process, id is still displayed and sourceObjectId is still empty

The solution to this issue is to change de Model of the process? I have a process in a production environment with more than 500 cases, the client is asking for a report with the information of the open and closed cases. Should I tell them that the information of the archived cases is not accessible because I didn´t put the reference to the processInstanceId in the model? What is the point of use a bpm tool if I have to take care of this kind of things?

Actually since this recommendation a new REST API is available that let you get the context of the archived case and from those context you have information about URL to call to retrieve business data value: /API/bpm/archivedCase/:archivedCaseId/context

Actually Antoine has the right answer but I will phrase it differently.

Business Data shouldn't be relied on to be stored with the Archived case. This used to be the way before BDM, and I suspect this will change in future releases (not a prediction just a musing).

The point about Business Data is that it should be stored in your database as Business Data and not as part of an archived process, only process data should be stored in that way (even so process data can be stored as business data if required).

Antoine also suggests that the process task ID be used as a reference key to the data, this would also be the right way to go.

The thing here is if you need to do this type of analytical work for process operation again and again you actually need to design a Logging Mechanism for the process and business data so you can recreate a historical version of the process and data flow for auditing.

To do this may require you to change every process to add the logging, so use it carefully, it can generate a lot of data...

You should also be careful of associating a BDM with the actual logged data. For example over time the BDM may change so the data associated with it from a process that is 6 months old may not correlate. It might be necessary to relate the execution of a process not only to the task executed, but also the version of the process/task.

A possible solution might be to search among all the business data the one your interested in.
You might want to store the process instance id as a business data attribute to use it in the search query.