// NOTE: Cannot remove next two blocks for SWITCHYARD-1755 yet...
if (runtimeEngine.getTaskService() instanceof EventService) {
((EventService)runtimeEngine.getTaskService()).registerTaskEventListener(listener);
}
if (processRuntime instanceof Disposable) {
((Disposable)processRuntime).addDisposeListener(new DisposeListener() {
@Override
public void onDispose(RuntimeEngine re) {
if (re.getTaskService() instanceof EventService) {
((EventService)re.getTaskService()).clearTaskEventListeners();
}