Search in sources :

Example 1 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 PropertyWriter compensationEvent(Node<View<IntermediateCompensationEventThrowing>, ?> n) {
    IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent();
    event.setId(n.getUUID());
    ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
    IntermediateCompensationEventThrowing definition = n.getContent().getDefinition();
    p.setAbsoluteBounds(n);
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    p.addCompensation();
    return p;
}
Also used : IntermediateCompensationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) IntermediateThrowEvent(org.eclipse.bpmn2.IntermediateThrowEvent) ThrowEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)

Example 2 with IntermediateCompensationEventThrowing

use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing in project kie-wb-common by kiegroup.

the class IntermediateThrowCompensationEventPostConverter method process.

@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);
}
Also used : ThrowEvent(org.eclipse.bpmn2.ThrowEvent) IntermediateCompensationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing)

Example 3 with IntermediateCompensationEventThrowing

use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing in project kie-wb-common by kiegroup.

the class IntermediateThrowEventConverterTest method compensationEvent.

@Test
public void compensationEvent() {
    IntermediateCompensationEventThrowing definition = mock(IntermediateCompensationEventThrowing.class);
    CompensateEventDefinition eventDefinition = mock(CompensateEventDefinition.class);
    IntermediateThrowEvent intermediateThrowEvent = mockIntermediateThrowEvent(definition);
    tested.compensationEvent(intermediateThrowEvent, eventDefinition);
    verifyCommonProperties(definition);
    verify(definition).setExecutionSet(any(CompensationEventExecutionSet.class));
}
Also used : IntermediateCompensationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing) CompensationEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.CompensationEventExecutionSet) CompensateEventDefinition(org.eclipse.bpmn2.CompensateEventDefinition) IntermediateThrowEvent(org.eclipse.bpmn2.IntermediateThrowEvent) Test(org.junit.Test)

Example 4 with IntermediateCompensationEventThrowing

use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing in project kie-wb-common by kiegroup.

the class IntermediateThrowEventConverterTest method createIntermediateCompensationEventThrowingNode.

private Node createIntermediateCompensationEventThrowingNode() {
    CompensationEventExecutionSet executionSet = new CompensationEventExecutionSet();
    IntermediateCompensationEventThrowing eventThrowing = new IntermediateCompensationEventThrowing(generalSet, mock(BackgroundSet.class), mock(FontSet.class), mock(CircleDimensionSet.class), dataIOSet, advancedData, executionSet);
    Node dockNode = mockNode();
    Node node = mockDockedNode(dockNode, eventThrowing);
    return node;
}
Also used : FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) CircleDimensionSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.CircleDimensionSet) IntermediateCompensationEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing) Node(org.kie.workbench.common.stunner.core.graph.Node) CompensationEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.compensation.CompensationEventExecutionSet)

Example 5 with IntermediateCompensationEventThrowing

use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEventThrowing in project kie-wb-common by kiegroup.

the class ThrowingIntermediateCompensationEventTest method testUnmarshallTopLevelEmptyEventProperties.

@Test
@Override
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception {
    Diagram<Graph, Metadata> diagram = getDiagram();
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    IntermediateCompensationEventThrowing emptyTopEvent = getThrowingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, ZERO_OUTGOING_EDGES);
    assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
    assertCompensationEventExecutionSet(emptyTopEvent.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)

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