Search in sources :

Example 1 with LinkEventExecutionSet

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

the class HashCodeAndEqualityTest method testLinkEventExecutionSet.

@Test
public void testLinkEventExecutionSet() {
    LinkRef link = new LinkRef("link");
    LinkEventExecutionSet executionSet = new LinkEventExecutionSet(link);
    assertNotEquals(executionSet, null);
    assertNotEquals(executionSet, "");
    assertEquals(executionSet, executionSet);
    LinkRef link2 = new LinkRef("link");
    LinkEventExecutionSet executionSet2 = new LinkEventExecutionSet(link2);
    assertEquals(executionSet, executionSet2);
    link2.setValue("link2");
    assertNotEquals(executionSet, executionSet2);
}
Also used : LinkEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet) LinkRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef) Test(org.junit.Test)

Example 2 with LinkEventExecutionSet

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

the class HashCodeAndEqualityTest method testIntermediateLinkCatchEventEquals.

@Test
public void testIntermediateLinkCatchEventEquals() {
    IntermediateLinkEventCatching linkEvent = new IntermediateLinkEventCatching();
    IntermediateLinkEventCatching linkEvent2 = new IntermediateLinkEventCatching();
    assertNotEquals(linkEvent, null);
    assertNotEquals(linkEvent, "");
    assertEquals(linkEvent, linkEvent);
    assertEquals(linkEvent, linkEvent2);
    BackgroundSet backgroundSet = new BackgroundSet();
    backgroundSet.setBgColor(new BgColor("black"));
    linkEvent.setBackgroundSet(backgroundSet);
    assertNotEquals(linkEvent, linkEvent2);
    linkEvent2.setBackgroundSet(backgroundSet);
    assertEquals(linkEvent, linkEvent2);
    linkEvent.setBackgroundSet(backgroundSet);
    linkEvent.setExecutionSet(new LinkEventExecutionSet(new LinkRef("value")));
    assertNotEquals(linkEvent, linkEvent2);
}
Also used : LinkEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) BgColor(org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor) LinkRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef) Test(org.junit.Test)

Example 3 with LinkEventExecutionSet

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

the class IntermediateThrowEventConverter method linkEvent.

protected PropertyWriter linkEvent(Node<View<IntermediateLinkEventThrowing>, ?> n) {
    IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent();
    event.setId(n.getUUID());
    ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
    IntermediateLinkEventThrowing definition = n.getContent().getDefinition();
    p.setAbsoluteBounds(n);
    BPMNGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    LinkEventExecutionSet executionSet = definition.getExecutionSet();
    p.addLink(executionSet.getLinkRef());
    return p;
}
Also used : IntermediateLinkEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventThrowing) LinkEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) IntermediateThrowEvent(org.eclipse.bpmn2.IntermediateThrowEvent) ThrowEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)

Example 4 with LinkEventExecutionSet

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

the class IntermediateCatchEventConverter method linkEvent.

protected Result<BpmnNode> linkEvent(CatchEvent event) {
    String nodeId = event.getId();
    Node<View<IntermediateLinkEventCatching>, Edge> node = factoryManager.newNode(nodeId, IntermediateLinkEventCatching.class);
    IntermediateLinkEventCatching definition = node.getContent().getDefinition();
    CatchEventPropertyReader p = propertyReaderFactory.of(event);
    node.getContent().setBounds(p.getBounds());
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    definition.setExecutionSet(new LinkEventExecutionSet(new LinkRef(p.getLinkRef())));
    return Result.success(BpmnNode.of(node, p));
}
Also used : Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) LinkEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet) IntermediateLinkEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventCatching) CatchEventPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader) Edge(org.kie.workbench.common.stunner.core.graph.Edge) LinkRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef)

Example 5 with LinkEventExecutionSet

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

the class IntermediateCatchEventConverterTest method createIntermediateLinkEventCatchingNode.

private Node createIntermediateLinkEventCatchingNode() {
    LinkEventExecutionSet executionSet = new LinkEventExecutionSet(linkRef);
    IntermediateLinkEventCatching eventCatching = new IntermediateLinkEventCatching(generalSet, mock(BackgroundSet.class), mock(FontSet.class), mock(CircleDimensionSet.class), dataIOSet, advancedData, executionSet);
    Node dockNode = mockNode();
    Node node = mockDockedNode(dockNode, eventCatching);
    return node;
}
Also used : FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) LinkEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) CircleDimensionSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.CircleDimensionSet) IntermediateLinkEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventCatching) Node(org.kie.workbench.common.stunner.core.graph.Node)

Aggregations

LinkEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet)11 LinkRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef)7 IntermediateLinkEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventCatching)4 IntermediateLinkEventThrowing (org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventThrowing)4 BackgroundSet (org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet)4 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)4 Test (org.junit.Test)3 BgColor (org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor)2 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)2 CircleDimensionSet (org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.CircleDimensionSet)2 FontSet (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet)2 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)2 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)2 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)2 Edge (org.kie.workbench.common.stunner.core.graph.Edge)2 Node (org.kie.workbench.common.stunner.core.graph.Node)2 View (org.kie.workbench.common.stunner.core.graph.content.view.View)2 IntermediateThrowEvent (org.eclipse.bpmn2.IntermediateThrowEvent)1 CatchEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter)1 ThrowEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter)1