When will the process instance finished if have two end event?

I have a process definition.
And the process have two end event.
endEvent1 and endEvent2 are the name of the end events.

I just want to know the process instance will be finished or not when the endEvent1 was triggered.

Let me explan the process instance will be finished actully mean what.

When the process instance was finished then cannot get the process instance by the java api like below.

runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult()

But when the process instance was finished can get the process instance by the java api like below.

historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstance Id)

My english is`t enough to explan the question clearly but I did it the best of I can. Please forgive me.

Thanks you all.

Is the answer of the question is after all activity instance be cancelled or finished?

That is correct.

Note that this does not have to mean that both end events must be reached. For example:

grafik

Here, the process instance finishes once either one of the end events has been reached.

Cheers,
Thorben

2 Likes

@thorben Thank you. I get it.