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());
}
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);
}
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);
}
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);
}
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());
}
Aggregations