Search in sources :

Example 6 with StartConditionalEvent

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

the class StartConditionalEventTest method testUnmarshallSubprocessLevelEventFilledProperties.

@Test
@Override
public void testUnmarshallSubprocessLevelEventFilledProperties() throws Exception {
    final String EVENT_NAME = "Conditional event02 ~!@#$%^&*()_+`-={}|[]\\:\";'<>?,./";
    final String EVENT_DOCUMENTATION = "Conditional event02 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 filledSubprocess = getStartNodeById(diagram, FILLED_SUBPROCESS_LEVEL_EVENT_ID);
    assertGeneralSet(filledSubprocess.getGeneral(), EVENT_NAME, EVENT_DOCUMENTATION);
    assertConditionalEventExecutionSet(filledSubprocess.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)

Example 7 with StartConditionalEvent

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

the class StartConditionalEventTest method testUnmarshallTopLevelEmptyEventProperties.

@Test
@Override
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception {
    Diagram<Graph, Metadata> diagram = getDiagram();
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    StartConditionalEvent emptyTop = getStartNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID);
    assertGeneralSet(emptyTop.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
    assertConditionalEventExecutionSet(emptyTop.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, INTERRUPTING, EMPTY_VALUE);
}
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 8 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 BpmnNode conditionalEvent(StartEvent event, ConditionalEventDefinition e) {
    Node<View<StartConditionalEvent>, Edge> node = factoryManager.newNode(event.getId(), StartConditionalEvent.class);
    StartConditionalEvent definition = node.getContent().getDefinition();
    EventPropertyReader p = propertyReaderFactory.of(event);
    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.setSimulationSet(p.getSimulationSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    IsInterrupting isInterrupting = new IsInterrupting(event.isIsInterrupting());
    SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate());
    InterruptingConditionalEventExecutionSet executionSet = new InterruptingConditionalEventExecutionSet(isInterrupting, slaDueDate, p.getConditionExpression(e));
    definition.setExecutionSet(executionSet);
    node.getContent().setBounds(p.getBounds());
    return BpmnNode.of(node, p);
}
Also used : SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) StartConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) IsInterrupting(org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) InterruptingConditionalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.conditional.InterruptingConditionalEventExecutionSet) EventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)

Example 9 with StartConditionalEvent

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

the class EventInterruptingViewHandlerTest method testHandleConditionalIsInterrupting.

@Test
@SuppressWarnings("unchecked")
public void testHandleConditionalIsInterrupting() {
    final StartConditionalEvent bean = new StartConditionalEvent();
    bean.getExecutionSet().getIsInterrupting().setValue(true);
    tested.handle(bean, view);
    verify(prim1).setFillAlpha(eq(1d));
    verify(prim1).setStrokeAlpha(eq(0d));
}
Also used : StartConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent) Test(org.junit.Test)

Example 10 with StartConditionalEvent

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

the class StartConditionalEventTest method testUnmarshallSubprocessLevelEventEmptyProperties.

@Test
@Override
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception {
    Diagram<Graph, Metadata> diagram = getDiagram();
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    StartConditionalEvent emptySubprocess = getStartNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID);
    assertGeneralSet(emptySubprocess.getGeneral(), EMPTY_VALUE, EMPTY_VALUE);
    assertConditionalEventExecutionSet(emptySubprocess.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, NON_INTERRUPTING, EMPTY_VALUE);
}
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