use of org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent in project kie-wb-common by kiegroup.
the class StartCompensationEventTest method testUnmarshallSubprocessLevelEventEmptyProperties.
@Test
@Override
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception {
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
StartCompensationEvent emptySubprocessLevelEvent = getStartNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID);
assertGeneralSet(emptySubprocessLevelEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
assertNotNull(emptySubprocessLevelEvent.getExecutionSet());
assertStartEventSlaDueDate(emptySubprocessLevelEvent.getExecutionSet(), EMPTY_VALUE);
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent in project kie-wb-common by kiegroup.
the class StartEventConverter method compensationEvent.
private PropertyWriter compensationEvent(Node<View<StartCompensationEvent>, ?> n) {
StartEvent event = bpmn2.createStartEvent();
event.setId(n.getUUID());
StartCompensationEvent definition = n.getContent().getDefinition();
CatchEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
p.setSimulationSet(definition.getSimulationSet());
BaseStartEventExecutionSet executionSet = definition.getExecutionSet();
event.setIsInterrupting(executionSet.getIsInterrupting().getValue());
p.addSlaDueDate(executionSet.getSlaDueDate());
p.setAbsoluteBounds(n);
p.addCompensation();
return p;
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent in project kie-wb-common by kiegroup.
the class StartEventConverter method compensationEvent.
private BpmnNode compensationEvent(StartEvent event, CompensateEventDefinition e) {
Node<View<StartCompensationEvent>, Edge> node = factoryManager.newNode(event.getId(), StartCompensationEvent.class);
StartCompensationEvent definition = node.getContent().getDefinition();
EventPropertyReader p = propertyReaderFactory.of(event);
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setBackgroundSet(p.getBackgroundSet());
definition.setFontSet(p.getFontSet());
definition.setDimensionsSet(p.getCircleDimensionSet());
definition.setSimulationSet(p.getSimulationSet());
definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
IsInterrupting isInterrupting = new IsInterrupting(event.isIsInterrupting());
SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate());
BaseStartEventExecutionSet baseStartEventExecutionSet = new BaseStartEventExecutionSet(isInterrupting, slaDueDate);
definition.setExecutionSet(baseStartEventExecutionSet);
node.getContent().setBounds(p.getBounds());
return BpmnNode.of(node, p);
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallStartCompensationEvent.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallStartCompensationEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_STARTCOMPENSATIONEVENT);
assertDiagram(diagram, 2);
assertEquals("StartCompensationEvent", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> startEventNode = diagram.getGraph().getNode("_19C23644-6CF0-4508-81B2-4CA2179137AB");
assertNotNull(startEventNode);
StartCompensationEvent startCompensationEvent = (StartCompensationEvent) startEventNode.getContent().getDefinition();
assertNotNull(startCompensationEvent.getGeneral());
assertEquals("StartCompensationEventName", startCompensationEvent.getGeneral().getName().getValue());
assertEquals("StartCompensationEventDocumentation", startCompensationEvent.getGeneral().getDocumentation().getValue());
assertFalse(startCompensationEvent.getExecutionSet().getIsInterrupting().getValue());
assertEquals("12/25/1983", startCompensationEvent.getExecutionSet().getSlaDueDate().getValue());
}
Aggregations