Historical event data from a Process Instance is empty [message #749260] |
Tue, 25 October 2011 05:39 |
Vikram Kodak Messages: 72 Registered: October 2011 |
Member |
|
|
I'm trying to get the process event info like Activated , Completed, completed user, time etc ..
When I do the following , I don't get any data . Anything that I am missing ?
ProcessInstanceQuery piq = ProcessInstanceQuery.findForProcess(processId);
piq.where(ROOT_PROCESS_INSTANCE_OID.isEqual(rootPoid));
piq.setPolicy(HistoricalEventPolicy.ALL_EVENTS);
ProcessInstance pi;
try {
pi = getQueryService(false).findFirstProcessInstance(piq);
} catch (IllegalOperationException e) {
LOG.error("Unable to execute Process Instance Query for RootProcess ID: " + rootPoid, e);
return null;
}
List<HistoricalEvent> dataList = pi.getHistoricalEvents();
Here dataList is always null
[Updated on: Tue, 25 October 2011 05:40] Report message to a moderator
|
|
|
Re: Historical event data from a Process Instance is empty [message #749265 is a reply to message #749260] |
Tue, 25 October 2011 05:41 |
Vikram Kodak Messages: 72 Registered: October 2011 |
Member |
|
|
You need to use an ActivityInstanceQuery as below:
ActivityInstanceQuery aiQuery = ActivityInstanceQuery.findAll();
ProcessInstanceFilter processFilter = new ProcessInstanceFilter(rootProcessOid, true);
aiQuery.where(processFilter);
aiQuery.orderBy(ActivityInstanceQuery.START_TIME).and(ActivityInstanceQuery.OID);
aiQuery.setPolicy(HistoricalEventPolicy.ALL_EVENTS);
The ActivityInstance class defines two methods.
List<HistoricalEvent> getHistoricalEvents()
Gets a list of requested additional data like notes, delegations, state changes and exceptions.
List<HistoricalState> getHistoricalStates()
Gets a list of historical states for the activity instance.
These two methods and the data you get from ActivityInstance should give you all the information you are looking for.
[Updated on: Tue, 25 October 2011 05:49] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03856 seconds