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));
}
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));
}
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));
}
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));
}
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));
}
Aggregations