Search in sources :

Example 1 with IntermediateCompensationEvent

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

the class IntermediateCatchEventConverter method compensationEvent.

protected PropertyWriter compensationEvent(Node<View<IntermediateCompensationEvent>, ?> n) {
    CatchEventPropertyWriter p = createCatchEventPropertyWriter(n);
    p.getFlowElement().setId(n.getUUID());
    p.setAbsoluteBounds(n);
    IntermediateCompensationEvent definition = n.getContent().getDefinition();
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    BaseCancellingEventExecutionSet executionSet = definition.getExecutionSet();
    p.addSlaDueDate(executionSet.getSlaDueDate());
    p.addCompensation();
    return p;
}
Also used : CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) BaseCancellingEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.BaseCancellingEventExecutionSet) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) IntermediateCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent)

Example 2 with IntermediateCompensationEvent

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

the class IntermediateCatchEventConverterTest method compensationEvent.

@Test
public void compensationEvent() {
    IntermediateCompensationEvent definition = mock(IntermediateCompensationEvent.class);
    CompensateEventDefinition eventDefinition = mock(CompensateEventDefinition.class);
    CatchEvent catchEvent = mockIntermediateCatchEvent(definition);
    tested.compensationEvent(catchEvent);
    verifyCommonProperties(definition);
    verify(propertyReader).getSlaDueDate();
    verify(definition).setExecutionSet(Mockito.<BaseCancellingEventExecutionSet>any());
}
Also used : CompensateEventDefinition(org.eclipse.bpmn2.CompensateEventDefinition) CatchEvent(org.eclipse.bpmn2.CatchEvent) IntermediateCatchEvent(org.eclipse.bpmn2.IntermediateCatchEvent) IntermediateCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent) Test(org.junit.Test)

Example 3 with IntermediateCompensationEvent

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

the class IntermediateCatchEventConverterTest method verifyBoundaryCompensationEventConvert.

private void verifyBoundaryCompensationEventConvert() {
    IntermediateCompensationEvent definition = mock(IntermediateCompensationEvent.class);
    CompensateEventDefinition eventDefinition = mock(CompensateEventDefinition.class);
    BoundaryEvent boundaryEvent = mockBoundaryEvent(definition);
    eventDefinitions.clear();
    eventDefinitions.add(eventDefinition);
    tested.convertBoundaryEvent(boundaryEvent);
    verify(tested).compensationEvent(boundaryEvent);
}
Also used : BoundaryEvent(org.eclipse.bpmn2.BoundaryEvent) CompensateEventDefinition(org.eclipse.bpmn2.CompensateEventDefinition) IntermediateCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent)

Example 4 with IntermediateCompensationEvent

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

the class IntermediateCatchEventConverterTest method createIntermediateCompensationEventCatchingNode.

private Node createIntermediateCompensationEventCatchingNode() {
    BaseCancellingEventExecutionSet executionSet = new BaseCancellingEventExecutionSet(new CancelActivity(CANCEL_ACTIVITY), slaDueDate);
    IntermediateCompensationEvent eventCatching = new IntermediateCompensationEvent(generalSet, mock(BackgroundSet.class), mock(FontSet.class), mock(CircleDimensionSet.class), dataIOSet, advancedData, executionSet);
    Node dockNode = mockNode();
    Node node = mockDockedNode(dockNode, eventCatching);
    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) BaseCancellingEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.BaseCancellingEventExecutionSet) Node(org.kie.workbench.common.stunner.core.graph.Node) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity) IntermediateCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent)

Example 5 with IntermediateCompensationEvent

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

the class ProcessCompensationRefProviderTest method testGetSelectorDataLevel0ZeroTasks.

@Test
public void testGetSelectorDataLevel0ZeroTasks() {
    TestingGraphInstanceBuilder2.Level0Graph graph = buildLevel0Graph(graphTestHandler, new TestingGraphInstanceBuilder2.Level0Graph(), new StartNoneEvent(), new IntermediateCompensationEvent(), new IntermediateConditionalEvent(), new EndNoneEvent());
    testGetSelectorData(graph.level0Node2, expectedNodes());
}
Also used : TestingGraphInstanceBuilder2(org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2) IntermediateConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent) EndNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) IntermediateCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent) Test(org.junit.Test)

Aggregations

IntermediateCompensationEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent)18 Test (org.junit.Test)13 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)10 Graph (org.kie.workbench.common.stunner.core.graph.Graph)10 CompensateEventDefinition (org.eclipse.bpmn2.CompensateEventDefinition)3 IntermediateConditionalEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent)3 BaseCancellingEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.BaseCancellingEventExecutionSet)3 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)3 IntermediateCatchEvent (org.eclipse.bpmn2.IntermediateCatchEvent)2 EndNoneEvent (org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent)2 StartNoneEvent (org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent)2 Node (org.kie.workbench.common.stunner.core.graph.Node)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Objects (java.util.Objects)1 Optional (java.util.Optional)1 Matcher (java.util.regex.Matcher)1