Search in sources :

Example 16 with MessageRef

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef in project kie-wb-common by kiegroup.

the class BPMNDiagramMarshallerTest method testUnmarshallStartMessageEvent.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallStartMessageEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_STARTMESSAGEEVENT);
    assertDiagram(diagram, 2);
    assertEquals("StartMessageEvent", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> startMessageEventNode = diagram.getGraph().getNode("_34C4BBFC-544F-4E23-B17B-547BB48EEB63");
    StartMessageEvent startMessageEvent = (StartMessageEvent) startMessageEventNode.getContent().getDefinition();
    assertNotNull(startMessageEvent.getExecutionSet());
    MessageRef messageRef = startMessageEvent.getExecutionSet().getMessageRef();
    IsInterrupting isInterrupting = startMessageEvent.getExecutionSet().getIsInterrupting();
    assertEquals("msgref", messageRef.getValue());
    assertEquals(true, isInterrupting.getValue());
    DataIOSet dataIOSet = startMessageEvent.getDataIOSet();
    AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
    assertEquals("||StartMessageEventOutputVar1:String||[dout]StartMessageEventOutputVar1->var1", assignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) StartMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent) 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) IsInterrupting(org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting) Test(org.junit.Test)

Example 17 with MessageRef

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef in project kie-wb-common by kiegroup.

the class BPMNDiagramMarshallerTest method testUnmarshallIntermediateMessageEventThrowing.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateMessageEventThrowing() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_MESSAGE_EVENTTHROWING);
    assertDiagram(diagram, 2);
    assertEquals("IntermediateMessageEventThrowing", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> intermediateMessageEventThrowingNode = diagram.getGraph().getNode("_85823DF6-02A0-4B8D-AE7A-61641A3A2E4B");
    IntermediateMessageEventThrowing intermediateMessageEventThrowing = (IntermediateMessageEventThrowing) intermediateMessageEventThrowingNode.getContent().getDefinition();
    assertNotNull(intermediateMessageEventThrowing.getExecutionSet());
    MessageRef messageRef = intermediateMessageEventThrowing.getExecutionSet().getMessageRef();
    assertEquals("msgref", messageRef.getValue());
    DataIOSet dataIOSet = intermediateMessageEventThrowing.getDataIOSet();
    AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
    assertEquals("IntermediateMessageEventThrowingInputVar1:String||||[din]var1->IntermediateMessageEventThrowingInputVar1", 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) IntermediateMessageEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventThrowing) Test(org.junit.Test)

Example 18 with MessageRef

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef in project kie-wb-common by kiegroup.

the class HashCodeAndEqualityTest method testStartMessageEventEquals.

@Test
public void testStartMessageEventEquals() {
    final String MESSAGE_REF = "message ref";
    final InterruptingMessageEventExecutionSet A_EXECUTION_SET = new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new MessageRef(MESSAGE_REF));
    final InterruptingMessageEventExecutionSet B_EXECUTION_SET = new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new MessageRef(MESSAGE_REF));
    final InterruptingMessageEventExecutionSet C_EXECUTION_SET = new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new MessageRef("Other value"));
    final InterruptingMessageEventExecutionSet D_EXECUTION_SET = new InterruptingMessageEventExecutionSet(new IsInterrupting(true), new MessageRef(MESSAGE_REF));
    final String ASSIGNMENT_INFO = "some value";
    final DataIOSet A_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
    final DataIOSet B_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
    final DataIOSet C_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
    final DataIOSet D_DATA_SET = new DataIOSet(new AssignmentsInfo("Other value"));
    StartMessageEvent.StartMessageEventBuilder builder = new StartMessageEvent.StartMessageEventBuilder();
    StartMessageEvent a = builder.build();
    a.setExecutionSet(A_EXECUTION_SET);
    a.setDataIOSet(A_DATA_SET);
    builder = new StartMessageEvent.StartMessageEventBuilder();
    StartMessageEvent b = builder.build();
    b.setExecutionSet(B_EXECUTION_SET);
    b.setDataIOSet(B_DATA_SET);
    builder = new StartMessageEvent.StartMessageEventBuilder();
    StartMessageEvent c = builder.build();
    c.setExecutionSet(C_EXECUTION_SET);
    c.setDataIOSet(C_DATA_SET);
    builder = new StartMessageEvent.StartMessageEventBuilder();
    StartMessageEvent d = builder.build();
    d.setExecutionSet(D_EXECUTION_SET);
    d.setDataIOSet(D_DATA_SET);
    assertEquals(a, a);
    assertEquals(a, b);
    assertNotEquals(a, c);
    assertNotEquals(a, d);
    assertNotEquals(a, 19);
    assertNotEquals(a, null);
    a.setExecutionSet(null);
    assertNotEquals(a, b);
    assertNotEquals(b, a);
    assertNotEquals(a, c);
    assertNotEquals(a, d);
    a.setExecutionSet(A_EXECUTION_SET);
    assertEquals(a, b);
    assertNotEquals(a, c);
    assertNotEquals(a, d);
    a.setDataIOSet(null);
    assertNotEquals(a, b);
    assertNotEquals(b, a);
    assertNotEquals(a, c);
    assertNotEquals(a, d);
    EndSignalEvent.EndSignalEventBuilder builderSignal = new EndSignalEvent.EndSignalEventBuilder();
    EndSignalEvent e = builderSignal.build();
    assertNotEquals(a, e);
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) InterruptingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet) IsInterrupting(org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting) Test(org.junit.Test)

Example 19 with MessageRef

use of org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef in project kie-wb-common by kiegroup.

the class HashCodeAndEqualityTest method IntermediateMessageEventThrowingEquals.

@Test
public void IntermediateMessageEventThrowingEquals() {
    final String MESSAGE_REF = "message ref";
    final MessageEventExecutionSet A_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF));
    final MessageEventExecutionSet B_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF));
    final MessageEventExecutionSet C_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef("Other value"));
    final MessageEventExecutionSet D_EXECUTION_SET = new MessageEventExecutionSet(new MessageRef(MESSAGE_REF));
    final String ASSIGNMENT_INFO = "some value";
    final DataIOSet A_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
    final DataIOSet B_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
    final DataIOSet C_DATA_SET = new DataIOSet(new AssignmentsInfo(ASSIGNMENT_INFO));
    final DataIOSet D_DATA_SET = new DataIOSet(new AssignmentsInfo("Other value"));
    IntermediateMessageEventThrowing.IntermediateMessageEventThrowingBuilder builder = new IntermediateMessageEventThrowing.IntermediateMessageEventThrowingBuilder();
    IntermediateMessageEventThrowing a = builder.build();
    a.setExecutionSet(A_EXECUTION_SET);
    a.setDataIOSet(A_DATA_SET);
    builder = new IntermediateMessageEventThrowing.IntermediateMessageEventThrowingBuilder();
    IntermediateMessageEventThrowing b = builder.build();
    b.setExecutionSet(B_EXECUTION_SET);
    b.setDataIOSet(B_DATA_SET);
    builder = new IntermediateMessageEventThrowing.IntermediateMessageEventThrowingBuilder();
    IntermediateMessageEventThrowing c = builder.build();
    c.setExecutionSet(C_EXECUTION_SET);
    c.setDataIOSet(C_DATA_SET);
    builder = new IntermediateMessageEventThrowing.IntermediateMessageEventThrowingBuilder();
    IntermediateMessageEventThrowing d = builder.build();
    d.setExecutionSet(D_EXECUTION_SET);
    d.setDataIOSet(D_DATA_SET);
    assertEquals(a, a);
    assertEquals(a, b);
    assertNotEquals(a, c);
    assertNotEquals(a, d);
    assertNotEquals(a, 19);
    assertNotEquals(a, null);
    a.setExecutionSet(null);
    assertNotEquals(a, b);
    assertNotEquals(b, a);
    assertNotEquals(a, c);
    assertNotEquals(a, d);
    a.setExecutionSet(A_EXECUTION_SET);
    assertEquals(a, b);
    assertNotEquals(a, c);
    assertNotEquals(a, d);
    a.setDataIOSet(null);
    assertNotEquals(a, b);
    assertNotEquals(b, a);
    assertNotEquals(a, c);
    assertNotEquals(a, d);
    EndSignalEvent.EndSignalEventBuilder builderSignal = new EndSignalEvent.EndSignalEventBuilder();
    EndSignalEvent e = builderSignal.build();
    assertNotEquals(a, e);
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) CancellingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet) MessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageEventExecutionSet) InterruptingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet) Test(org.junit.Test)

Aggregations

MessageRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef)19 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)16 Test (org.junit.Test)12 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)12 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)8 Graph (org.kie.workbench.common.stunner.core.graph.Graph)8 CancellingMessageEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet)6 InterruptingMessageEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet)6 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)5 MessageEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageEventExecutionSet)5 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)4 EndMessageEvent (org.kie.workbench.common.stunner.bpmn.definition.EndMessageEvent)4 IntermediateMessageEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching)4 StartMessageEvent (org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent)4 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)4 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)4 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)4 Edge (org.kie.workbench.common.stunner.core.graph.Edge)4 View (org.kie.workbench.common.stunner.core.graph.content.view.View)4 IntermediateMessageEventThrowing (org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventThrowing)3