Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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 05:39 Go to next message
Vikram Kodak is currently offline Vikram KodakFriend
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 Go to previous message
Vikram Kodak is currently offline Vikram KodakFriend
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

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


Current Time: Thu Apr 25 15:01:07 GMT 2024

Powered by FUDForum. Page generated in 0.03241 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top