use of org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent in project kie-wb-common by kiegroup.
the class ProcessErrorRefProviderTest method mockEndErrorEventNode.
private Node mockEndErrorEventNode(String errorRefValue) {
EndErrorEvent event = new EndErrorEvent();
event.setExecutionSet(new ErrorEventExecutionSet(new ErrorRef(errorRefValue)));
return mockNode(event);
}
use of org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallEndErrorEvent.
@Test
public void testUnmarshallEndErrorEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDERROR_EVENT);
assertDiagram(diagram, 2);
assertEquals("endErrorEventProcess", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> endEventNode = diagram.getGraph().getNode("_E69BD781-AB7F-45C4-85DA-B1F3BAE5BCCB");
EndErrorEvent endErrorEvent = (EndErrorEvent) endEventNode.getContent().getDefinition();
assertNotNull(endErrorEvent.getGeneral());
assertEquals("MyErrorEventName", endErrorEvent.getGeneral().getName().getValue());
assertEquals("MyErrorEventDocumentation", endErrorEvent.getGeneral().getDocumentation().getValue());
assertNotNull(endErrorEvent.getExecutionSet());
assertNotNull(endErrorEvent.getExecutionSet().getErrorRef());
assertEquals("MyError", endErrorEvent.getExecutionSet().getErrorRef().getValue());
DataIOSet dataIOSet = endErrorEvent.getDataIOSet();
AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
assertEquals("myErrorEventInput:String||||[din]var1->myErrorEventInput", assignmentsInfo.getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent in project kie-wb-common by kiegroup.
the class EndEventConverter method errorEventDefinition.
private BpmnNode errorEventDefinition(EndEvent event, ErrorEventDefinition e) {
Node<View<EndErrorEvent>, Edge> node = factoryManager.newNode(event.getId(), EndErrorEvent.class);
EndErrorEvent 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 ErrorEventExecutionSet(new ErrorRef(e.getErrorRef().getErrorCode())));
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.EndErrorEvent in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallEndErrorEvent.
public void testUnmarshallEndErrorEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDERROR_EVENT);
assertDiagram(diagram, 2);
assertEquals("endErrorEventProcess", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> endEventNode = diagram.getGraph().getNode("_E69BD781-AB7F-45C4-85DA-B1F3BAE5BCCB");
EndErrorEvent endErrorEvent = (EndErrorEvent) endEventNode.getContent().getDefinition();
assertNotNull(endErrorEvent.getGeneral());
assertEquals("MyErrorEventName", endErrorEvent.getGeneral().getName().getValue());
assertEquals("MyErrorEventDocumentation", endErrorEvent.getGeneral().getDocumentation().getValue());
assertNotNull(endErrorEvent.getExecutionSet());
assertNotNull(endErrorEvent.getExecutionSet().getErrorRef());
assertEquals("MyError", endErrorEvent.getExecutionSet().getErrorRef().getValue());
DataIOSet dataIOSet = endErrorEvent.getDataIOSet();
AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
assertEquals("myErrorEventInput:String||||[din]var1->myErrorEventInput", assignmentsInfo.getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent in project kie-wb-common by kiegroup.
the class EndEventConverter method errorEvent.
private PropertyWriter errorEvent(Node<View<EndErrorEvent>, ?> n) {
EndEvent event = bpmn2.createEndEvent();
event.setId(n.getUUID());
EndErrorEvent definition = n.getContent().getDefinition();
ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
ErrorEventExecutionSet executionSet = definition.getExecutionSet();
p.addError(executionSet.getErrorRef());
p.setBounds(n.getContent().getBounds());
return p;
}
Aggregations