Check whether intermediate none event was passed

Hello,

could anyone please explain me how to figure out that an intermediate event in a process instance was passed?
I know how to do this in a junit-test, but not in “real world” :wink:

Kind regards

Hi @mhoc,

What is the real world in your case? :slight_smile:
How do you solve it in the unit test?

Cheers,
Thorben

Hello Thorben,

well, in JUnit I use:

assertThat(processInstance).hasPassed(“…”)

But how to check this in the deployed process?

Bye

Given you have the engine in variable “processEngine” and your process instance in variable “instance” and you are looking for the intermediate event with BPMN-id “noneIntermediateEvent”, this will work:

processEngine.getHistoryService() //
				.createHistoricActivityInstanceQuery() //
				.processInstanceId(instance.getId()) //
				.activityId("noneIntermediateEvent")
				.finished().singleResult() != null

Is that what you meant?

1 Like

Thank you, @Ragnar , that works perfect :slight_smile: