Search in sources :

Example 6 with IntermediateCompensationEventThrowing

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);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) IntermediateCompensationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Example 7 with IntermediateCompensationEventThrowing

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);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) IntermediateCompensationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Example 8 with IntermediateCompensationEventThrowing

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);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) IntermediateCompensationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Example 9 with IntermediateCompensationEventThrowing

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);
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) IntermediateCompensationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) ActivityRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.ActivityRef) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CompensationEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.CompensationEventExecutionSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) EventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader) ThrowEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ThrowEventPropertyReader) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)

Example 10 with IntermediateCompensationEventThrowing

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());
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) IntermediateCompensationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Aggregations

IntermediateCompensationEventThrowing (org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing)16 Test (org.junit.Test)10 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)9 Graph (org.kie.workbench.common.stunner.core.graph.Graph)9 IntermediateThrowEvent (org.eclipse.bpmn2.IntermediateThrowEvent)3 CompensationEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.CompensationEventExecutionSet)3 CompensateEventDefinition (org.eclipse.bpmn2.CompensateEventDefinition)2 ActivityRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.ActivityRef)2 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)2 Edge (org.kie.workbench.common.stunner.core.graph.Edge)2 Node (org.kie.workbench.common.stunner.core.graph.Node)2 View (org.kie.workbench.common.stunner.core.graph.content.view.View)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 Collectors (java.util.stream.Collectors)1 Inject (javax.inject.Inject)1 ThrowEvent (org.eclipse.bpmn2.ThrowEvent)1 SelectorData (org.kie.workbench.common.forms.dynamic.model.config.SelectorData)1