Search in sources :

Example 21 with DataIOSet

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

the class BPMNDiagramMarshallerTest method testUnmarshallIntermediateSignalEventThrowing.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateSignalEventThrowing() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_SIGNAL_EVENTTHROWING);
    assertDiagram(diagram, 2);
    assertEquals("intermediateSignalThrowing", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> intermediateEventNode = diagram.getGraph().getNode("_A45EC77D-5414-4348-BA8F-05C4FFD660EE");
    IntermediateSignalEventThrowing intermediateSignalEventThrowing = (IntermediateSignalEventThrowing) intermediateEventNode.getContent().getDefinition();
    assertNotNull(intermediateSignalEventThrowing.getGeneral());
    assertEquals("MySignalThrowingEvent", intermediateSignalEventThrowing.getGeneral().getName().getValue());
    assertEquals("MySignalThrowingEventDocumentation", intermediateSignalEventThrowing.getGeneral().getDocumentation().getValue());
    assertNotNull(intermediateSignalEventThrowing.getExecutionSet());
    assertEquals("processInstance", intermediateSignalEventThrowing.getExecutionSet().getSignalScope().getValue());
    assertEquals("MySignal", intermediateSignalEventThrowing.getExecutionSet().getSignalRef().getValue());
    DataIOSet dataIOSet = intermediateSignalEventThrowing.getDataIOSet();
    AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
    assertEquals("_input1:String||||[din]var1->_input1", assignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) 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) IntermediateSignalEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventThrowing) Test(org.junit.Test)

Example 22 with DataIOSet

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

the class EndEventConverter method errorEventDefinition.

private BpmnNode errorEventDefinition(EndEvent event, ErrorEventDefinition e) {
    Node<View<EndErrorEvent>, Edge> node = factoryManager.newNode(event.getId(), EndErrorEvent.class);
    EndErrorEvent 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 ErrorEventExecutionSet(new ErrorRef(e.getErrorRef().getErrorCode())));
    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) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) ErrorRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef) EndErrorEvent(org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) ErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorEventExecutionSet) 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 23 with DataIOSet

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

the class IntermediateCatchEventConverter method errorEvent.

private BpmnNode errorEvent(CatchEvent event, ErrorEventDefinition e) {
    String nodeId = event.getId();
    Node<View<IntermediateErrorEventCatching>, Edge> node = factoryManager.newNode(nodeId, IntermediateErrorEventCatching.class);
    IntermediateErrorEventCatching 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 CancellingErrorEventExecutionSet(new CancelActivity(p.isCancelActivity()), new ErrorRef(e.getErrorRef().getErrorCode())));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    return BpmnNode.of(node);
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CancellingErrorEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.CancellingErrorEventExecutionSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) 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) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) IntermediateErrorEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateErrorEventCatching) ErrorRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef) Edge(org.kie.workbench.common.stunner.core.graph.Edge) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 24 with DataIOSet

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

the class IntermediateThrowEventConverter method messageEvent.

private BpmnNode messageEvent(IntermediateThrowEvent event, MessageEventDefinition eventDefinition) {
    Node<View<IntermediateMessageEventThrowing>, Edge> node = factoryManager.newNode(event.getId(), IntermediateMessageEventThrowing.class);
    IntermediateMessageEventThrowing 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 MessageEventExecutionSet(new MessageRef(eventDefinition.getMessageRef().getName())));
    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) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) IntermediateMessageEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventThrowing) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) MessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageEventExecutionSet) 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 25 with DataIOSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet 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)

Aggregations

DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)43 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)31 Test (org.junit.Test)30 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)26 Graph (org.kie.workbench.common.stunner.core.graph.Graph)26 MessageRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef)16 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)15 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)12 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)12 Edge (org.kie.workbench.common.stunner.core.graph.Edge)12 View (org.kie.workbench.common.stunner.core.graph.content.view.View)12 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)10 CatchEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader)5 ThrowEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ThrowEventPropertyReader)5 StartErrorEvent (org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent)5 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)5 InterruptingMessageEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet)5 StartMessageEvent (org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent)4 CancelActivity (org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)4 CancellingMessageEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet)4