Search in sources :

Example 1 with StartConditionalEvent

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;
}
Also used : CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) StartEvent(org.eclipse.bpmn2.StartEvent) BaseStartEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent) StartConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) InterruptingConditionalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.conditional.InterruptingConditionalEventExecutionSet)

Example 2 with StartConditionalEvent

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));
}
Also used : BaseStartEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent) StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) StartMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent) StartTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent) StartEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.StartEscalationEvent) StartConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent) StartErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) StartCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent) Test(org.junit.Test)

Example 3 with StartConditionalEvent

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));
}
Also used : StartConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent) Test(org.junit.Test)

Example 4 with StartConditionalEvent

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());
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) StartConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent) Test(org.junit.Test)

Example 5 with StartConditionalEvent

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);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) StartConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent) Test(org.junit.Test)

Aggregations

StartConditionalEvent (org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent)11 Test (org.junit.Test)9 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)5 Graph (org.kie.workbench.common.stunner.core.graph.Graph)5 BaseStartEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent)3 StartEscalationEvent (org.kie.workbench.common.stunner.bpmn.definition.StartEscalationEvent)2 StartMessageEvent (org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent)2 StartSignalEvent (org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent)2 StartTimerEvent (org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent)2 InterruptingConditionalEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.conditional.InterruptingConditionalEventExecutionSet)2 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)2 StartEvent (org.eclipse.bpmn2.StartEvent)1 CatchEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter)1 CatchEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader)1 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)1 StartCompensationEvent (org.kie.workbench.common.stunner.bpmn.definition.StartCompensationEvent)1 StartErrorEvent (org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent)1 StartNoneEvent (org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent)1 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)1 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)1