I am coding an event listener class based on FlowableEventListener to get notified about started and completed activities. But if i have the following code to find a unique id for the current task, i can not find any unique id in my logs.
public void onEvent(FlowableEvent event) {
if (event instanceof FlowableEngineEvent engineEvent) {
FlowableEventType eventType = engineEvent.getType();
if (eventType != FlowableEngineEventType.ENTITY_INITIALIZED &&
eventType != FlowableEngineEventType.ENTITY_CREATED &&
eventType != FlowableEngineEventType.ENTITY_DELETED &&
eventType != FlowableEngineEventType.VARIABLE_DELETED &&
eventType != FlowableEngineEventType.HISTORIC_ACTIVITY_INSTANCE_ENDED &&
eventType != FlowableEngineEventType.HISTORIC_ACTIVITY_INSTANCE_CREATED &&
eventType != FlowableEngineEventType.SEQUENCEFLOW_TAKEN){
System.out.println("Event name: " + eventType.name());
System.out.println("Scope ID: " + engineEvent.getScopeId());
System.out.println("Scope Definition ID: " + engineEvent.getScopeDefinitionId());
System.out.println("Sub Scope ID: " + engineEvent.getSubScopeId());
System.out.println("ProcessInstanceId: " + engineEvent.getProcessInstanceId());
System.out.println("ProcessDefinitionId: " + engineEvent.getProcessDefinitionId());
System.out.println("ExecutionId: " + engineEvent.getExecutionId());
...
All the possible ids are always the same for a complete process run.
flowable-rest-1 | Event name: ACTIVITY_STARTED
flowable-rest-1 | Scope ID: ffee03d6-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | Scope Definition ID: ff247244-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | Sub Scope ID: fff0c308-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | ProcessInstanceId: ffee03d6-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | ProcessDefinitionId: ff247244-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | Event name: ACTIVITY_COMPLETED
flowable-rest-1 | Scope ID: ffee03d6-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | Scope Definition ID: ff247244-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | Sub Scope ID: fff0c308-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | ProcessInstanceId: ffee03d6-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | ProcessDefinitionId: ff247244-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | Activity ID for started activity: output_fo_ed227980_b234_4fb5_98a3_ed44ae821e77
flowable-rest-1 | Event name: ACTIVITY_STARTED
flowable-rest-1 | Scope ID: ffee03d6-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | Scope Definition ID: ff247244-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | Sub Scope ID: fff0c308-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | ProcessInstanceId: ffee03d6-571a-11f0-bb84-661101dc1f65
flowable-rest-1 | ProcessDefinitionId: ff247244-571a-11f0-bb84-661101dc1f65
I expected that the first and the last ACTIVITY_STARTED event should have any class method with this unique id. I can not believe, that there is not such a field in this class. What am is missing?