Add execution listeners in parse listener - confusing deprecation

When I create a parse listener to add execution listeners, the addExexcutionListener method is deprecated, unfortunately without any hint which method to use instead (would be nice to always add this hint whenever something is deprecated!).

There is an addBuiltInListener method - also used internally. But there is not Javadoc and I have no idea what the “built in” means here. Can you enlighten me?

Thanks
Bernd

public class MyParseListener extends AbstractBpmnParseListener implements BpmnParseListener {

  @Override
  public void parseServiceTask(Element serviceTaskElement, ScopeImpl scope, ActivityImpl activity) {
      activity.addExecutionListener(... // deprecated
      activity.addBuiltInListener (...  // used e.g. in HistoryListener, but confused by the name

Thanks
Bernd

Hi Bernd,

Builtin listeners are those that are always executed, even when you specify skipListeners on instance deletion, etc.

Cheers,
Thorben

I think you are supposed to use #addListener instead of #addExecutionListener.

Ah ok. Javadoc would help :slight_smile:

Thanks!

Maybe it would help, if the JavaDoc would state so. Currently it only says Deprecated, without a reference to the new method. Since the new method is additionally inherited it is not really obvious what to use.

Still not in the Javadoc.

Maybe you could open a Pull Request for this addition? That would be awesome :heart: