Search in sources :

Example 11 with StartSignalEvent

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

the class BPMNDiagramMarshallerTest method testUnmarshallIsInterruptingStartSignalEvent.

@Test
public void testUnmarshallIsInterruptingStartSignalEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVENT_SUBPROCESS_STARTSIGNALEVENT);
    assertDiagram(diagram, 7);
    assertEquals("EventSubprocessStartSignalEvent", diagram.getMetadata().getTitle());
    // Check first start event with all FILLED properties
    Node<? extends Definition, ?> startEventNode = diagram.getGraph().getNode("_B6B3A062-F04A-4E45-A08B-C1F0971C3DF9");
    StartSignalEvent startSignalEvent = (StartSignalEvent) startEventNode.getContent().getDefinition();
    BPMNGeneralSet eventGeneralSet = startSignalEvent.getGeneral();
    assertNotNull(eventGeneralSet);
    assertEquals("StartSignalEvent", eventGeneralSet.getName().getValue());
    assertEquals("Some not empty\nDocumentation\n~`!@#$%^&*()_+=-{}|[]\\:\";'<>/?.,", eventGeneralSet.getDocumentation().getValue());
    InterruptingSignalEventExecutionSet eventExecutionSet = startSignalEvent.getExecutionSet();
    assertNotNull(eventExecutionSet);
    assertNotNull(eventExecutionSet.getSignalRef());
    assertEquals("Signal1", eventExecutionSet.getSignalRef().getValue());
    assertEquals(true, eventExecutionSet.getIsInterrupting().getValue());
    DataIOSet eventDataIOSet = startSignalEvent.getDataIOSet();
    AssignmentsInfo assignmentsInfo = eventDataIOSet.getAssignmentsinfo();
    assertEquals("||Var1:String||[dout]Var1->Var1", assignmentsInfo.getValue());
    // Check second start event with all EMPTY properties
    Node<? extends Definition, ?> emptyEventNode = diagram.getGraph().getNode("_A8B9513C-D237-4BDA-B7BC-7C79F7D12BB5");
    StartSignalEvent emptySignalEvent = (StartSignalEvent) emptyEventNode.getContent().getDefinition();
    BPMNGeneralSet emptyEventGeneralSet = emptySignalEvent.getGeneral();
    assertNotNull(emptyEventGeneralSet);
    assertEquals("", emptyEventGeneralSet.getName().getValue());
    assertEquals("", emptyEventGeneralSet.getDocumentation().getValue());
    InterruptingSignalEventExecutionSet emptyExecutionSet = emptySignalEvent.getExecutionSet();
    assertNotNull(emptyExecutionSet);
    assertNotNull(emptyExecutionSet.getSignalRef());
    assertEquals("", emptyExecutionSet.getSignalRef().getValue());
    assertEquals(false, emptyExecutionSet.getIsInterrupting().getValue());
    DataIOSet emptyDataIOSet = emptySignalEvent.getDataIOSet();
    AssignmentsInfo emptyAssignmentsInfo = emptyDataIOSet.getAssignmentsinfo();
    assertEquals("", emptyAssignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) Graph(org.kie.workbench.common.stunner.core.graph.Graph) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) InterruptingSignalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet) Test(org.junit.Test)

Example 12 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 PropertyWriter signalEvent(Node<View<StartSignalEvent>, ?> n) {
    StartEvent event = bpmn2.createStartEvent();
    event.setId(n.getUUID());
    StartSignalEvent definition = n.getContent().getDefinition();
    CatchEventPropertyWriter p = propertyWriterFactory.of(event);
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getName().getValue());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    InterruptingSignalEventExecutionSet executionSet = definition.getExecutionSet();
    p.addSignal(executionSet.getSignalRef());
    p.setBounds(n.getContent().getBounds());
    return p;
}
Also used : StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) 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) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) InterruptingSignalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet)

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