cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving completion status for terminated processes

mprakash
Confirmed Champ
Confirmed Champ

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 4

gdharley
Elite Collaborator
Elite Collaborator

 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
Star Collaborator
Star Collaborator

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
Confirmed Champ
Confirmed Champ

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
Elite Collaborator
Elite Collaborator

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

Getting started

Explore our Alfresco products with the links below. Use labels to filter content by product module.