}
// TODO: this whole block can be removed after SWITCHYARD-1584
if (!registeredNames.contains(HUMAN_TASK) && runtimeManager != null) {
RuntimeEngine runtimeEngine = runtimeManager.getRuntimeEngine(null);
ExternalTaskEventListener listener = new ExternalTaskEventListener();
LocalHTWorkItemHandler htwih = new LocalHTWorkItemHandler();
htwih.setRuntimeManager(runtimeManager);
// NOTE: Cannot remove next two blocks for SWITCHYARD-1755 yet...
if (runtimeEngine.getTaskService() instanceof EventService) {
((EventService)runtimeEngine.getTaskService()).registerTaskEventListener(listener);
}
if (processRuntime instanceof Disposable) {