use of org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway in project kie-wb-common by kiegroup.
the class GatewayConverter method inclusive.
private PropertyWriter inclusive(Node<View<InclusiveGateway>, ?> n) {
GatewayPropertyWriter p = propertyWriterFactory.of(bpmn2.createInclusiveGateway());
p.setId(n.getUUID());
InclusiveGateway definition = n.getContent().getDefinition();
p.setGatewayDirection(n);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
GatewayExecutionSet executionSet = definition.getExecutionSet();
p.setDefaultRoute(executionSet.getDefaultRoute().getValue());
p.setAbsoluteBounds(n);
return p;
}
use of org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway in project kie-wb-common by kiegroup.
the class InclusiveGatewayTest method testInclusiveDatabasedGatewayExecutionSet.
@Test
public void testInclusiveDatabasedGatewayExecutionSet() {
InclusiveGateway inclusiveGateway = new InclusiveGateway();
inclusiveGateway.setExecutionSet(new GatewayExecutionSet());
Set<ConstraintViolation<InclusiveGateway>> violations = this.validator.validate(inclusiveGateway);
assertTrue(violations.isEmpty());
}
use of org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway in project kie-wb-common by kiegroup.
the class GatewayConverterTest method testInclusive.
@Test
public void testInclusive() {
InclusiveGateway gateway = new InclusiveGateway();
gateway.getGeneral().getName().setValue(NAME);
gateway.getGeneral().getDocumentation().setValue(DOCUMENTATION);
gateway.getExecutionSet().getDefaultRoute().setValue(DEFAULT_ROUTE);
Node<View<BaseGateway>, ?> node = newNode(UUID, gateway);
when(propertyWriterFactory.of(any(org.eclipse.bpmn2.InclusiveGateway.class))).thenReturn(gatewayPropertyWriter);
assertEquals(gatewayPropertyWriter, converter.toFlowElement(node));
verifyCommonValues(gatewayPropertyWriter, node);
verify(gatewayPropertyWriter).setDefaultRoute(DEFAULT_ROUTE);
verify(gatewayPropertyWriter).setGatewayDirection(node);
}
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);
}
Aggregations