Search in sources :

Example 1 with IntermediateMessageEventCatching

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

the class IntermediateCatchEventConverter method messageEvent.

private BpmnNode messageEvent(CatchEvent event, MessageEventDefinition e) {
    String nodeId = event.getId();
    Node<View<IntermediateMessageEventCatching>, Edge> node = factoryManager.newNode(nodeId, IntermediateMessageEventCatching.class);
    IntermediateMessageEventCatching 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 CancellingMessageEventExecutionSet(new CancelActivity(p.isCancelActivity()), new MessageRef(e.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 : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) CancellingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet) 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) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) Edge(org.kie.workbench.common.stunner.core.graph.Edge) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 2 with IntermediateMessageEventCatching

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

the class IntermediateCatchEventConverter method messageEvent.

private PropertyWriter messageEvent(Node<View<IntermediateMessageEventCatching>, ?> n) {
    CatchEventPropertyWriter p = createCatchEventPropertyWriter(n);
    p.getFlowElement().setId(n.getUUID());
    IntermediateMessageEventCatching definition = n.getContent().getDefinition();
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    CancellingMessageEventExecutionSet executionSet = definition.getExecutionSet();
    p.addMessage(executionSet.getMessageRef());
    p.setBounds(n.getContent().getBounds());
    return p;
}
Also used : CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CancellingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet)

Example 3 with IntermediateMessageEventCatching

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

the class ProcessMessageRefProviderTest method mockIntermediateMessageEventCatchingNode.

private Element mockIntermediateMessageEventCatchingNode(String messageRefValue) {
    IntermediateMessageEventCatching event = new IntermediateMessageEventCatching();
    event.setExecutionSet(new CancellingMessageEventExecutionSet(new CancelActivity(true), new MessageRef(messageRefValue)));
    return mockNode(event);
}
Also used : MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) CancellingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet) CancelActivity(org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)

Example 4 with IntermediateMessageEventCatching

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

the class BPMNDirectDiagramMarshallerTest method testUnmarshallIntermediateMessageEventCatching.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateMessageEventCatching() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_MESSAGE_EVENTCATCHING);
    assertDiagram(diagram, 2);
    assertEquals("IntermediateMessageEventCatching", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> intermediateMessageEventCatchingNode = diagram.getGraph().getNode("_BD708E30-CA48-4051-BAEA-BBCB5F396CEE");
    IntermediateMessageEventCatching intermediateMessageEventCatching = (IntermediateMessageEventCatching) intermediateMessageEventCatchingNode.getContent().getDefinition();
    assertNotNull(intermediateMessageEventCatching.getExecutionSet());
    MessageRef messageRef = intermediateMessageEventCatching.getExecutionSet().getMessageRef();
    assertEquals("msgref1", messageRef.getValue());
    DataIOSet dataIOSet = intermediateMessageEventCatching.getDataIOSet();
    AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
    assertEquals("||IntermediateMessageEventCatchingOutputVar1:String||[dout]IntermediateMessageEventCatchingOutputVar1->var1", assignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) Test(org.junit.Test)

Example 5 with IntermediateMessageEventCatching

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

the class BPMNDiagramMarshallerTest method testUnmarshallIntermediateMessageEventCatching.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateMessageEventCatching() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_MESSAGE_EVENTCATCHING);
    assertDiagram(diagram, 2);
    assertEquals("IntermediateMessageEventCatching", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> intermediateMessageEventCatchingNode = diagram.getGraph().getNode("_BD708E30-CA48-4051-BAEA-BBCB5F396CEE");
    IntermediateMessageEventCatching intermediateMessageEventCatching = (IntermediateMessageEventCatching) intermediateMessageEventCatchingNode.getContent().getDefinition();
    assertNotNull(intermediateMessageEventCatching.getExecutionSet());
    MessageRef messageRef = intermediateMessageEventCatching.getExecutionSet().getMessageRef();
    assertEquals("msgref1", messageRef.getValue());
    DataIOSet dataIOSet = intermediateMessageEventCatching.getDataIOSet();
    AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
    assertEquals("||IntermediateMessageEventCatchingOutputVar1:String||[dout]IntermediateMessageEventCatchingOutputVar1->var1", assignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) Test(org.junit.Test)

Aggregations

IntermediateMessageEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching)7 Test (org.junit.Test)4 MessageRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef)4 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)3 CancellingMessageEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet)3 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)2 CancelActivity (org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)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 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 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