EventListener in StartEvent fetches to processInstanceId NULL ProcessInstance

PROBLEM-1: In ExecutionListener by start event: for processInstaceId : there is no ProcessInstance

@Component
@Slf4j
public class MyDelegate implements ExecutionListener {

@Override
public void notify(DelegateExecution delegateExecution) throws Exception {

    DelegateExecution processInstance = delegateExecution.getProcessInstance();
    **callSomething**(delegateExecution.getProcessInstanceId());
}

** callSomething calling then : // a component with runtimeService**

private ProcessInstance getProcessInstanceForId(String processInstanceId) {
    return runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); // .active() ??
}

getProcessDefinitionForPi (…) delivers null for existing processInstanceId !!!

PROBLEM-2: Timer does not fire … Why ?

PT1M = Duration / after claim ?

See: Boundary Timer > Event_0dxwk3k // Warn after 1 Minute /Test

P5_Anonym.bpmn (14.4 KB)


TA_Timer_Test.bpmn (17.0 KB)

problem solved !!!
It was a wrong property in application.yaml:
job-execution:
enabled: false // must be true

Spring Boot Initilizer for Camunda set a false (if am not mistaken)

  1. Execution Listener + Timer requires System Threads (Camunda Jobs).
  2. But it is also important to set in start event “before” to persist a state (ProcessInstance) to camunda DB !

correct config for spring boot are:

SEE: Process Engine Configuration | docs.camunda.org

camunda:
bpm:
admin-user:
id: demo
password: demo
lastName: DemoAdmin
filter:
create: All Tasks
job-execution:
enabled: true
default-number-of-retries: 3

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.