Search in sources :

Example 1 with StartTimerEvent

use of org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent 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 2 with StartTimerEvent

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

the class EventInterruptingViewHandlerTest method testHandleTimerIsNotInterrupting.

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

Example 3 with StartTimerEvent

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

the class EventInterruptingViewHandlerTest method testHandleTimerIsInterrupting.

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

Example 4 with StartTimerEvent

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

the class BPMNDirectDiagramMarshallerTest method testUnmarshallStartTimerEvent.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallStartTimerEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_STARTTIMEREVENT);
    assertDiagram(diagram, 4);
    assertEquals("StartTimerEvent", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> startTimerEventNode = diagram.getGraph().getNode("_49ADC988-B63D-4AEB-B811-67969F305FD0");
    StartTimerEvent startTimerEvent = (StartTimerEvent) startTimerEventNode.getContent().getDefinition();
    IsInterrupting isInterrupting = startTimerEvent.getExecutionSet().getIsInterrupting();
    assertEquals(false, isInterrupting.getValue());
    assertEquals("12/25/1983", startTimerEvent.getExecutionSet().getSlaDueDate().getValue());
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) StartTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) IsInterrupting(org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting) Test(org.junit.Test)

Example 5 with StartTimerEvent

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

the class StartTimerEventTest method testUnmarshallSubprocessLevelEventFilledProperties.

@Test
@Override
public void testUnmarshallSubprocessLevelEventFilledProperties() throws Exception {
    final String EVENT_NAME_MULTIPLE = "~`!@#$%^&*()_+=-{}|\\][:\";'?><,./ name";
    final String EVENT_DOCUMENTATION_MULTIPLE = "Some documentation for this event\n\n~`!@#$%^&*()_+=-{}|\\][:\";'?><,./";
    final String TIMER_VALUE_MULTIPLE = "R3/PT8M3S";
    // "none" is a "not a cron" for engine and looks like ISO in GUI
    final String TIMER_VALUE_LANGUAGE_MULTIPLE = "none";
    // Should be uncommented after https://issues.jboss.org/browse/JBPM-7038 will be fixed
    // final String timerDataOutputMultiple = "||hello:String||[dout]hello->processVar";
    final String EVENT_NAME_SPECIFIC_DATE = "~`!@#$%^&*()_+=-{}|\\][:\";'?><,./ hello how are you?";
    final String EVENT_DOCUMENTATION_SPECIFIC_DATE = "~`!@#$%^&*()_+=-{}|\\][:\";'?><,./\ndocumentaion";
    final String TIMER_VALUE_SPECIFIC_DATE = "2018-03-16T13:50:59+01:00";
    // Should be uncommented after https://issues.jboss.org/browse/JBPM-7038 will be fixed
    // final String timerDataOutputSpecificDate = "||hello:String||[dout]hello->processVar";
    final String EVENT_NAME_AFTER_DURATION = "\"non empty name\"";
    final String EVENT_DOCUMENTATION_AFTER_DURATION = "Time is here: ~`!@#$%^&*()_+=-{}|\\][:\";'?><,./";
    final String TIMER_VALUE_AFTER_DURATION = "PT1H15M";
    // Should be uncommented after https://issues.jboss.org/browse/JBPM-7038 will be fixed
    // final String timerDataOutputDuration = "||hello:String||[dout]hello->processVar";
    Diagram<Graph, Metadata> diagram = getDiagram();
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    StartTimerEvent filledTopMultiple = getStartNodeById(diagram, FILLED_SUBPROCESS_LEVEL_EVENT_MULTIPLE_ID);
    assertGeneralSet(filledTopMultiple.getGeneral(), EVENT_NAME_MULTIPLE, EVENT_DOCUMENTATION_MULTIPLE);
    assertTimerEventMultiple(filledTopMultiple.getExecutionSet(), TIMER_VALUE_MULTIPLE, TIMER_VALUE_LANGUAGE_MULTIPLE, INTERRUPTING, SLA_DUE_DATE);
    // Know issue. Should be uncommented after https://issues.jboss.org/browse/JBPM-7038 will be fixed
    // assertDataIOSet(filledTopMultiple.getDataIOSet(), timerDataOutputMultiple);
    StartTimerEvent filledTopSpecificDate = getStartNodeById(diagram, FILLED_SUBPROCESS_LEVEL_EVENT_SPECIFIC_DATE_ID);
    assertGeneralSet(filledTopSpecificDate.getGeneral(), EVENT_NAME_SPECIFIC_DATE, EVENT_DOCUMENTATION_SPECIFIC_DATE);
    assertTimerEventSpecificDate(filledTopSpecificDate.getExecutionSet(), TIMER_VALUE_SPECIFIC_DATE, INTERRUPTING, SLA_DUE_DATE);
    // Know issue. Should be uncommented after https://issues.jboss.org/browse/JBPM-7038 will be fixed
    // assertDataIOSet(filledTopSpecificDate.getDataIOSet(), timerDataOutputSpecificDate);
    StartTimerEvent filledTopAfterDuration = getStartNodeById(diagram, FILLED_SUBPROCESS_LEVEL_EVENT_AFTER_DURATION_ID);
    assertGeneralSet(filledTopAfterDuration.getGeneral(), EVENT_NAME_AFTER_DURATION, EVENT_DOCUMENTATION_AFTER_DURATION);
    assertTimerEventAfterDuration(filledTopAfterDuration.getExecutionSet(), TIMER_VALUE_AFTER_DURATION, INTERRUPTING, SLA_DUE_DATE);
// Know issue. Should be uncommented after https://issues.jboss.org/browse/JBPM-7038 will be fixed
// assertDataIOSet(filledTopSpecificDate.getDataIOSet(), timerDataOutputDuration);
}
Also used : Graph(org.kie.workbench.common.stunner.core.graph.Graph) StartTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Aggregations

StartTimerEvent (org.kie.workbench.common.stunner.bpmn.definition.StartTimerEvent)13 Test (org.junit.Test)11 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)7 Graph (org.kie.workbench.common.stunner.core.graph.Graph)7 BaseStartEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent)3 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)3 InterruptingTimerEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.InterruptingTimerEventExecutionSet)3 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)3 StartConditionalEvent (org.kie.workbench.common.stunner.bpmn.definition.StartConditionalEvent)2 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 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 TimerSettings (org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettings)1