CatchEvent and ThrowEvent Interfaces

Hello Camunda Developers,

I’ve stomped twice with this little problem so I decided to share it with you.

Both CatchEvent and ThrowEvent interfaces extend from the Event interface. All event types extend either from CatchEvent (IntermediateCatchEvent, BoundaryEvent and StartEvent) or ThrowEvent (IntermediateThrowEvent, EndEvent).

The thing that bugs me is that the methods getEventDefinitions() and getEventDefinitionsRef() are implemented in both sub-interfaces but not in the Event interface, which leads me to write my code twice to handle anything related to EventDefinitions.

So my proposal is simply to move those 2 methods to the Event interface.

Regards,
Gonzalo.

1 Like

Giving context why it is the way it is: This is how it is defined in the BPMN meta model.

That does not mean we can change this, though. Feel free to raise a JIRA issue and/or submit a pull request. We have to keep in mind that the interfaces must be binary backwards compatible, so perhaps we can only duplicate those methods instead of moving them.

Cheers,
Thorben