How to delete process instance so that its associated business data is also deleted from BDM?

Hi,

We have a functionality in our project to delete the process instance. On deleting the process instance, we would also like to delete the associated business data maintained in BDM schema. Is there a way to delete process instance such that its associated business data is also deleted from BDM. The deleteProcessInstance API only deletes the process instance.

Regards,
Kinjal

1 Like

There is, as I think you have found, no automatic way of doing this.

You will need to develop and write your own “deleteProcessInstance” function to do both.

The problem, as you will have already identified is what to delete? Especially if you have a process that creates multiple BDOs and you decide to cancel in the middle of the process.

A work around would be for you to modify your BDOs to hold and save the processId and then delete only those BDO that are referenced by the processId you want to delete.

But what happens if there are two processes working one after the other where the second is updating the previous? Could get very messy

I think the way to do this is using “deleteBusinessDataOperation”,

regards
Seán

PS: If this reply answers your question, please mark a resolved.

Hi,

Could you please elaborate on what you mean by “deleteBusinessDataOperation”?

Sorry that’s just my name for a home grown method to do what you are asking…