With the java API, how it’s possible to delete process instances of a specific process definition if they don’t belong to the last version?
With rest api I can easily achieve that using sort by definitionVersion. With the API I can’t figure how to do it. I don’t have any ordering by Version number.
I’m using camunda 7.8
Not really. I want to delete the processes of the older version of the same definition key, not id.
Your code will delete the instances of the same version(wich I don’t want to).
I solved somehow using the ‘getLatestVersion’ o a definition key and delete all the process instances that does not match the definition id(i.e. the version)