Search in sources :

Example 1 with InterruptingSignalEventExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet 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 InterruptingSignalEventExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet 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 3 with InterruptingSignalEventExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet 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 4 with InterruptingSignalEventExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet 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)4 InterruptingSignalEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet)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 SignalRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef)2 StartEvent (org.eclipse.bpmn2.StartEvent)1 Test (org.junit.Test)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 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)1 Edge (org.kie.workbench.common.stunner.core.graph.Edge)1 Graph (org.kie.workbench.common.stunner.core.graph.Graph)1 View (org.kie.workbench.common.stunner.core.graph.content.view.View)1