use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching in project kie-wb-common by kiegroup.
the class ProcessErrorRefProviderTest method mockIntermediateErrorEventCatchingNode.
private Node mockIntermediateErrorEventCatchingNode(String errorRefValue) {
IntermediateErrorEventCatching event = new IntermediateErrorEventCatching();
event.setExecutionSet(new CancellingErrorEventExecutionSet(new CancelActivity(true), new ErrorRef(errorRefValue)));
return mockNode(event);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallIntermediateErrorEventCatching.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateErrorEventCatching() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_ERROR_EVENTCATCHING);
assertDiagram(diagram, 2);
assertEquals("intermediateErrorCatching", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> intermediateEventNode = diagram.getGraph().getNode("80A2A7A9-7C68-408C-BE3B-467562A2C139");
IntermediateErrorEventCatching intermediateErrorEventCatching = (IntermediateErrorEventCatching) intermediateEventNode.getContent().getDefinition();
assertNotNull(intermediateErrorEventCatching.getGeneral());
assertEquals("MyErrorCatchingEvent", intermediateErrorEventCatching.getGeneral().getName().getValue());
assertEquals("MyErrorCatchingEventDocumentation", intermediateErrorEventCatching.getGeneral().getDocumentation().getValue());
assertNotNull(intermediateErrorEventCatching.getExecutionSet());
assertEquals(true, intermediateErrorEventCatching.getExecutionSet().getCancelActivity().getValue());
assertEquals("MyError", intermediateErrorEventCatching.getExecutionSet().getErrorRef().getValue());
DataIOSet dataIOSet = intermediateErrorEventCatching.getDataIOSet();
AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
assertEquals("||theErrorEventOutput:String||[dout]theErrorEventOutput->errorVar", assignmentsInfo.getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverter method errorEvent.
private BpmnNode errorEvent(CatchEvent event, ErrorEventDefinition e) {
String nodeId = event.getId();
Node<View<IntermediateErrorEventCatching>, Edge> node = factoryManager.newNode(nodeId, IntermediateErrorEventCatching.class);
IntermediateErrorEventCatching 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 CancellingErrorEventExecutionSet(new CancelActivity(p.isCancelActivity()), 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.IntermediateErrorEventCatching in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallIntermediateErrorEventCatching.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateErrorEventCatching() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_ERROR_EVENTCATCHING);
assertDiagram(diagram, 2);
assertEquals("intermediateErrorCatching", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> intermediateEventNode = diagram.getGraph().getNode("80A2A7A9-7C68-408C-BE3B-467562A2C139");
IntermediateErrorEventCatching intermediateErrorEventCatching = (IntermediateErrorEventCatching) intermediateEventNode.getContent().getDefinition();
assertNotNull(intermediateErrorEventCatching.getGeneral());
assertEquals("MyErrorCatchingEvent", intermediateErrorEventCatching.getGeneral().getName().getValue());
assertEquals("MyErrorCatchingEventDocumentation", intermediateErrorEventCatching.getGeneral().getDocumentation().getValue());
assertNotNull(intermediateErrorEventCatching.getExecutionSet());
assertEquals(true, intermediateErrorEventCatching.getExecutionSet().getCancelActivity().getValue());
assertEquals("MyError", intermediateErrorEventCatching.getExecutionSet().getErrorRef().getValue());
DataIOSet dataIOSet = intermediateErrorEventCatching.getDataIOSet();
AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
assertEquals("||theErrorEventOutput:String||[dout]theErrorEventOutput->errorVar", assignmentsInfo.getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverter method errorEvent.
private PropertyWriter errorEvent(Node<View<IntermediateErrorEventCatching>, ?> n) {
CatchEventPropertyWriter p = createCatchEventPropertyWriter(n);
p.getFlowElement().setId(n.getUUID());
IntermediateErrorEventCatching definition = n.getContent().getDefinition();
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
CancellingErrorEventExecutionSet executionSet = definition.getExecutionSet();
p.addError(executionSet.getErrorRef());
p.setBounds(n.getContent().getBounds());
return p;
}
Aggregations