use of org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent in project kie-wb-common by kiegroup.
the class StartEventConverter method conditionalEvent.
private PropertyWriter conditionalEvent(Node<View<StartConditionalEvent>, ?> n) {
StartEvent event = bpmn2.createStartEvent();
event.setId(n.getUUID());
StartConditionalEvent definition = n.getContent().getDefinition();
CatchEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
p.setSimulationSet(definition.getSimulationSet());
InterruptingConditionalEventExecutionSet executionSet = definition.getExecutionSet();
event.setIsInterrupting(executionSet.getIsInterrupting().getValue());
p.addSlaDueDate(executionSet.getSlaDueDate());
p.setAbsoluteBounds(n);
p.addCondition(executionSet.getConditionExpression());
return p;
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent in project kie-wb-common by kiegroup.
the class StartEventFilterProviderFactoryTest method testFilterProviderHideIsInterruptingField.
@Test
public void testFilterProviderHideIsInterruptingField() {
BaseStartEvent[] test1Classes = { new StartNoneEvent(), new StartCompensationEvent(), new StartSignalEvent(), new StartTimerEvent(), new StartConditionalEvent(), new StartErrorEvent(), new StartEscalationEvent(), new StartMessageEvent() };
when(parentView.getDefinition()).thenReturn(otherNode);
Stream.of(test1Classes).forEach(catchingIntermediateEvent -> testStartEventFilterProviderHideIsInterruptingField(catchingIntermediateEvent));
BaseStartEvent[] test2Classes = { new StartNoneEvent(), new StartCompensationEvent(), new StartErrorEvent() };
when(parentView.getDefinition()).thenReturn(eventSubprocess);
Stream.of(test2Classes).forEach(clazz -> testStartEventFilterProviderHideIsInterruptingField(clazz));
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent in project kie-wb-common by kiegroup.
the class EventInterruptingViewHandlerTest method testHandleConditionalIsNotInterrupting.
@Test
@SuppressWarnings("unchecked")
public void testHandleConditionalIsNotInterrupting() {
final StartConditionalEvent bean = new StartConditionalEvent();
bean.getExecutionSet().getIsInterrupting().setValue(false);
tested.handle(bean, view);
verify(prim1).setFillAlpha(eq(0d));
verify(prim1).setStrokeAlpha(eq(1d));
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallStartConditionalEvent.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallStartConditionalEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_STARTCONDITIONALEVENT);
assertDiagram(diagram, 2);
assertEquals("StartConditionalEvent", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> startEventNode = diagram.getGraph().getNode("_8F9C10C4-F1EE-4B49-B4CE-3059ADD4B391");
assertNotNull(startEventNode);
StartConditionalEvent startConditionalEvent = (StartConditionalEvent) startEventNode.getContent().getDefinition();
assertNotNull(startConditionalEvent.getGeneral());
assertEquals("StartConditionalEventName", startConditionalEvent.getGeneral().getName().getValue());
assertEquals("StartConditionalEventDocumentation", startConditionalEvent.getGeneral().getDocumentation().getValue());
assertNotNull(startConditionalEvent.getExecutionSet());
assertEquals("drools", startConditionalEvent.getExecutionSet().getConditionExpression().getValue().getLanguage());
assertEquals("StartConditionalEventConditionExpression", startConditionalEvent.getExecutionSet().getConditionExpression().getValue().getScript());
assertEquals(true, startConditionalEvent.getExecutionSet().getIsInterrupting().getValue());
assertEquals("12/25/1983", startConditionalEvent.getExecutionSet().getSlaDueDate().getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent in project kie-wb-common by kiegroup.
the class StartConditionalEventTest method testUnmarshallTopLevelEventFilledProperties.
@Test
@Override
public void testUnmarshallTopLevelEventFilledProperties() throws Exception {
final String EVENT_NAME = "Conditional event01 ~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./";
final String EVENT_DOCUMENTATION = "Conditional event01 doc\n ~!@#$%^&*()_+`1234567890-={}|[]\\:\";'<>?,./";
final String CONDITION_EXPRESSION_SCRIPT = "com.myspace.testproject.Person(name == \"John\")";
Diagram<Graph, Metadata> diagram = getDiagram();
assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
StartConditionalEvent filledTop = getStartNodeById(diagram, FILLED_TOP_LEVEL_EVENT_ID);
assertGeneralSet(filledTop.getGeneral(), EVENT_NAME, EVENT_DOCUMENTATION);
assertConditionalEventExecutionSet(filledTop.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, INTERRUPTING, SLA_DUE_DATE);
}
Aggregations