Search in sources :

Example 1 with StartSignalEvent

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

the class StartEventConverter method signalEvent.

private BpmnNode signalEvent(StartEvent event, SignalEventDefinition e) {
    Node<View<StartSignalEvent>, Edge> node = factoryManager.newNode(event.getId(), StartSignalEvent.class);
    StartSignalEvent definition = node.getContent().getDefinition();
    EventPropertyReader p = propertyReaderFactory.of(event);
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setExecutionSet(new InterruptingSignalEventExecutionSet(new IsInterrupting(event.isIsInterrupting()), new SignalRef(p.getSignalRef())));
    definition.setSimulationSet(p.getSimulationSet());
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    return BpmnNode.of(node);
}
Also used : SignalRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef) StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) IsInterrupting(org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting) InterruptingSignalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) 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 2 with StartSignalEvent

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

the class EventInterruptingViewHandlerTest method testHandleSignalEventIsNotInterrupting.

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

Example 3 with StartSignalEvent

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

the class ProcessSignalRefProviderTest method mockStartSignalEventNode.

private Node mockStartSignalEventNode(String signalRefValue) {
    StartSignalEvent event = new StartSignalEvent();
    event.setExecutionSet(new InterruptingSignalEventExecutionSet(new IsInterrupting(true), new SignalRef(signalRefValue)));
    return mockNode(event);
}
Also used : SignalRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef) StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) IsInterrupting(org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting) InterruptingSignalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet)

Example 4 with StartSignalEvent

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

the class BPMNDirectDiagramMarshallerTest method testUnmarshallStartSignalEvent.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallStartSignalEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_STARTSIGNALEVENT);
    assertDiagram(diagram, 4);
    assertEquals("StartSignalEvent", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> startSignalEventNode = diagram.getGraph().getNode("_1876844A-4DAC-4214-8BCD-2ABA3FCC8EB5");
    StartSignalEvent startSignalEvent = (StartSignalEvent) startSignalEventNode.getContent().getDefinition();
    assertNotNull(startSignalEvent.getExecutionSet());
    SignalRef signalRef = startSignalEvent.getExecutionSet().getSignalRef();
    assertEquals("sig1", signalRef.getValue());
}
Also used : SignalRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef) StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Example 5 with StartSignalEvent

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

the class StartSignalEventTest method testUnmarshallTopLevelEventFilledProperties.

@Test
@Override
public void testUnmarshallTopLevelEventFilledProperties() throws Exception {
    final String EVENT_NAME = "Signal Start Event with Name";
    final String EVENT_DOCUMENTATION = "Non empty\nDocumentation\n~`!@#$%^&*()_+=-{}|\\][:\";'?><,./";
    final String SIGNAL_REF = "Signal1";
    final String EVENT_DATA_OUTPUT = "||event:String||[dout]event->processVar";
    Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH);
    assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM);
    StartSignalEvent filledTop = getStartNodeById(diagram, FILLED_TOP_LEVEL_EVENT_ID, StartSignalEvent.class);
    assertGeneralSet(filledTop.getGeneral(), EVENT_NAME, EVENT_DOCUMENTATION);
    assertSignalEventExecutionSet(filledTop.getExecutionSet(), SIGNAL_REF, INTERRUPTING);
    assertDataIOSet(filledTop.getDataIOSet(), EVENT_DATA_OUTPUT);
}
Also used : StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) Graph(org.kie.workbench.common.stunner.core.graph.Graph) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Aggregations

StartSignalEvent (org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent)12 Test (org.junit.Test)9 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)7 Graph (org.kie.workbench.common.stunner.core.graph.Graph)7 InterruptingSignalEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet)4 SignalRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef)4 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)3 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)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 BaseStartEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent)1 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)1 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)1 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)1 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)1 Edge (org.kie.workbench.common.stunner.core.graph.Edge)1 View (org.kie.workbench.common.stunner.core.graph.content.view.View)1