-
1. Re: [jBPm 4.1] - How to find a exeuction is ended or not
kukeltje Mar 9, 2010 3:28 PM (in response to mike_burton)Have a look at the examples that are in the distribution -
2. Re: [jBPm 4.1] - How to find a exeuction is ended or not
mike_burton Mar 9, 2010 4:27 PM (in response to kukeltje)Hi Ronald,
Thanks for you reply. I have only available is ProcessInstance ID in my application. I am using the query API to get the ProcessInstance. After that i am invoking 'isEnded()' method to check whether the Process Instance is ended or not. Below is the code which i am using.
ProcessInstance p =
getExecutionServicegetExecutionService
If (p.isEnded()) {
//
}
It's returning process instance while in execution. Once the execution is ended, the statement is returning null. I have to find out whether the instance is in execution or ended, using ProcessInstanceID.
is it the correct way? Please guide me.
Thanks!
-
3. Re: [jBPm 4.1] - How to find a exeuction is ended or not
mike_burton Mar 9, 2010 4:30 PM (in response to mike_burton)ProcessInstance p = getExecutionService().createProcessInstanceQuery().processInstanceId(processInstanceID).uniqueResultSet();
if (p.isEnded()){
//
}
-
4. Re: [jBPm 4.1] - How to find a exeuction is ended or not
kukeltje Mar 9, 2010 5:13 PM (in response to mike_burton)Yes to a large extend, as is mentioned in othe posts in this forum as well. Finished processes are in the history table. -
5. Re: [jBPm 4.1] - How to find a exeuction is ended or not
swiderski.maciej Mar 10, 2010 3:08 AM (in response to kukeltje)You could use HistoryProcessInstanceQuery to get such information.
historyService.createHistoryProcessInstanceQuery().processInstanceId(). state(HistoryProcessInstance.STATE_ENDED).uniqueResult();
If that will return any result this will mean your process instance is finished.
You can try different configuration for HistoryProcessInstanceQuery as well if above example does not suit your needs.
HTH
Maciej