use of org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent in project kie-wb-common by kiegroup.
the class StartEventConverter method errorEvent.
private BpmnNode errorEvent(StartEvent event, ErrorEventDefinition e) {
Node<View<StartErrorEvent>, Edge> node = factoryManager.newNode(event.getId(), StartErrorEvent.class);
StartErrorEvent definition = node.getContent().getDefinition();
EventPropertyReader p = propertyReaderFactory.of(event);
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
definition.setExecutionSet(new InterruptingErrorEventExecutionSet(new IsInterrupting(event.isIsInterrupting()), // avoids an ErrorRef(null) -- tests expect ""
new ErrorRef(Optional.ofNullable(e.getErrorRef().getErrorCode()).orElse(""))));
definition.setSimulationSet(p.getSimulationSet());
node.getContent().setBounds(p.getBounds());
definition.setDimensionsSet(p.getCircleDimensionSet());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
return BpmnNode.of(node);
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent in project kie-wb-common by kiegroup.
the class StartEventConverter method errorEvent.
private PropertyWriter errorEvent(Node<View<StartErrorEvent>, ?> n) {
StartEvent event = bpmn2.createStartEvent();
event.setId(n.getUUID());
StartErrorEvent definition = n.getContent().getDefinition();
CatchEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
InterruptingErrorEventExecutionSet executionSet = definition.getExecutionSet();
p.addError(executionSet.getErrorRef());
p.setBounds(n.getContent().getBounds());
return p;
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent in project kie-wb-common by kiegroup.
the class ProcessErrorRefProviderTest method mockStartErrorEventNode.
private Element mockStartErrorEventNode(String errorRefValue) {
StartErrorEvent event = new StartErrorEvent();
event.setExecutionSet(new InterruptingErrorEventExecutionSet(new IsInterrupting(true), new ErrorRef(errorRefValue)));
return mockNode(event);
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest 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());
DataIOSet dataIOSet = startErrorEvent.getDataIOSet();
AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
assertEquals("||errorOutput_:String||[dout]errorOutput_->var1", assignmentsInfo.getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent in project kie-wb-common by kiegroup.
the class StartErrorEventTest method testUnmarshallTopLevelEventFilledProperties.
@Test
@Override
public void testUnmarshallTopLevelEventFilledProperties() throws Exception {
final String EVENT_NAME = "Filled Top-Level Error start event";
final String EVENT_DOCUMENTATION = "Some documentation\n~`!@#$%^&*()_+=-{}|\\][:\";'?><,./\n";
final String ERROR_REF = "Error1";
final String EVENT_DATA_OUTPUT = "||someVar:String||[dout]someVar->prVar";
Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH);
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
StartErrorEvent filledTop = getStartNodeById(diagram, FILLED_TOP_LEVEL_EVENT_ID, getStartEventType());
assertGeneralSet(filledTop.getGeneral(), EVENT_NAME, EVENT_DOCUMENTATION);
assertErrorEventExecutionSet(filledTop.getExecutionSet(), ERROR_REF, INTERRUPTING);
assertDataIOSet(filledTop.getDataIOSet(), EVENT_DATA_OUTPUT);
}
Aggregations