For it to work, I set the properties in yml file as below:
camunda.bpm.eventing.execution: true
camunda.bpm.eventing.history: true
camunda.bpm.eventing.task: true
This used to work and I was able to get events as the process execution progressed in camunda.
After this, I configured Process Engine through XML file, camunda.cfg.xml as below. Since I added this config, I no longer get any events on exec of the process. If I remove this file it starts working again. What am I missing here?
On the execution event stream, DelegateExecution s (mutable) and ExecutionEvent s (immutable) can be received. The task event stream offers DelegateTask s (mutable) and TaskEvent s (immutable). On the history event stream, only HistoryEvent s (mutable) are published.
@Slf4j
@Component
public class CamundaEventListeners {
@EventListener
public void onTaskEvent(DelegateTask taskDelegate) {
log.info("Handling mutable DelegateTask:{}", taskDelegate.getTaskDefinitionKey());
}
@EventListener
public void onTaskEvent(TaskEvent taskEvent) {
log.info("Handling immutable TaskEvent:{}", taskEvent.getTaskDefinitionKey());
}
@EventListener
public void onExecutionEvent(DelegateExecution executionDelegate) {
log.info("Handling mutable DelegateExecution:{}", executionDelegate.getCurrentActivityName());
}
@EventListener
public void onExecutionEvent(ExecutionEvent executionEvent) {
log.info("Handling immutable ExecutionEvent:{}", executionEvent.getProcessDefinitionId());
}
@EventListener
public void onHistoryEvent(HistoryEvent historyEvent) {
log.info("Handling mutable HistoryEvent:{}", historyEvent.getEventType());
}
}
Verify the below logs (line 2 & 3 for onExecutionEvent() ):
@aravindhrs Thanks, yes the events work when I don’t have the camunda.cfg.xml file, but I also would like to attach a listener when a bpmn is parsed on deployment. For this, I need to add a plugin and configuration in cfg.xml. Is there a way to achieve both of these functionalities (process event listener, parse listener) without adding the xml file?