use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing in project kie-wb-common by kiegroup.
the class ThrowingIntermediateCompensationEventTest method testUnmarshallSubprocessLevelEventFilledProperties.
@Test
@Override
public void testUnmarshallSubprocessLevelEventFilledProperties() throws Exception {
final String EVENT_NAME = "Compensation event03 name\n ~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./";
final String EVENT_DOCUMENTATION = "Compensation event03 doc\n ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,./";
final String ACTIVITY_REFERENCE = "_4305E23D-496B-42AA-AEE0-2840B4E75F15";
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
IntermediateCompensationEventThrowing filledSubprocessEvent = getThrowingIntermediateNodeById(diagram, FILLED_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, ZERO_OUTGOING_EDGES);
assertGeneralSet(filledSubprocessEvent.getGeneral(), EVENT_NAME, EVENT_DOCUMENTATION);
assertCompensationEventExecutionSet(filledSubprocessEvent.getExecutionSet(), ACTIVITY_REFERENCE);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing in project kie-wb-common by kiegroup.
the class ThrowingIntermediateCompensationEventTest method testUnmarshallTopLevelEventWithEdgesFilledProperties.
@Test
@Override
public void testUnmarshallTopLevelEventWithEdgesFilledProperties() {
final String EVENT_NAME = "Compensation event02 name\n ~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./";
final String EVENT_DOCUMENTATION = "Compensation event02 doc\n ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,./";
final String ACTIVITY_REFERENCE = "_1FDF93CC-5677-48C2-9760-B7B98FA08DD6";
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
IntermediateCompensationEventThrowing filledSubprocessEvent = getThrowingIntermediateNodeById(diagram, FILLED_WITH_EDGES_TOP_LEVEL_EVENT_ID, HAS_INCOME_EDGE, TWO_OUTGOING_EDGES);
assertGeneralSet(filledSubprocessEvent.getGeneral(), EVENT_NAME, EVENT_DOCUMENTATION);
assertCompensationEventExecutionSet(filledSubprocessEvent.getExecutionSet(), ACTIVITY_REFERENCE);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing in project kie-wb-common by kiegroup.
the class ThrowingIntermediateCompensationEventTest method testUnmarshallTopLevelEventWithEdgesEmptyProperties.
@Test
@Override
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() {
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
IntermediateCompensationEventThrowing emptyEvent = getThrowingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_TOP_LEVEL_EVENT_ID, HAS_INCOME_EDGE, TWO_OUTGOING_EDGES);
assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
assertCompensationEventExecutionSet(emptyEvent.getExecutionSet(), DEFAULT_REFERENCE_ACTIVITY);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing in project kie-wb-common by kiegroup.
the class IntermediateThrowEventConverter method compensationEvent.
protected BpmnNode compensationEvent(IntermediateThrowEvent event, CompensateEventDefinition eventDefinition) {
Node<View<IntermediateCompensationEventThrowing>, Edge> node = factoryManager.newNode(event.getId(), IntermediateCompensationEventThrowing.class);
IntermediateCompensationEventThrowing definition = node.getContent().getDefinition();
EventPropertyReader p = propertyReaderFactory.of(event);
node.getContent().setBounds(p.getBounds());
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
definition.setDimensionsSet(p.getCircleDimensionSet());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
definition.setExecutionSet(new CompensationEventExecutionSet(new ActivityRef(EventDefinitionReader.activityRefOf(eventDefinition))));
return BpmnNode.of(node, p);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallIntermediateCompensationEventThrowing.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateCompensationEventThrowing() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_COMPENSATION_EVENTTHROWING);
assertDiagram(diagram, 3);
assertEquals("IntermediateCompensationEventThrowing", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> throwingEventNode = diagram.getGraph().getNode("_F1D87D25-4D73-4DC5-A0C2-C627CED773BA");
assertNotNull(throwingEventNode);
IntermediateCompensationEventThrowing throwingCompensationEvent = (IntermediateCompensationEventThrowing) throwingEventNode.getContent().getDefinition();
assertNotNull(throwingCompensationEvent.getGeneral());
assertEquals("ThrowingCompensationEventName", throwingCompensationEvent.getGeneral().getName().getValue());
assertEquals("ThrowingCompensationEventDocumentation", throwingCompensationEvent.getGeneral().getDocumentation().getValue());
assertNotNull(throwingCompensationEvent.getExecutionSet());
assertEquals("_E318295E-B0B6-4FB2-B5EB-A43BFD44FCBD", throwingCompensationEvent.getExecutionSet().getActivityRef().getValue());
}
Aggregations