cancel
Showing results for 
Search instead for 
Did you mean: 

Query for historic process instances by key

busy
Champ in-the-making
Champ in-the-making
I query for historic process instances by key via REST this way:
POST query/historic-process-instances
{
  "processDefinitionKey" : "myProcessKey"
}
and it works perfect!
The question is that if I reload the deployment (deleting and creating a new one) then the historic returns no processes even though the key hasn't changed.

Shouldn't I get all the previous processes?

Any help will be welcome

4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
Did you delete the deployment with cascade? If so, all will be removed. Whats the reason for deleting the deployment? There are generally not many reasons for doing so.

busy
Champ in-the-making
Champ in-the-making
Thanks Joram!
I delete the deployment using:
DELETE repository/deployments/{deploymentId}
does this mean with cascade?
I am doing so because I am making some adjustments in the xml and I reload it often, but I'd like to keep seeing previous processes.
In fact, I can get them if I query the history the same way:
query/historic-process-instances but posting some process variables.
So they are there although asking by processDefinitionKey returns no processes.

jbarrez
Star Contributor
Star Contributor
I believe the default is with cascade, yet.

>I am doing so because I am making some adjustments in the xml and I reload it often, but I'd like to keep seeing previous processes.

Then you don't need the delete: if you deploy a process definition with the same id again, all your process instance just stay where they were, and new instances will be created with the newly deployed process definition.

busy
Champ in-the-making
Champ in-the-making
I'll do what you suggest. I won't delete the deployment and I'll play with versions to get the newest process definition.
Thanks a lot!