camunda-platform-7-reactor icon indicating copy to clipboard operation
camunda-platform-7-reactor copied to clipboard

Duplicate events fired when an error boundary is attached

Open juja0 opened this issue 3 years ago • 1 comments

Reactor listeners seem to be called twice when error boundaries are attached (on a service task for example).

This seems to be because the class RegisterAllBpmnParseListener adds execution listeners on both 'parseBoundaryErrorEventDefinition' and 'parseServiceTask' but since both parse* methods will be called on the same activity, the same listener instance is attached twice.

There could be other scenarios where duplicates can be attached since there are other parseBoundary* methods on the listener so I think it's reasonable to perform a check to see if reactor listener is already registered before registering. Right now, we just add the listener without any checks by calling activity.addListener. I would be happy to submit a PR but wanted to discuss and agree on an approach before doing so.

juja0 avatar Sep 26 '21 16:09 juja0

happening for message event as well, its "start" and "end" gets triggered twice

007souvikdas avatar Oct 18 '21 13:10 007souvikdas