Search in sources :

Example 1 with InclusiveGateway

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;
}
Also used : InclusiveGateway(org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway) GatewayPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.GatewayPropertyWriter) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) GatewayExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.gateway.GatewayExecutionSet)

Example 2 with InclusiveGateway

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());
}
Also used : InclusiveGateway(org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway) ConstraintViolation(javax.validation.ConstraintViolation) GatewayExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.gateway.GatewayExecutionSet) Test(org.junit.Test)

Example 3 with InclusiveGateway

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);
}
Also used : InclusiveGateway(org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Test(org.junit.Test)

Example 4 with InclusiveGateway

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);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) InclusiveGateway(org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Example 5 with InclusiveGateway

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);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) InclusiveGateway(org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Aggregations

InclusiveGateway (org.kie.workbench.common.stunner.bpmn.definition.InclusiveGateway)15 Test (org.junit.Test)12 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)6 Graph (org.kie.workbench.common.stunner.core.graph.Graph)6 ConstraintViolation (javax.validation.ConstraintViolation)4 GatewayExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.gateway.GatewayExecutionSet)4 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)4 ArrayList (java.util.ArrayList)3 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)3 Edge (org.kie.workbench.common.stunner.core.graph.Edge)3 List (java.util.List)2 SequenceFlow (org.kie.workbench.common.stunner.bpmn.definition.SequenceFlow)2 View (org.kie.workbench.common.stunner.core.graph.content.view.View)2 ViewConnector (org.kie.workbench.common.stunner.core.graph.content.view.ViewConnector)2 LinkedList (java.util.LinkedList)1 Before (org.junit.Before)1 DeclarationList (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.DeclarationList)1 GatewayPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.GatewayPropertyWriter)1 GatewayPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.GatewayPropertyReader)1 ExclusiveGateway (org.kie.workbench.common.stunner.bpmn.definition.ExclusiveGateway)1