use of org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway in project kie-wb-common by kiegroup.
the class InclusiveGatewayTest method testUnmarshallTopLevelEmptyGatewayProperties.
@Test
public void testUnmarshallTopLevelEmptyGatewayProperties() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_INCLUSIVE_GATEWAY_FILE_PATH);
assertDiagram(diagram, DIAGRAM_NODE_SIZE);
InclusiveGateway filledTopLevelGateway = getGatewayNodeById(diagram, EMPTY_TOP_LEVEL_GATEWAY_ID, getGatewayNodeType());
assertGeneralSet(filledTopLevelGateway.getGeneral(), EMPTY, EMPTY);
assertGatewayExecutionSet(filledTopLevelGateway.getExecutionSet(), null);
}
use of org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway in project kie-wb-common by kiegroup.
the class InclusiveGatewayTest method testUnmarshallSubprocessLevelGatewayFilledProperties.
@Test
public void testUnmarshallSubprocessLevelGatewayFilledProperties() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_INCLUSIVE_GATEWAY_FILE_PATH);
assertDiagram(diagram, DIAGRAM_NODE_SIZE);
InclusiveGateway filledTopLevelGateway = getGatewayNodeById(diagram, FILLED_SUBPROCESS_LEVEL_GATEWAY_ID, getGatewayNodeType());
assertGeneralSet(filledTopLevelGateway.getGeneral(), NAME, DOCUMENTATION);
assertGatewayExecutionSet(filledTopLevelGateway.getExecutionSet(), DEFAULT_ROUTE_SUBPROCESS_LEVEL_ID);
}
use of org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallInclusiveGateway.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallInclusiveGateway() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INCLUSIVE_GATEWAY);
assertDiagram(diagram, 7);
assertEquals(diagram.getMetadata().getTitle(), "TestInclusiveGateway");
Graph graph = diagram.getGraph();
Node<? extends Definition, ?> gatewayNode = graph.getNode("_526EE472-FE8B-4E9A-A951-CFBA86C3691F");
assertTrue(gatewayNode.getContent().getDefinition() instanceof InclusiveGateway);
InclusiveGateway inclusiveGateway = (InclusiveGateway) gatewayNode.getContent().getDefinition();
assertEquals("InclusiveGatewayName", inclusiveGateway.getGeneral().getName().getValue());
assertEquals("_3D5701E9-CFD3-4218-9200-897B6D4FF041", inclusiveGateway.getExecutionSet().getDefaultRoute().getValue());
SequenceFlow sequenceFlow1 = null;
SequenceFlow sequenceFlow2 = null;
List<Edge> outEdges = (List<Edge>) gatewayNode.getOutEdges();
if (outEdges != null) {
for (Edge edge : outEdges) {
if ("_3D5701E9-CFD3-4218-9200-897B6D4FF041".equals(edge.getUUID())) {
sequenceFlow1 = (SequenceFlow) ((ViewConnector) edge.getContent()).getDefinition();
} else if ("_A414F16D-90BB-4742-A4E7-EBF7EA1ECD7E".equals(edge.getUUID())) {
sequenceFlow2 = (SequenceFlow) ((ViewConnector) edge.getContent()).getDefinition();
}
}
}
assertNotNull(sequenceFlow1);
assertEquals("OutSequence1", sequenceFlow1.getGeneral().getName().getValue());
assertNotNull(sequenceFlow2);
assertEquals("OutSequence2", sequenceFlow2.getGeneral().getName().getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway in project kie-wb-common by kiegroup.
the class InclusiveGatewayTest method testUnmarshallTopLevelGatewayFilledProperties.
@Test
public void testUnmarshallTopLevelGatewayFilledProperties() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_INCLUSIVE_GATEWAY_FILE_PATH);
assertDiagram(diagram, DIAGRAM_NODE_SIZE);
InclusiveGateway filledTopLevelGateway = getGatewayNodeById(diagram, FILLED_TOP_LEVEL_GATEWAY_ID, getGatewayNodeType());
assertGeneralSet(filledTopLevelGateway.getGeneral(), NAME, DOCUMENTATION);
assertGatewayExecutionSet(filledTopLevelGateway.getExecutionSet(), DEFAULT_ROUTE_TOP_LEVEL_ID);
}
use of org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway in project kie-wb-common by kiegroup.
the class InclusiveGatewayTest method testUnmarshallSubprocessLevelGatewayEmptyProperties.
@Test
public void testUnmarshallSubprocessLevelGatewayEmptyProperties() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_INCLUSIVE_GATEWAY_FILE_PATH);
assertDiagram(diagram, DIAGRAM_NODE_SIZE);
InclusiveGateway filledTopLevelGateway = getGatewayNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_GATEWAY_ID, getGatewayNodeType());
assertGeneralSet(filledTopLevelGateway.getGeneral(), EMPTY, EMPTY);
assertGatewayExecutionSet(filledTopLevelGateway.getExecutionSet(), null);
}
Aggregations