use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverterTest method verifyCompensationEventConvert.
private void verifyCompensationEventConvert() {
IntermediateCompensationEvent definition = mock(IntermediateCompensationEvent.class);
CompensateEventDefinition eventDefinition = mock(CompensateEventDefinition.class);
IntermediateCatchEvent intermediateCatchEvent = mockIntermediateCatchEvent(definition);
eventDefinitions.clear();
eventDefinitions.add(eventDefinition);
tested.convert(intermediateCatchEvent);
verify(tested).compensationEvent(intermediateCatchEvent);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverter method compensationEvent.
protected Result<BpmnNode> compensationEvent(CatchEvent event) {
String nodeId = event.getId();
Node<View<IntermediateCompensationEvent>, Edge> node = factoryManager.newNode(nodeId, IntermediateCompensationEvent.class);
IntermediateCompensationEvent definition = node.getContent().getDefinition();
CatchEventPropertyReader p = propertyReaderFactory.of(event);
node.getContent().setBounds(p.getBounds());
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.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
CancelActivity cancelActivity = new CancelActivity(false);
SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate());
BaseCancellingEventExecutionSet executionSet = new BaseCancellingEventExecutionSet(cancelActivity, slaDueDate);
definition.setExecutionSet(executionSet);
return Result.success(BpmnNode.of(node, p));
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallIntermediateCompensationEvents.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateCompensationEvents() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_COMPENSATION_EVENTS);
assertDiagram(diagram, 3);
assertEquals("IntermediateCompensationEvents", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> catchingEventNode = diagram.getGraph().getNode("_8CE8AB54-7E8B-4032-B340-2DBEBAB5080F");
assertNotNull(catchingEventNode);
IntermediateCompensationEvent intermediateCompensationEvent = (IntermediateCompensationEvent) catchingEventNode.getContent().getDefinition();
assertNotNull(intermediateCompensationEvent.getGeneral());
assertEquals("IntermediateCompensationEventName", intermediateCompensationEvent.getGeneral().getName().getValue());
assertEquals("IntermediateCompensationEventDocumentation", intermediateCompensationEvent.getGeneral().getDocumentation().getValue());
assertEquals("IntermediateCompensationEventDocumentation", intermediateCompensationEvent.getGeneral().getDocumentation().getValue());
assertEquals("12/25/1983", intermediateCompensationEvent.getExecutionSet().getSlaDueDate().getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent in project kie-wb-common by kiegroup.
the class BoundaryCatchingIntermediateCompensationEventTest method testUnmarshallTopLevelEventWithEdgesEmptyProperties.
@Test
@Override
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() {
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
IntermediateCompensationEvent emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, TWO_OUTGOING_EDGES);
assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
assertCompensationEventExecutionSet(emptyEvent.getExecutionSet(), NON_CANCELLING, EMPTY_VALUE);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent in project kie-wb-common by kiegroup.
the class BoundaryCatchingIntermediateCompensationEventTest method testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties.
@Test
@Override
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() {
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
IntermediateCompensationEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, TWO_OUTGOING_EDGES);
assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
assertCompensationEventExecutionSet(emptySubprocessEvent.getExecutionSet(), NON_CANCELLING, EMPTY_VALUE);
}
Aggregations