private void assertEscalationEventExecutionSet(EscalationEventExecutionSet executionSet, String eventReference) { assertNotNull(executionSet); assertNotNull(executionSet.getEscalationRef()); assertEquals(eventReference, executionSet.getEscalationRef().getValue()); } }
private void assertEscalationEventExecutionSet(EscalationEventExecutionSet executionSet, String escalationRef) { assertNotNull(executionSet); assertNotNull(executionSet.getEscalationRef()); assertEquals(escalationRef, executionSet.getEscalationRef().getValue()); } }
@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; } }; } }
private PropertyWriter escalationEvent(Node<View<IntermediateEscalationEventThrowing>, ?> n) { IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent(); event.setId(n.getUUID()); IntermediateEscalationEventThrowing definition = n.getContent().getDefinition(); ThrowEventPropertyWriter p = propertyWriterFactory.of(event); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAssignmentsInfo( definition.getDataIOSet().getAssignmentsinfo()); p.addEscalation(definition.getExecutionSet().getEscalationRef()); p.setBounds(n.getContent().getBounds()); return p; }
private PropertyWriter escalationEvent(Node<View<EndEscalationEvent>, ?> n) { EndEvent event = bpmn2.createEndEvent(); event.setId(n.getUUID()); EndEscalationEvent definition = n.getContent().getDefinition(); ThrowEventPropertyWriter p = propertyWriterFactory.of(event); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAssignmentsInfo( definition.getDataIOSet().getAssignmentsinfo()); EscalationEventExecutionSet executionSet = definition.getExecutionSet(); p.addEscalation(executionSet.getEscalationRef()); p.setBounds(n.getContent().getBounds()); return p; }
@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()); }
@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()); }
@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()); }
@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()); }