Search in sources :

Example 41 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 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 42 with DataIOSet

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

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

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