I’m trying to add a listener into an activity:
bpmn:
<bpmn:businessRuleTask id="Activity_1ahbexe" name="Validate Through DMN" camunda:resultVariable="results" camunda:decisionRef="my-dmn-inputs">
<bpmn:extensionElements>
<camunda:executionListener delegateExpression="${myListener}" event="start" />
</bpmn:extensionElements>
<bpmn:incoming>Flow_5hwkjn1</bpmn:incoming>
<bpmn:outgoing>Flow_9vkk3q2</bpmn:outgoing>
</bpmn:businessRuleTask>
And I have a execution listener bean as well:
@Component("myListener")
public class MyListener implements ExecutionListener {
@Override
public void notify(DelegateExecution delegateExecution) throws Exception {
System.out.println(delegateExecution);
}
}
But I don’t know why it’s not triggering the listener (I’ve put a breakpoint on sysout)
I’m using spring boot and invoking the camunda process through integration test.
Am I missing a config?
Thanks in advance
@Fabio_Gomes_Sakiyama Can you upload your bpmn file?
How do you deploy your bpmn file? Through modeler or rest api or packaged with application itself(auto-deployment)?
-
If you added the listener after deploying the bpmn model then server restart is required.
-
Also check if there are any incidents raised.
-
Sys.out statements won’t write logs in log file by logging framework. It’s just console logging.
-
And make sure the bpmn model deployed to right node if it’s heterogeneous cluster setup.
-
Make sure that job executor is enabled if the activity is marked for async execution.
Hi @aravindhrs, thanks for the reply!
I updated the answer with the bpmn part that I’m working on.
Also, I’m not deploying anywhere, just using a spring boot web integration test (which calls camunda process). It works with JavaDelegates for example.
Sys.out statements won’t write logs in log file by logging framework. It’s just console logging.
The sysout is just to put a breakpoint and see if the code reachs there.
Make sure that job executor is enabled if the activity is marked for async execution.
There’s no async execution.
I could make it work with @EventListener, but I wonder why with ExecutionListener is not working.