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?
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.
If you want to know the process completion state(the end activity id), you can use HistoricProcessInstance.getEndActivityId().
If you want to get HistoricProcessInstance, you neet to use HistoricProcessInstanceQuery.
Thanks Greg Harley daisuke-yoshimoto _ 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.
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.
Retrieving data ...