Retrieving completion status for terminated processes

cancel
Showing results for 
Search instead for 
Did you mean: 
mprakash
Active Member II

Retrieving completion status for terminated processes

I looked at the Javadocs, and searched the forum, but did not find an answer.

Is there an API to get the process completion state (success, error, etc,) for processes that are completed and are in the history?

4 Replies
gdharley
Intermediate

Re: Retrieving completion status for terminated processes

 You can retrieve instances that  have a job execution error as well as a delete reason, but not by state as far as I know.

Greg

daisuke-yoshimo
Senior Member

Re: Retrieving completion status for terminated processes

If you want to know the process completion state(the end activity id), you can use HistoricProcessInstance.getEndActivityId().

・HistoricProcessInstance
https://www.activiti.org/javadocs/org/activiti/engine/history/HistoricProcessInstance.html

If you want to get HistoricProcessInstance, you neet to use HistoricProcessInstanceQuery.


・HistoricProcessInstanceQuery
https://www.activiti.org/javadocs/org/activiti/engine/history/HistoricProcessInstanceQuery.html

mprakash
Active Member II

Re: Retrieving completion status for terminated processes

Thanks  ‌ But what I want to do is find out the reason a process instance ended--is it because it completed, or because an error occurred, or because it got  a signal/event etc. I did not find anything in the Activiti API to retrieve that information.

gdharley
Intermediate

Re: Retrieving completion status for terminated processes

Understood, likely you will need to make a number of calls and merge the results to get the information you want.

Alternatively you could make a native SQL call (or a custom iBatis mapping) using the managementService to retrieve the status details from the jistory tables.

Greg