use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallIntermediateCompensationEventsWithAssociations.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateCompensationEventsWithAssociations() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_COMPENSATION_EVENTS_WITH_ASSOCIATION);
assertDiagram(diagram, 6);
assertEquals("IntermediateCompensationEventsWithAssociation", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> catchingEventNode = diagram.getGraph().getNode("_DF70C614-A641-4109-8A8D-506B15E3F31B");
assertNotNull(catchingEventNode);
IntermediateCompensationEvent intermediateCompensationEvent = (IntermediateCompensationEvent) catchingEventNode.getContent().getDefinition();
assertTrue(GraphUtils.isDockedNode(catchingEventNode));
assertNotNull(intermediateCompensationEvent.getGeneral());
assertEquals("IntermediateCompensationEventName", intermediateCompensationEvent.getGeneral().getName().getValue());
assertEquals("IntermediateCompensationEventDocumentation", intermediateCompensationEvent.getGeneral().getDocumentation().getValue());
assertEquals("12/25/1983", intermediateCompensationEvent.getExecutionSet().getSlaDueDate().getValue());
Node<? extends Definition, ?> userTask1Node = diagram.getGraph().getNode("_C18CC8D2-D7CA-457D-9258-01D1E6973A86");
assertNotNull(userTask1Node);
UserTask userTask1 = (UserTask) userTask1Node.getContent().getDefinition();
assertEquals("Task1", userTask1.getGeneral().getName().getValue());
assertEquals("Task1Documentation", userTask1.getGeneral().getDocumentation().getValue());
assertEquals(userTask1Node, GraphUtils.getDockParent(catchingEventNode).orElse(null));
Node<? extends Definition, ?> userTask2Node = diagram.getGraph().getNode("_7EF24042-BD4E-4843-9874-8AC3F7AFF3CD");
assertNotNull(userTask2Node);
UserTask userTask2 = (UserTask) userTask2Node.getContent().getDefinition();
assertEquals("Task2", userTask2.getGeneral().getName().getValue());
assertEquals("Task2Documentation", userTask2.getGeneral().getDocumentation().getValue());
Edge associationEdge = userTask2Node.getInEdges().stream().filter(edge -> edge.getUUID().equals("_B41D28D1-FC39-40E8-BF89-C57649989014")).map(e -> e.asEdge()).findFirst().orElse(null);
assertNotNull(associationEdge);
assertNotNull(associationEdge.getContent());
Association association = (Association) ((View) associationEdge.getContent()).getDefinition();
assertEquals("AssociationDocumentation", association.getGeneral().getDocumentation().getValue());
assertEquals(associationEdge.getSourceNode(), catchingEventNode);
assertEquals(associationEdge.getTargetNode(), userTask2Node);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent in project kie-wb-common by kiegroup.
the class BoundaryCatchingIntermediateCompensationEventTest method testUnmarshallSubprocessLevelEventEmptyProperties.
@Test
@Override
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception {
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
IntermediateCompensationEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, ZERO_OUTGOING_EDGES);
assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
assertCompensationEventExecutionSet(emptySubprocessEvent.getExecutionSet(), NON_CANCELLING, EMPTY_VALUE);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent in project kie-wb-common by kiegroup.
the class BoundaryCatchingIntermediateCompensationEventTest method testUnmarshallSubprocessLevelEventWithEdgesFilledProperties.
@Test
@Override
public void testUnmarshallSubprocessLevelEventWithEdgesFilledProperties() {
final String EVENT_NAME = "Compensation04\n ~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./";
final String EVENT_DOCUMENTATION = "Compensation04 doc\n ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,./";
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
IntermediateCompensationEvent filledSubprocessEvent = getCatchingIntermediateNodeById(diagram, FILLED_WITH_EDGES_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, TWO_OUTGOING_EDGES);
assertGeneralSet(filledSubprocessEvent.getGeneral(), EVENT_NAME, EVENT_DOCUMENTATION);
assertCompensationEventExecutionSet(filledSubprocessEvent.getExecutionSet(), NON_CANCELLING, SLA_DUE_DATE);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent in project kie-wb-common by kiegroup.
the class BoundaryCatchingIntermediateCompensationEventTest method testUnmarshallTopLevelEventWithEdgesFilledProperties.
@Test
@Override
public void testUnmarshallTopLevelEventWithEdgesFilledProperties() {
final String EVENT_NAME = "Compensation02\n ~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./";
final String EVENT_DOCUMENTATION = "Compensation02 doc\n ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,./";
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
IntermediateCompensationEvent filledSubprocessEvent = getCatchingIntermediateNodeById(diagram, FILLED_WITH_EDGES_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, TWO_OUTGOING_EDGES);
assertGeneralSet(filledSubprocessEvent.getGeneral(), EVENT_NAME, EVENT_DOCUMENTATION);
assertCompensationEventExecutionSet(filledSubprocessEvent.getExecutionSet(), NON_CANCELLING, SLA_DUE_DATE);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent in project kie-wb-common by kiegroup.
the class BoundaryCatchingIntermediateCompensationEventTest method testUnmarshallTopLevelEmptyEventProperties.
@Test
@Override
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception {
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
IntermediateCompensationEvent emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, ZERO_OUTGOING_EDGES);
assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
assertCompensationEventExecutionSet(emptyTopEvent.getExecutionSet(), NON_CANCELLING, EMPTY_VALUE);
}
Aggregations