cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete a single ProcessDefinition

jagudin
Champ in-the-making
Champ in-the-making
Hello,

Is there a way to delete a single ProcessDefinition having his processDefinitionId?

I need to delete ProcessDefinitions, only if not exist ProcessInstances associated to the ProcessDefinition that i want to delete.

I don't want to remove the whole deployment using:

RepositoryService.deleteDeployment(java.lang.String deploymentId, boolean cascade)

I need something like:

RepositoryService.deleteProcessDefinition( processDefinitionId )

Thanks in advance,

jagudin
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
No, there is currently no such API method.
The idea is that one deployment is a self-contained package where every entry in the package cannot exist without the other entries.
As such, deleting only one process definition isn't needed.

But if you believe it is necessary, please file a JIRA, and state your use case.

jagudin
Champ in-the-making
Champ in-the-making
Thanks for the quick answer.

I understand, but I think that if a ProcessDeffinition and all stuff associated to this ProcessDeffinition, was deleted, and there is no ProcessInstances associated to it, the deployment will remain cohesive.

I have found situations where I just need to delete some process of a Deployment, not to delete the whole Deployment

jagudin

jbarrez
Star Contributor
Star Contributor
Well it depends on your use case: what if you have forms or rules attached to that process definition? Do you need to remove them too? But what if such a form is shared between other process definitions in your deployment …. then you cant delete them.

So getting it 'right' in the generic way is hard. That's why there is currently only the delete deployment option. If you want to cover your use case, then you would need to store only 1 process definition / deployment.