Search in sources :

Example 26 with IntermediateConditionalEvent

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

the class IntermediateCatchEventConverter method conditionalEvent.

protected Result<BpmnNode> conditionalEvent(CatchEvent event, ConditionalEventDefinition e) {
    String nodeId = event.getId();
    Node<View<IntermediateConditionalEvent>, Edge> node = factoryManager.newNode(nodeId, IntermediateConditionalEvent.class);
    IntermediateConditionalEvent definition = node.getContent().getDefinition();
    CatchEventPropertyReader p = propertyReaderFactory.of(event);
    node.getContent().setBounds(p.getBounds());
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    definition.setExecutionSet(new CancellingConditionalEventExecutionSet(new CancelActivity(p.isCancelActivity()), new SLADueDate(p.getSlaDueDate()), p.getConditionExpression(e)));
    return Result.success(BpmnNode.of(node, p));
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) IntermediateConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) CancellingConditionalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.conditional.CancellingConditionalEventExecutionSet) Edge(org.kie.workbench.common.stunner.core.graph.Edge) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 27 with IntermediateConditionalEvent

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

the class CatchingIntermediateEventFilterProviderTest method testFilterProviderShowCancelActivityField.

@Test
public void testFilterProviderShowCancelActivityField() {
    BaseCatchingIntermediateEvent[] testedClasses = { new IntermediateTimerEvent(), new IntermediateConditionalEvent(), new IntermediateSignalEventCatching(), new IntermediateTimerEvent(), new IntermediateMessageEventCatching() };
    when(graphIndex.getNode(UUID)).thenReturn(dockedNode);
    Stream.of(testedClasses).forEach(catchingIntermediateEvent -> testFilterProviderShowCancelActivityField(catchingIntermediateEvent));
}
Also used : IntermediateSignalEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching) IntermediateTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent) IntermediateConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) BaseCatchingIntermediateEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseCatchingIntermediateEvent) Test(org.junit.Test)

Example 28 with IntermediateConditionalEvent

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

the class CatchingIntermediateEventFilterProviderTest method testFilterProviderDontShowCancelActivityField.

@Test
public void testFilterProviderDontShowCancelActivityField() {
    BaseCatchingIntermediateEvent[] test1Classes = { new IntermediateTimerEvent(), new IntermediateErrorEventCatching(), new IntermediateConditionalEvent(), new IntermediateCompensationEvent(), new IntermediateSignalEventCatching(), new IntermediateTimerEvent(), new IntermediateMessageEventCatching() };
    when(graphIndex.getNode(UUID)).thenReturn(noDockedNode);
    Stream.of(test1Classes).forEach(catchingIntermediateEvent -> testFilterProviderDontShowCancelActivityField(catchingIntermediateEvent));
    BaseCatchingIntermediateEvent[] test2Classes = { new IntermediateErrorEventCatching(), new IntermediateCompensationEvent() };
    when(graphIndex.getNode(UUID)).thenReturn(dockedNode);
    Stream.of(test2Classes).forEach(clazz -> testFilterProviderDontShowCancelActivityField(clazz));
}
Also used : IntermediateSignalEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching) IntermediateErrorEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching) IntermediateTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent) IntermediateConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) BaseCatchingIntermediateEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseCatchingIntermediateEvent) IntermediateCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent) Test(org.junit.Test)

Example 29 with IntermediateConditionalEvent

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

the class ProcessCompensationRefProviderTest method testGetSelectorDataLevel0OneTask.

@Test
public void testGetSelectorDataLevel0OneTask() {
    TestingGraphInstanceBuilder2.Level0Graph graph = buildLevel0Graph(graphTestHandler, new TestingGraphInstanceBuilder2.Level0Graph(), new StartNoneEvent(), mockTask(LEVEL0_NODE1.nodeName()), new IntermediateConditionalEvent(), new EndNoneEvent());
    testGetSelectorData(graph.level0Node2, expectedNodes(LEVEL0_NODE1));
}
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) Test(org.junit.Test)

Example 30 with IntermediateConditionalEvent

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

the class ProcessCompensationRefProviderTest method testGetSelectorDataLevel1ThreeTasks.

@Test
public void testGetSelectorDataLevel1ThreeTasks() {
    TestingGraphInstanceBuilder2.Level1Graph graph = buildLevel1Graph(graphTestHandler, new TestingGraphInstanceBuilder2.Level1Graph(), new StartNoneEvent(), new IntermediateConditionalEvent(), mockTask(LEVEL0_NODE2.nodeName()), new EndNoneEvent(), mockSubProcess(LEVEL1_SUB_PROCESS1.nodeName()), mockTask(LEVEL1_NODE1.nodeName()), mockTask(LEVEL1_NODE2.nodeName()));
    testGetSelectorData(graph.level1Node1, expectedNodes(LEVEL0_NODE2, LEVEL1_SUB_PROCESS1, LEVEL1_NODE1, LEVEL1_NODE2));
}
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) Test(org.junit.Test)

Aggregations

IntermediateConditionalEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent)30 Test (org.junit.Test)25 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)17 Graph (org.kie.workbench.common.stunner.core.graph.Graph)17 ConditionalEventDefinition (org.eclipse.bpmn2.ConditionalEventDefinition)3 EndNoneEvent (org.kie.workbench.common.stunner.bpmn.definition.EndNoneEvent)3 StartNoneEvent (org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent)3 CancellingConditionalEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.conditional.CancellingConditionalEventExecutionSet)3 TestingGraphInstanceBuilder2 (org.kie.workbench.common.stunner.core.TestingGraphInstanceBuilder2)3 IntermediateCatchEvent (org.eclipse.bpmn2.IntermediateCatchEvent)2 BaseCatchingIntermediateEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseCatchingIntermediateEvent)2 IntermediateCompensationEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent)2 IntermediateMessageEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching)2 IntermediateSignalEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventCatching)2 IntermediateTimerEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent)2 CancelActivity (org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)2 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)2 BoundaryEvent (org.eclipse.bpmn2.BoundaryEvent)1 CatchEvent (org.eclipse.bpmn2.CatchEvent)1 CatchEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter)1