Search in sources :

Example 6 with StartErrorEvent

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

the class BPMNDirectDiagramMarshallerTest method testUnmarshallIsInterruptingStartErrorEvent.

@Test
public void testUnmarshallIsInterruptingStartErrorEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVENT_SUBPROCESS_STARTERROREVENT);
    assertDiagram(diagram, 7);
    assertEquals("EventSubprocessStartErrorEvent", diagram.getMetadata().getTitle());
    // Check first start event with all FILLED properties
    Node<? extends Definition, ?> startEventNode = diagram.getGraph().getNode("9ABD5C04-C6E2-4DF3-829F-ADB283330AD6");
    StartErrorEvent startErrorEvent = (StartErrorEvent) startEventNode.getContent().getDefinition();
    BPMNGeneralSet eventGeneralSet = startErrorEvent.getGeneral();
    assertNotNull(eventGeneralSet);
    assertEquals("StartErrorEvent", eventGeneralSet.getName().getValue());
    assertEquals("Some not empty\nDocumentation\n~`!@#$%^&*()_+=-{}|[]\\:\";'<>/?.,", eventGeneralSet.getDocumentation().getValue());
    InterruptingErrorEventExecutionSet eventExecutionSet = startErrorEvent.getExecutionSet();
    assertNotNull(eventExecutionSet);
    assertNotNull(eventExecutionSet.getErrorRef());
    assertEquals("Error1", eventExecutionSet.getErrorRef().getValue());
    assertEquals(true, eventExecutionSet.getIsInterrupting().getValue());
    DataIOSet eventDataIOSet = startErrorEvent.getDataIOSet();
    AssignmentsInfo assignmentsInfo = eventDataIOSet.getAssignmentsinfo();
    assertEquals("||Var1:String||[dout]Var1->Var1", assignmentsInfo.getValue());
    // Check second start event with all EMPTY properties
    Node<? extends Definition, ?> emptyEventNode = diagram.getGraph().getNode("50B93E5E-C05D-40DD-BF48-2B6AE919763E");
    StartErrorEvent emptyErrorEvent = (StartErrorEvent) emptyEventNode.getContent().getDefinition();
    BPMNGeneralSet emptyEventGeneralSet = emptyErrorEvent.getGeneral();
    assertNotNull(emptyEventGeneralSet);
    assertEquals("", emptyEventGeneralSet.getName().getValue());
    assertEquals("", emptyEventGeneralSet.getDocumentation().getValue());
    InterruptingErrorEventExecutionSet emptyExecutionSet = emptyErrorEvent.getExecutionSet();
    assertNotNull(emptyExecutionSet);
    assertNotNull(emptyExecutionSet.getErrorRef());
    assertEquals("", emptyExecutionSet.getErrorRef().getValue());
    assertEquals(false, emptyExecutionSet.getIsInterrupting().getValue());
    DataIOSet emptyDataIOSet = emptyErrorEvent.getDataIOSet();
    AssignmentsInfo emptyAssignmentsInfo = emptyDataIOSet.getAssignmentsinfo();
    assertEquals("", emptyAssignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) InterruptingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) Test(org.junit.Test)

Example 7 with StartErrorEvent

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

the class StartErrorEventTest method testUnmarshallSubprocessLevelEventEmptyProperties.

@Test
@Override
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH);
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    StartErrorEvent emptySubprocess = getStartNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, getStartEventType());
    assertGeneralSet(emptySubprocess.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
    assertErrorEventExecutionSet(emptySubprocess.getExecutionSet(), EMPTY_VALUE, NON_INTERRUPTING);
    assertDataIOSet(emptySubprocess.getDataIOSet(), EMPTY_VALUE);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) Test(org.junit.Test)

Example 8 with StartErrorEvent

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

the class StartErrorEventTest method testUnmarshallTopLevelEmptyEventProperties.

@Test
@Override
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH);
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    StartErrorEvent emptyTop = getStartNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, getStartEventType());
    assertGeneralSet(emptyTop.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
    assertErrorEventExecutionSet(emptyTop.getExecutionSet(), EMPTY_VALUE, NON_INTERRUPTING);
    assertDataIOSet(emptyTop.getDataIOSet(), EMPTY_VALUE);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) Test(org.junit.Test)

Example 9 with StartErrorEvent

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

the class StartErrorEventTest method testUnmarshallSubprocessLevelEventFilledProperties.

@Test
@Override
public void testUnmarshallSubprocessLevelEventFilledProperties() throws Exception {
    final String EVENT_NAME = "Event subprocess filled error event";
    final String EVENT_DOCUMENTATION = "Some documentation as well\n~`!@#$%^&*()_+=-{}|\\][:\";'?><,./";
    final String EVENT_REF = "Error2";
    final String EVENT_DATA_OUTPUT = "||newVar:String||[dout]newVar->prVar";
    Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH);
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    StartErrorEvent filledSubprocess = getStartNodeById(diagram, FILLED_SUBPROCESS_LEVEL_EVENT_ID, getStartEventType());
    assertGeneralSet(filledSubprocess.getGeneral(), EVENT_NAME, EVENT_DOCUMENTATION);
    assertErrorEventExecutionSet(filledSubprocess.getExecutionSet(), EVENT_REF, INTERRUPTING);
    assertDataIOSet(filledSubprocess.getDataIOSet(), EVENT_DATA_OUTPUT);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) Test(org.junit.Test)

Example 10 with StartErrorEvent

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

the class BPMNDiagramMarshallerTest method testUnmarshallStartErrorEvent.

@Test
public void testUnmarshallStartErrorEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_STARTERROREVENT);
    assertDiagram(diagram, 3);
    assertEquals("startErrorEventProcess", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> startEventNode = diagram.getGraph().getNode("3BD5BBC8-F1C7-45DE-8BDF-A06D8464A61B");
    StartErrorEvent startErrorEvent = (StartErrorEvent) startEventNode.getContent().getDefinition();
    assertNotNull(startErrorEvent.getGeneral());
    assertEquals("MyStartErrorEvent", startErrorEvent.getGeneral().getName().getValue());
    assertEquals("MyStartErrorEventDocumentation", startErrorEvent.getGeneral().getDocumentation().getValue());
    assertNotNull(startErrorEvent.getExecutionSet());
    assertNotNull(startErrorEvent.getExecutionSet().getErrorRef());
    assertEquals("MyError", startErrorEvent.getExecutionSet().getErrorRef().getValue());
    assertEquals(true, startErrorEvent.getExecutionSet().getIsInterrupting().getValue());
    DataIOSet dataIOSet = startErrorEvent.getDataIOSet();
    AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
    assertEquals("||errorOutput_:String||[dout]errorOutput_->var1", assignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) Test(org.junit.Test)

Aggregations

StartErrorEvent (org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent)11 Test (org.junit.Test)8 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)8 Graph (org.kie.workbench.common.stunner.core.graph.Graph)8 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)5 InterruptingErrorEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.InterruptingErrorEventExecutionSet)5 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)4 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)4 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)2 ErrorRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef)2 StartEvent (org.eclipse.bpmn2.StartEvent)1 CatchEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter)1 CatchEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader)1 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)1 BaseStartEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent)1 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)1 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)1 Edge (org.kie.workbench.common.stunner.core.graph.Edge)1 View (org.kie.workbench.common.stunner.core.graph.content.view.View)1