@Override public CompensationEventExecutionSet getExecutionSet(IntermediateCompensationEventThrowing event) { return event.getExecutionSet(); }
private 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); definition.setGeneral(new BPMNGeneralSet( new Name(p.getName()), new Documentation(p.getDocumentation()) )); definition.setExecutionSet(new CompensationEventExecutionSet( new ActivityRef(EventDefinitionReader.activityRefOf(eventDefinition)) )); node.getContent().setBounds(p.getBounds()); definition.setDimensionsSet(p.getCircleDimensionSet()); definition.setFontSet(p.getFontSet()); definition.setBackgroundSet(p.getBackgroundSet()); return BpmnNode.of(node); } }
@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()); }
private PropertyWriter compensationEvent(Node<View<IntermediateCompensationEventThrowing>, ?> n) { IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent(); event.setId(n.getUUID()); IntermediateCompensationEventThrowing definition = n.getContent().getDefinition(); ThrowEventPropertyWriter p = propertyWriterFactory.of(event); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.addCompensation(); p.setBounds(n.getContent().getBounds()); return p; } }
@Test public void testIntermediateCompensationThrowingEventEqualsAndHashCode() { String ACTIVITY_REF = "ACTIVITY_REF"; String ACTIVITY_REF_1 = "ACTIVITY_REF_1"; TestCaseBuilder.newTestCase() .addTrueCase(new IntermediateCompensationEventThrowing(), new IntermediateCompensationEventThrowing()) .addTrueCase(new IntermediateCompensationEventThrowing(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new CompensationEventExecutionSet()), new IntermediateCompensationEventThrowing(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new CompensationEventExecutionSet())) .addFalseCase(new IntermediateCompensationEventThrowing(), null) .addTrueCase(new IntermediateCompensationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new CompensationEventExecutionSet()), new IntermediateCompensationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new CompensationEventExecutionSet())) .addTrueCase(new IntermediateCompensationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new CompensationEventExecutionSet(new ActivityRef(ACTIVITY_REF))), new IntermediateCompensationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new CompensationEventExecutionSet(new ActivityRef(ACTIVITY_REF)))) .addFalseCase(new IntermediateCompensationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new CompensationEventExecutionSet(new ActivityRef(ACTIVITY_REF))), new IntermediateCompensationEventThrowing(new BPMNGeneralSet("name1", "doc1"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new CompensationEventExecutionSet(new ActivityRef(ACTIVITY_REF)))) .addFalseCase(new IntermediateCompensationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new CompensationEventExecutionSet(new ActivityRef(ACTIVITY_REF))), new IntermediateCompensationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new CompensationEventExecutionSet(new ActivityRef(ACTIVITY_REF_1)))) .addFalseCase(new IntermediateCompensationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new CompensationEventExecutionSet(new ActivityRef(ACTIVITY_REF))), new IntermediateCompensationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new CompensationEventExecutionSet(null))) .addFalseCase(new IntermediateCompensationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new CompensationEventExecutionSet(new ActivityRef(ACTIVITY_REF))), new IntermediateCompensationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), null)) .test(); }
@Override public IntermediateCompensationEventThrowing createEvent() { CompensationEventExecutionSet executionSet = new CompensationEventExecutionSet(); when(intermediateCompensationEventThrowing.getExecutionSet()).thenReturn(executionSet); return intermediateCompensationEventThrowing; }
@Override public void process(ProcessPropertyWriter processWriter, BasePropertyWriter nodeWriter, Node<View<? extends BPMNViewDefinition>, ?> node) { final ThrowEvent throwEvent = (ThrowEvent) nodeWriter.getElement(); final String activityRef = ((IntermediateCompensationEventThrowing) node.getContent().getDefinition()).getExecutionSet().getActivityRef().getValue(); linkActivityRef(processWriter.getProcess(), throwEvent, activityRef); } }
currentActivityRef = ((EndCompensationEvent) ((View) selectedNode.getContent()).getDefinition()).getExecutionSet().getActivityRef(); } else if (isIntermediateCompensationEventThrowing(selectedNode)) { currentActivityRef = ((IntermediateCompensationEventThrowing) ((View) selectedNode.getContent()).getDefinition()).getExecutionSet().getActivityRef();