Search in sources :

Example 1 with EndSignalEvent

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

the class EndEventConverter method signalEventDefinition.

private BpmnNode signalEventDefinition(EndEvent event, SignalEventDefinition nodeId) {
    Node<View<EndSignalEvent>, Edge> node = factoryManager.newNode(event.getId(), EndSignalEvent.class);
    EndSignalEvent definition = node.getContent().getDefinition();
    EventPropertyReader p = propertyReaderFactory.of(event);
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    definition.setExecutionSet(new ScopedSignalEventExecutionSet(new SignalRef(p.getSignalRef()), new SignalScope(p.getSignalScope())));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    return BpmnNode.of(node);
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SignalRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef) ScopedSignalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.ScopedSignalEventExecutionSet) EndSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.EndSignalEvent) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) SignalScope(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalScope) 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) ThrowEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ThrowEventPropertyReader) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)

Example 2 with EndSignalEvent

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

the class BPMNDirectDiagramMarshallerTest method testUnmarshallEndSignalEvent.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallEndSignalEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDSIGNALEVENT);
    assertDiagram(diagram, 2);
    assertEquals("EndEventAssignments", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> endSignalEventNode = diagram.getGraph().getNode("_C9151E0C-2E3E-4558-AFC2-34038E3A8552");
    EndSignalEvent endSignalEvent = (EndSignalEvent) endSignalEventNode.getContent().getDefinition();
    DataIOSet dataIOSet = endSignalEvent.getDataIOSet();
    AssignmentsInfo assignmentsinfo = dataIOSet.getAssignmentsinfo();
    assertEquals("EndSignalEventInput1:String||||[din]employee->EndSignalEventInput1", assignmentsinfo.getValue());
    assertEquals("project", endSignalEvent.getExecutionSet().getSignalScope().getValue());
    assertEquals("employee", endSignalEvent.getExecutionSet().getSignalRef().getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) EndSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.EndSignalEvent) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Example 3 with EndSignalEvent

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

the class ProcessSignalRefProviderTest method mockEndSignalEventNode.

private Node mockEndSignalEventNode(String signalRefValue) {
    EndSignalEvent event = new EndSignalEvent();
    event.setExecutionSet(new ScopedSignalEventExecutionSet(new SignalRef(signalRefValue), new SignalScope()));
    return mockNode(event);
}
Also used : SignalRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef) ScopedSignalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.ScopedSignalEventExecutionSet) EndSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.EndSignalEvent) SignalScope(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalScope)

Example 4 with EndSignalEvent

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

the class BPMNDiagramMarshallerTest method testUnmarshallEndSignalEvent.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallEndSignalEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDSIGNALEVENT);
    assertDiagram(diagram, 2);
    assertEquals("EndEventAssignments", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> endSignalEventNode = diagram.getGraph().getNode("_C9151E0C-2E3E-4558-AFC2-34038E3A8552");
    EndSignalEvent endSignalEvent = (EndSignalEvent) endSignalEventNode.getContent().getDefinition();
    DataIOSet dataIOSet = endSignalEvent.getDataIOSet();
    AssignmentsInfo assignmentsinfo = dataIOSet.getAssignmentsinfo();
    assertEquals("EndSignalEventInput1:String||||[din]employee->EndSignalEventInput1", assignmentsinfo.getValue());
    assertEquals("project", endSignalEvent.getExecutionSet().getSignalScope().getValue());
    assertEquals("employee", endSignalEvent.getExecutionSet().getSignalRef().getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) EndSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.EndSignalEvent) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Example 5 with EndSignalEvent

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

the class EndEventConverter method signalEvent.

private PropertyWriter signalEvent(Node<View<EndSignalEvent>, ?> n) {
    EndEvent event = bpmn2.createEndEvent();
    event.setId(n.getUUID());
    EndSignalEvent definition = n.getContent().getDefinition();
    ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    p.addSignal(definition.getExecutionSet().getSignalRef());
    p.setBounds(n.getContent().getBounds());
    return p;
}
Also used : EndSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.EndSignalEvent) BaseEndEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseEndEvent) EndEvent(org.eclipse.bpmn2.EndEvent) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) ThrowEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)

Aggregations

EndSignalEvent (org.kie.workbench.common.stunner.bpmn.definition.EndSignalEvent)5 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)3 Test (org.junit.Test)2 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)2 ScopedSignalEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.ScopedSignalEventExecutionSet)2 SignalRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef)2 SignalScope (org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalScope)2 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)2 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)2 Graph (org.kie.workbench.common.stunner.core.graph.Graph)2 EndEvent (org.eclipse.bpmn2.EndEvent)1 ThrowEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)1 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)1 ThrowEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ThrowEventPropertyReader)1 BaseEndEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseEndEvent)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