Catch start of ReceiveTask

Hi,
I want to write a processing engine plugin that will send a message to Kafka when a recieve task start waiting for a message. I have written custom ExecutinListener and registered it in the parseReceiveTask method in ProcessParseListener, which is extends AbstractBpmnParseListener. Registered like that:

@Override
public void parseReceiveTask(Element element, ScopeImpl scope, ActivityImpl activity) {
processDefinition.addListener(ExecutionListener.EVENTNAME_START, new ProcessEventExecutionListener());
}

But the listener doesn’t catch the moment when receive task begins to wait. How can I capture this moment and register the listener correctly?

Thanks

Hi @alice18_49

Welcome to the forum.

Your code adds the execution listener to a variable called “processDefinition”, but it must be added to the argument called “activity” (of type ActivityImpl) that is passed to the parseReceiveTask method.

I Hope helps.

BR
Michael