BPMN Boundary error events with specific error code also catch error events with null error code
Describe the bug A boundary error with errorRef specified (not null), will catch an error event with null errorRef.
Expected behavior Boundary events with specific errorRef should only catch error events with the same error code. The opposite is okay though, a boundary error with null error code should catch all error events.
I am in the process of migrating from Activiti 6 to Flowable 6 and the same workflow process behaves differently in Flowable due to this.
Code This boundary error event with error code "testRef":
<boundaryEvent id="testErrorBoundary" attachedToRef="testSubprocess">
<errorEventDefinition errorRef="testRef"></errorEventDefinition>
</boundaryEvent>
Catches this error event with null error code within "testSubprocess":
<endEvent id="testErrorEnd">
<errorEventDefinition></errorEventDefinition>
</endEvent>
The line in Flowable that causes the issue
As you can see, this can be fixed be removing compareErrorCode == null || from that line. I made a pull request earlier with that change, but ran into some issues with the tests so I cancelled it.
Additional context Version of Flowable: flowable-engine-6.6.1.8 (with flowable-spring)