Search in sources :

Example 6 with LinkRef

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

the class ProcessLinkRefProviderTest method mockIntermediateLinkEventCatchingNode.

private Node mockIntermediateLinkEventCatchingNode(String linkRefValue) {
    IntermediateLinkEventCatching event = new IntermediateLinkEventCatching();
    event.setExecutionSet(new LinkEventExecutionSet(new LinkRef(linkRefValue)));
    return mockNode(event);
}
Also used : LinkEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet) IntermediateLinkEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventCatching) LinkRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef)

Example 7 with LinkRef

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

the class IntermediateThrowEventConverterTest method setUp.

@Before
public void setUp() {
    Event throwEvent = bpmn2.createIntermediateThrowEvent();
    throwEvent.setId("throwEventID");
    throwEventPropertyWriter = spy(new ThrowEventPropertyWriter((ThrowEvent) throwEvent, new FlatVariableScope(), new HashSet<>()));
    propertyWriterFactory = spy(PropertyWriterFactory.class);
    when(propertyWriterFactory.of(any(ThrowEvent.class))).thenReturn(throwEventPropertyWriter);
    generalSet = new BPMNGeneralSet(NAME, DOCUMENTATION);
    assignmentsInfo = new AssignmentsInfo(ASSIGNMENTS_INFO);
    dataIOSet = new DataIOSet(assignmentsInfo);
    advancedData = new AdvancedData();
    signalRef = mock(SignalRef.class);
    signalScope = mock(SignalScope.class);
    linkRef = mock(LinkRef.class);
    messageRef = mock(MessageRef.class);
    escalationRef = mock(EscalationRef.class);
    tested = spy(new IntermediateThrowEventConverter(propertyWriterFactory));
}
Also used : ThrowEvent(org.eclipse.bpmn2.ThrowEvent) SignalRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) PropertyWriterFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) ThrowEvent(org.eclipse.bpmn2.ThrowEvent) BaseThrowingIntermediateEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseThrowingIntermediateEvent) Event(org.eclipse.bpmn2.Event) FlatVariableScope(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.FlatVariableScope) SignalScope(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalScope) EscalationRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef) ThrowEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ThrowEventPropertyWriter) LinkRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef) Before(org.junit.Before)

Example 8 with LinkRef

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

the class HashCodeAndEqualityTest method testIntermediateLinkThrowingEventEquals.

@Test
public void testIntermediateLinkThrowingEventEquals() {
    IntermediateLinkEventThrowing linkEvent = new IntermediateLinkEventThrowing();
    IntermediateLinkEventThrowing linkEvent2 = new IntermediateLinkEventThrowing();
    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 9 with LinkRef

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

the class HashCodeAndEqualityTest method testLinkRef.

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

Example 10 with LinkRef

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

the class IntermediateThrowEventConverter method linkEvent.

protected BpmnNode linkEvent(IntermediateThrowEvent event) {
    Node<View<IntermediateLinkEventThrowing>, Edge> node = factoryManager.newNode(event.getId(), IntermediateLinkEventThrowing.class);
    IntermediateLinkEventThrowing definition = node.getContent().getDefinition();
    EventPropertyReader p = propertyReaderFactory.of(event);
    node.getContent().setBounds(p.getBounds());
    definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    definition.setDimensionsSet(p.getCircleDimensionSet());
    definition.setFontSet(p.getFontSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
    definition.setExecutionSet(new LinkEventExecutionSet(new LinkRef(p.getLinkRef())));
    return BpmnNode.of(node, p);
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) IntermediateLinkEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventThrowing) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) LinkEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet) 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) Edge(org.kie.workbench.common.stunner.core.graph.Edge) 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) LinkRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef)

Aggregations

LinkRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef)10 LinkEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkEventExecutionSet)7 Test (org.junit.Test)4 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)4 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)4 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)4 Event (org.eclipse.bpmn2.Event)2 Before (org.junit.Before)2 FlatVariableScope (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.FlatVariableScope)2 PropertyWriterFactory (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory)2 IntermediateLinkEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventCatching)2 IntermediateLinkEventThrowing (org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventThrowing)2 BackgroundSet (org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet)2 BgColor (org.kie.workbench.common.stunner.bpmn.definition.property.background.BgColor)2 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)2 EscalationRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef)2 MessageRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef)2 SignalRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef)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