public EscalationEventExecutionSet() { this(new EscalationRef()); }
@Override public Function<Node, Pair<Object, String>> getMapper() { return node -> { EscalationRef escalationRef = null; if (startEscalationEventsFilter.test(node)) { escalationRef = ((StartEscalationEvent) ((View) node.getContent()).getDefinition()).getExecutionSet().getEscalationRef(); } else if (intermediateCatchingEscalationEventsFilter.test(node)) { escalationRef = ((IntermediateEscalationEvent) ((View) node.getContent()).getDefinition()).getExecutionSet().getEscalationRef(); } else if (intermediateThrowingEscalationEventsFilter.test(node)) { escalationRef = ((IntermediateEscalationEventThrowing) ((View) node.getContent()).getDefinition()).getExecutionSet().getEscalationRef(); } else if (endEscalationEventsFilter.test(node)) { escalationRef = ((EndEscalationEvent) ((View) node.getContent()).getDefinition()).getExecutionSet().getEscalationRef(); } if (escalationRef != null && escalationRef.getValue() != null && !escalationRef.getValue().isEmpty()) { return new Pair<>(escalationRef.getValue(), escalationRef.getValue(), Pair.PairEqualsMode.K1); } else { return null; } }; } }
public void addEscalation(EscalationRef escalationRef) { EscalationEventDefinition escalationEventDefinition = bpmn2.createEscalationEventDefinition(); addEventDefinition(escalationEventDefinition); Escalation escalation = bpmn2.createEscalation(); String escalationCode = escalationRef.getValue(); if (escalationCode == null || escalationCode.isEmpty()) { return; } escalation.setId(Ids.fromString(escalationCode)); escalation.setEscalationCode(escalationCode); escalationEventDefinition.setEscalationRef(escalation); CustomAttribute.esccode.of(escalationEventDefinition).set(escalationCode); addRootElement(escalation); }
public CancellingEscalationEventExecutionSet() { this(new CancelActivity(true), new EscalationRef()); }
private void assertEscalationEventExecutionSet(EscalationEventExecutionSet executionSet, String escalationRef) { assertNotNull(executionSet); assertNotNull(executionSet.getEscalationRef()); assertEquals(escalationRef, executionSet.getEscalationRef().getValue()); } }
public InterruptingEscalationEventExecutionSet() { this(new IsInterrupting(true), new EscalationRef()); }
private void assertEscalationEventExecutionSet(EscalationEventExecutionSet executionSet, String eventReference) { assertNotNull(executionSet); assertNotNull(executionSet.getEscalationRef()); assertEquals(eventReference, executionSet.getEscalationRef().getValue()); } }
@Test public void testEscalationRefEqualsAndHashCode() { TestCaseBuilder.newTestCase() .addTrueCase(new EscalationRef(), new EscalationRef()) .addTrueCase(new EscalationRef("ref"), new EscalationRef("ref")) .addTrueCase(new EscalationRef(null), new EscalationRef(null)) .addFalseCase(new EscalationRef("ref"), null) .addFalseCase(new EscalationRef("ref"), new EscalationRef("ref1")) .test(); }
private void assertEscalationEventExecutionSet(CancellingEscalationEventExecutionSet executionSet, String escalationRef, boolean isCancelling) { assertNotNull(executionSet); assertNotNull(executionSet.getEscalationRef()); assertNotNull(executionSet.getCancelActivity()); assertEquals(escalationRef, executionSet.getEscalationRef().getValue()); assertEquals(isCancelling, executionSet.getCancelActivity().getValue()); } }
@Test public void testEscalationEventExecutionSetEqualsAndHashCode() { String ESCALATION_REF = "ESCALATION_REF"; String ESCALATION_REF_1 = "ESCALATION_REF_1"; TestCaseBuilder.newTestCase() .addTrueCase(new EscalationEventExecutionSet(), new EscalationEventExecutionSet()) .addTrueCase(new EscalationEventExecutionSet(new EscalationRef()), new EscalationEventExecutionSet(new EscalationRef())) .addTrueCase(new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF))) .addFalseCase(new EscalationEventExecutionSet(), null) .addFalseCase(new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF_1))) .test(); }
private void assertEscalationEventExecutionSet(CancellingEscalationEventExecutionSet executionSet, String escalationRef, boolean isCancelling) { assertNotNull(executionSet); assertNotNull(executionSet.getEscalationRef()); assertNotNull(executionSet.getCancelActivity()); assertEquals(escalationRef, executionSet.getEscalationRef().getValue()); assertEquals(isCancelling, executionSet.getCancelActivity().getValue()); } }
@Test public void testInterruptingEscalationEventExecutionSetEqualsAndHashCode() { String ESCALATION_REF = "ESCALATION_REF"; String ESCALATION_REF_1 = "ESCALATION_REF_1"; TestCaseBuilder.newTestCase() .addTrueCase(new InterruptingEscalationEventExecutionSet(), new InterruptingEscalationEventExecutionSet()) .addTrueCase(new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef()), new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef())) .addTrueCase(new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef(ESCALATION_REF)), new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef(ESCALATION_REF))) .addFalseCase(new InterruptingEscalationEventExecutionSet(), null) .addFalseCase(new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef(ESCALATION_REF)), new InterruptingEscalationEventExecutionSet(new IsInterrupting(true), new EscalationRef(ESCALATION_REF))) .addFalseCase(new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef(ESCALATION_REF)), new InterruptingEscalationEventExecutionSet(new IsInterrupting(false), new EscalationRef(ESCALATION_REF_1))) .test(); }
private void assertEscalationEventExecutionSet(InterruptingEscalationEventExecutionSet executionSet, String escalationRef, boolean isInterrupting) { assertNotNull(executionSet); assertNotNull(executionSet.getEscalationRef()); assertNotNull(executionSet.getIsInterrupting()); assertEquals(escalationRef, executionSet.getEscalationRef().getValue()); assertEquals(isInterrupting, executionSet.getIsInterrupting().getValue()); } }
@Test public void testCancellingEscalationEventExecutionSetEqualsAndHashCode() { String ESCALATION_REF = "ESCALATION_REF"; String ESCALATION_REF_1 = "ESCALATION_REF_1"; TestCaseBuilder.newTestCase() .addTrueCase(new CancellingEscalationEventExecutionSet(), new CancellingEscalationEventExecutionSet()) .addTrueCase(new CancellingEscalationEventExecutionSet(new CancelActivity(false), new EscalationRef()), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new EscalationRef())) .addTrueCase(new CancellingEscalationEventExecutionSet(new CancelActivity(false), new EscalationRef(ESCALATION_REF)), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new EscalationRef(ESCALATION_REF))) .addFalseCase(new CancellingEscalationEventExecutionSet(), null) .addFalseCase(new CancellingEscalationEventExecutionSet(new CancelActivity(false), new EscalationRef(ESCALATION_REF)), new CancellingEscalationEventExecutionSet(new CancelActivity(true), new EscalationRef(ESCALATION_REF))) .addFalseCase(new CancellingEscalationEventExecutionSet(new CancelActivity(false), new EscalationRef(ESCALATION_REF)), new CancellingEscalationEventExecutionSet(new CancelActivity(false), new EscalationRef(ESCALATION_REF_1))) .test(); }
@Test @SuppressWarnings("unchecked") public void testUnmarshallEndEscalationEvent() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDESCALATIONEVENT); assertDiagram(diagram, 2); assertEquals("EndEscalationEvent", diagram.getMetadata().getTitle()); Node<? extends Definition, ?> endEventNode = diagram.getGraph().getNode("_8F6A4096-26AA-4C14-B1F0-B96ED24BD5C7"); assertNotNull(endEventNode); EndEscalationEvent endEscalationEvent = (EndEscalationEvent) endEventNode.getContent().getDefinition(); assertNotNull(endEscalationEvent.getGeneral()); assertEquals("EndEscalationEventName", endEscalationEvent.getGeneral().getName().getValue()); assertEquals("EndEscalationEventDocumentation", endEscalationEvent.getGeneral().getDocumentation().getValue()); assertNotNull(endEscalationEvent.getExecutionSet()); assertEquals("EscalationCode", endEscalationEvent.getExecutionSet().getEscalationRef().getValue()); DataIOSet dataIOSet = endEscalationEvent.getDataIOSet(); AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo(); assertEquals("escalationInput:String||||[din]processVar1->escalationInput", assignmentsInfo.getValue()); }
private BpmnNode escalationEventDefinition(EndEvent event, EscalationEventDefinition e) { Node<View<EndEscalationEvent>, Edge> node = factoryManager.newNode(event.getId(), EndEscalationEvent.class); EndEscalationEvent definition = node.getContent().getDefinition(); EventPropertyReader p = propertyReaderFactory.of(event); definition.setGeneral(new BPMNGeneralSet( new Name(p.getName()), new Documentation(p.getDocumentation()) )); definition.setDataIOSet(new DataIOSet( p.getAssignmentsInfo() )); definition.setExecutionSet(new EscalationEventExecutionSet( new EscalationRef(EventDefinitionReader.escalationRefOf(e)) )); node.getContent().setBounds(p.getBounds()); definition.setDimensionsSet(p.getCircleDimensionSet()); definition.setFontSet(p.getFontSet()); definition.setBackgroundSet(p.getBackgroundSet()); return BpmnNode.of(node); }
@Test @SuppressWarnings("unchecked") public void testUnmarshallIntermediateEscalationEventThrowing() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_ESCALATION_EVENTTHROWING); assertDiagram(diagram, 2); assertEquals("IntermediateEscalationEventThrowing", diagram.getMetadata().getTitle()); Node<? extends Definition, ?> throwingEventNode = diagram.getGraph().getNode("_8516D854-F67F-4697-9837-40A32033AE25"); assertNotNull(throwingEventNode); IntermediateEscalationEventThrowing throwingEscalationEvent = (IntermediateEscalationEventThrowing) throwingEventNode.getContent().getDefinition(); assertNotNull(throwingEscalationEvent.getGeneral()); assertEquals("ThrowingEscalationEventName", throwingEscalationEvent.getGeneral().getName().getValue()); assertEquals("ThrowingEscalationEventDocumentation", throwingEscalationEvent.getGeneral().getDocumentation().getValue()); assertNotNull(throwingEscalationEvent.getExecutionSet()); assertEquals("EscalationCode", throwingEscalationEvent.getExecutionSet().getEscalationRef().getValue()); DataIOSet dataIOSet = throwingEscalationEvent.getDataIOSet(); AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo(); assertEquals("escalationOutput:String||||[din]processVar1->escalationOutput", assignmentsInfo.getValue()); }
private BpmnNode escalationEvent( IntermediateThrowEvent event, EscalationEventDefinition eventDefinition) { Node<View<IntermediateEscalationEventThrowing>, Edge> node = factoryManager.newNode(event.getId(), IntermediateEscalationEventThrowing.class); IntermediateEscalationEventThrowing definition = node.getContent().getDefinition(); EventPropertyReader p = propertyReaderFactory.of(event); definition.setGeneral(new BPMNGeneralSet( new Name(p.getName()), new Documentation(p.getDocumentation()) )); definition.setDataIOSet(new DataIOSet( p.getAssignmentsInfo() )); definition.setExecutionSet(new EscalationEventExecutionSet( new EscalationRef(EventDefinitionReader.escalationRefOf(eventDefinition)) )); node.getContent().setBounds(p.getBounds()); definition.setDimensionsSet(p.getCircleDimensionSet()); definition.setFontSet(p.getFontSet()); definition.setBackgroundSet(p.getBackgroundSet()); return BpmnNode.of(node); }
@Test @SuppressWarnings("unchecked") public void testUnmarshallEndEscalationEvent() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDESCALATIONEVENT); assertDiagram(diagram, 2); assertEquals("EndEscalationEvent", diagram.getMetadata().getTitle()); Node<? extends Definition, ?> endEventNode = diagram.getGraph().getNode("_8F6A4096-26AA-4C14-B1F0-B96ED24BD5C7"); assertNotNull(endEventNode); EndEscalationEvent endEscalationEvent = (EndEscalationEvent) endEventNode.getContent().getDefinition(); assertNotNull(endEscalationEvent.getGeneral()); assertEquals("EndEscalationEventName", endEscalationEvent.getGeneral().getName().getValue()); assertEquals("EndEscalationEventDocumentation", endEscalationEvent.getGeneral().getDocumentation().getValue()); assertNotNull(endEscalationEvent.getExecutionSet()); assertEquals("EscalationCode", endEscalationEvent.getExecutionSet().getEscalationRef().getValue()); DataIOSet dataIOSet = endEscalationEvent.getDataIOSet(); AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo(); assertEquals("escalationInput:String||||[din]processVar1->escalationInput", assignmentsInfo.getValue()); }
private BpmnNode escalationEvent(CatchEvent event, EscalationEventDefinition e) { String nodeId = event.getId(); Node<View<IntermediateEscalationEvent>, Edge> node = factoryManager.newNode(nodeId, IntermediateEscalationEvent.class); IntermediateEscalationEvent definition = node.getContent().getDefinition(); CatchEventPropertyReader p = propertyReaderFactory.of(event); definition.setGeneral(new BPMNGeneralSet( new Name(p.getName()), new Documentation(p.getDocumentation()) )); definition.setDataIOSet( new DataIOSet(p.getAssignmentsInfo())); definition.setExecutionSet(new CancellingEscalationEventExecutionSet( new CancelActivity(p.isCancelActivity()), new EscalationRef(EventDefinitionReader.escalationRefOf(e)) )); node.getContent().setBounds(p.getBounds()); definition.setDimensionsSet(p.getCircleDimensionSet()); definition.setFontSet(p.getFontSet()); definition.setBackgroundSet(p.getBackgroundSet()); return BpmnNode.of(node); }