Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Process Manager (Stardust) » Historical event data from a Process Instance is empty(Empty historical event data)
Historical event data from a Process Instance is empty [message #749260] Tue, 25 October 2011 01:39 Go to next message
Vikram Kodak is currently offline Vikram Kodak
Messages: 57
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 01: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 01:41 Go to previous message
Vikram Kodak is currently offline Vikram Kodak
Messages: 57
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 01:49]

Report message to a moderator

Previous Topic:Document Service Integration - Attached Document Panel
Next Topic:Viewing documents independently of the process
Goto Forum:
  


Current Time: Fri Aug 29 18:30:44 EDT 2014

Powered by FUDForum. Page generated in 0.01629 seconds