@Test public void add_taskListeners_to_already_existin_listeners() { final TaskDefinition taskDefinition = new TaskDefinition(mock(TaskFormHandler.class)); final TaskListener taskListenerFromBpmn = mock(TaskListener.class); taskDefinition.addTaskListener(EVENTNAME_ASSIGNMENT, taskListenerFromBpmn); taskDefinition.addTaskListener(EVENTNAME_COMPLETE, taskListenerFromBpmn); taskDefinition.addTaskListener(EVENTNAME_CREATE, taskListenerFromBpmn); taskDefinition.addTaskListener(EVENTNAME_DELETE, taskListenerFromBpmn); parseListener.addTaskListener(taskDefinition); assertThat(taskDefinition.getTaskListeners()).hasSize(4); assertThat(taskDefinition.getTaskListeners(EVENTNAME_ASSIGNMENT)).containsExactly(taskListenerFromBpmn, taskListener); assertThat(taskDefinition.getTaskListeners(EVENTNAME_COMPLETE)).containsExactly(taskListenerFromBpmn, taskListener); assertThat(taskDefinition.getTaskListeners(EVENTNAME_CREATE)).containsExactly(taskListenerFromBpmn, taskListener); assertThat(taskDefinition.getTaskListeners(EVENTNAME_DELETE)).containsExactly(taskListenerFromBpmn, taskListener); }
void addTaskListener(final TaskDefinition taskDefinition) { if(reactorListenerFirstOnUserTask) { taskDefinition.setTaskListeners(reactorListenerFirstMap(taskDefinition.getTaskListeners(), TASK_EVENTS, taskListener)); } else { for (final String event : TASK_EVENTS) { taskDefinition.addTaskListener(event, taskListener); } } }
RegisterAllBpmnParseListener extends AbstractBpmnParseListener { void addTaskListener(final TaskDefinition taskDefinition) { if(reactorListenerFirstOnUserTask) { taskDefinition.setTaskListeners(reactorListenerFirstMap(taskDefinition.getTaskListeners(), TASK_EVENTS, taskListener)); } else { for (final String event : TASK_EVENTS) { taskDefinition.addTaskListener(event, taskListener); } } } }
RegisterAllBpmnParseListener extends AbstractBpmnParseListener { void addTaskListener(final TaskDefinition taskDefinition) { if(reactorListenerFirstOnUserTask) { taskDefinition.setTaskListeners(reactorListenerFirstMap(taskDefinition.getTaskListeners(), TASK_EVENTS, taskListener)); } else { for (final String event : TASK_EVENTS) { taskDefinition.addTaskListener(event, taskListener); } } } RegisterAllBpmnParseListener(final TaskListener taskListener, final ExecutionListener executionListener, final boolean reactorListenerFirstOnUserTask); }
RegisterAllBpmnParseListener extends AbstractBpmnParseListener { void addTaskListener(final TaskDefinition taskDefinition) { if(reactorListenerFirstOnUserTask) { taskDefinition.setTaskListeners(reactorListenerFirstMap(taskDefinition.getTaskListeners(), TASK_EVENTS, taskListener)); } else { for (final String event : TASK_EVENTS) { taskDefinition.addTaskListener(event, taskListener); } } } RegisterAllBpmnParseListener(final TaskListener taskListener, final ExecutionListener executionListener, final boolean reactorListenerFirstOnUserTask); @Override void parseUserTask(final Element userTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseBoundaryErrorEventDefinition(final Element errorEventDefinition, final boolean interrupting, final ActivityImpl activity, final ActivityImpl nestedErrorEventActivity); @Override void parseBoundaryEvent(final Element boundaryEventElement, final ScopeImpl scopeElement, final ActivityImpl activity); @Override void parseBoundaryMessageEventDefinition(final Element element, final boolean interrupting, final ActivityImpl activity); @Override void parseBoundarySignalEventDefinition(final Element signalEventDefinition, final boolean interrupting, final ActivityImpl activity); @Override void parseBoundaryTimerEventDefinition(final Element timerEventDefinition, final boolean interrupting, final ActivityImpl activity); @Override void parseBusinessRuleTask(final Element businessRuleTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseCallActivity(final Element callActivityElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseCompensateEventDefinition(final Element compensateEventDefinition, final ActivityImpl activity); @Override void parseEndEvent(final Element endEventElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseEventBasedGateway(final Element eventBasedGwElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseExclusiveGateway(final Element exclusiveGwElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseInclusiveGateway(final Element inclusiveGwElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseIntermediateCatchEvent(final Element intermediateEventElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseIntermediateMessageCatchEventDefinition(final Element messageEventDefinition, final ActivityImpl activity); @Override void parseIntermediateSignalCatchEventDefinition(final Element signalEventDefinition, final ActivityImpl activity); @Override void parseIntermediateThrowEvent(final Element intermediateEventElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseIntermediateTimerEventDefinition(final Element timerEventDefinition, final ActivityImpl activity); @Override void parseManualTask(final Element manualTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseMultiInstanceLoopCharacteristics(final Element activityElement, final Element multiInstanceLoopCharacteristicsElement, final ActivityImpl activity); @Override void parseParallelGateway(final Element parallelGwElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseProcess(final Element processElement, final ProcessDefinitionEntity processDefinition); @Override void parseReceiveTask(final Element receiveTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseScriptTask(final Element scriptTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseSendTask(final Element sendTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseSequenceFlow(final Element sequenceFlowElement, final ScopeImpl scopeElement, final TransitionImpl transition); @Override void parseServiceTask(final Element serviceTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseStartEvent(final Element startEventElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseSubProcess(final Element subProcessElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseTask(final Element taskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseTransaction(final Element transactionElement, final ScopeImpl scope, final ActivityImpl activity); }
RegisterAllBpmnParseListener extends AbstractBpmnParseListener { void addTaskListener(final TaskDefinition taskDefinition) { if(reactorListenerFirstOnUserTask) { taskDefinition.setTaskListeners(reactorListenerFirstMap(taskDefinition.getTaskListeners(), TASK_EVENTS, taskListener)); } else { for (final String event : TASK_EVENTS) { taskDefinition.addTaskListener(event, taskListener); } } } RegisterAllBpmnParseListener(final TaskListener taskListener, final ExecutionListener executionListener, final boolean reactorListenerFirstOnUserTask); @Override void parseUserTask(final Element userTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseBoundaryErrorEventDefinition(final Element errorEventDefinition, final boolean interrupting, final ActivityImpl activity, final ActivityImpl nestedErrorEventActivity); @Override void parseBoundaryEvent(final Element boundaryEventElement, final ScopeImpl scopeElement, final ActivityImpl activity); @Override void parseBoundaryMessageEventDefinition(final Element element, final boolean interrupting, final ActivityImpl activity); @Override void parseBoundarySignalEventDefinition(final Element signalEventDefinition, final boolean interrupting, final ActivityImpl activity); @Override void parseBoundaryTimerEventDefinition(final Element timerEventDefinition, final boolean interrupting, final ActivityImpl activity); @Override void parseBusinessRuleTask(final Element businessRuleTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseCallActivity(final Element callActivityElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseCompensateEventDefinition(final Element compensateEventDefinition, final ActivityImpl activity); @Override void parseEndEvent(final Element endEventElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseEventBasedGateway(final Element eventBasedGwElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseExclusiveGateway(final Element exclusiveGwElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseInclusiveGateway(final Element inclusiveGwElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseIntermediateCatchEvent(final Element intermediateEventElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseIntermediateMessageCatchEventDefinition(final Element messageEventDefinition, final ActivityImpl activity); @Override void parseIntermediateSignalCatchEventDefinition(final Element signalEventDefinition, final ActivityImpl activity); @Override void parseIntermediateThrowEvent(final Element intermediateEventElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseIntermediateTimerEventDefinition(final Element timerEventDefinition, final ActivityImpl activity); @Override void parseManualTask(final Element manualTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseMultiInstanceLoopCharacteristics(final Element activityElement, final Element multiInstanceLoopCharacteristicsElement, final ActivityImpl activity); @Override void parseParallelGateway(final Element parallelGwElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseProcess(final Element processElement, final ProcessDefinitionEntity processDefinition); @Override void parseReceiveTask(final Element receiveTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseScriptTask(final Element scriptTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseSendTask(final Element sendTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseSequenceFlow(final Element sequenceFlowElement, final ScopeImpl scopeElement, final TransitionImpl transition); @Override void parseServiceTask(final Element serviceTaskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseStartEvent(final Element startEventElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseSubProcess(final Element subProcessElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseTask(final Element taskElement, final ScopeImpl scope, final ActivityImpl activity); @Override void parseTransaction(final Element transactionElement, final ScopeImpl scope, final ActivityImpl activity); static final List<String> TASK_EVENTS; static final List<String> EXECUTION_EVENTS; }