Search in sources :

Example 1 with MultipleInstanceSubprocess

use of org.kie.workbench.common.stunner.bpmn.definition.MultipleInstanceSubprocess in project kie-wb-common by kiegroup.

the class BPMNDiagramMarshallerTest method testUnmarshallMultipleInstanceSubprocess.

@Test
public void testUnmarshallMultipleInstanceSubprocess() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_MULTIPLE_INSTANCE_SUBPROCESS);
    assertDiagram(diagram, 2);
    assertEquals("MultipleInstanceSubprocess", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> multipleInstanceSubprocessNode = diagram.getGraph().getNode("_2316CEC1-C1F7-41B1-8C91-3CE73ADE5571");
    MultipleInstanceSubprocess multipleInstanceSubprocess = (MultipleInstanceSubprocess) multipleInstanceSubprocessNode.getContent().getDefinition();
    assertEquals("var1", multipleInstanceSubprocess.getExecutionSet().getMultipleInstanceCollectionInput().getValue());
    assertEquals("var2", multipleInstanceSubprocess.getExecutionSet().getMultipleInstanceCollectionOutput().getValue());
    assertEquals("dataInput", multipleInstanceSubprocess.getExecutionSet().getMultipleInstanceDataInput().getValue());
    assertEquals("dataOutput", multipleInstanceSubprocess.getExecutionSet().getMultipleInstanceDataOutput().getValue());
    assertEquals("a=b", multipleInstanceSubprocess.getExecutionSet().getMultipleInstanceCompletionCondition().getValue());
    assertEquals("onEntryAction", multipleInstanceSubprocess.getExecutionSet().getOnEntryAction().getValue().getValues().get(0).getScript());
    assertEquals("java", multipleInstanceSubprocess.getExecutionSet().getOnEntryAction().getValue().getValues().get(0).getLanguage());
    assertEquals("onExitAction", multipleInstanceSubprocess.getExecutionSet().getOnExitAction().getValue().getValues().get(0).getScript());
    assertEquals("java", multipleInstanceSubprocess.getExecutionSet().getOnExitAction().getValue().getValues().get(0).getLanguage());
    assertTrue(multipleInstanceSubprocess.getExecutionSet().getIsAsync().getValue());
    assertEquals("mi-var1:String", multipleInstanceSubprocess.getProcessData().getProcessVariables().getValue());
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) MultipleInstanceSubprocess(org.kie.workbench.common.stunner.bpmn.definition.MultipleInstanceSubprocess) Test(org.junit.Test)

Example 2 with MultipleInstanceSubprocess

use of org.kie.workbench.common.stunner.bpmn.definition.MultipleInstanceSubprocess in project kie-wb-common by kiegroup.

the class StartEventFilterProviderFactoryTest method setUp.

@Before
public void setUp() throws Exception {
    inEdges = Arrays.asList(edge);
    eventSubprocess = new EventSubprocess();
    otherNode = new MultipleInstanceSubprocess();
    when(sessionManager.getCurrentSession()).thenReturn(session);
    when(session.getCanvasHandler()).thenReturn(canvasHandler);
    when(canvasHandler.getGraphIndex()).thenReturn(graphIndex);
    when(canvasHandler.getGraphIndex().getNode(ELEMENT_UUID)).thenReturn(node);
    when(node.getInEdges()).thenReturn(inEdges);
    when(edge.getContent()).thenReturn(child);
    when(edge.getSourceNode()).thenReturn(parentNode);
    when(parentNode.asNode()).thenReturn(parentNode);
    when(parentNode.getContent()).thenReturn(parentView);
}
Also used : EventSubprocess(org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess) MultipleInstanceSubprocess(org.kie.workbench.common.stunner.bpmn.definition.MultipleInstanceSubprocess) Before(org.junit.Before)

Aggregations

MultipleInstanceSubprocess (org.kie.workbench.common.stunner.bpmn.definition.MultipleInstanceSubprocess)2 Before (org.junit.Before)1 Test (org.junit.Test)1 EventSubprocess (org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess)1 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)1 Graph (org.kie.workbench.common.stunner.core.graph.Graph)1