Search in sources :

Example 6 with LinkEventDefinition

use of org.eclipse.bpmn2.LinkEventDefinition in project kie-wb-common by kiegroup.

the class BaseEventPropertyReaderTest method testGetLinkRef.

@Test
public void testGetLinkRef() {
    // Link Event can't be Boundary
    if (this instanceof BoundaryEventPropertyReaderTest) {
        return;
    }
    assertEquals("", propertyReader.getLinkRef());
    LinkEventDefinition eventDefinition = mock(LinkEventDefinition.class);
    setLinkEventDefinitionOnCurrentMock(eventDefinition);
    when(eventDefinition.getName()).thenReturn(null);
    assertEquals("", propertyReader.getLinkRef());
    when(eventDefinition.getName()).thenReturn(LINK_REF_ID);
    assertEquals(LINK_REF_ID, propertyReader.getLinkRef());
    EventDefinition differentType = mock(EventDefinition.class);
    setLinkEventDefinitionOnCurrentMock(differentType);
    assertEquals("", propertyReader.getLinkRef());
}
Also used : LinkEventDefinition(org.eclipse.bpmn2.LinkEventDefinition) EventDefinition(org.eclipse.bpmn2.EventDefinition) SignalEventDefinition(org.eclipse.bpmn2.SignalEventDefinition) ConditionalEventDefinition(org.eclipse.bpmn2.ConditionalEventDefinition) TimerEventDefinition(org.eclipse.bpmn2.TimerEventDefinition) LinkEventDefinition(org.eclipse.bpmn2.LinkEventDefinition) Test(org.junit.Test)

Example 7 with LinkEventDefinition

use of org.eclipse.bpmn2.LinkEventDefinition in project kie-wb-common by kiegroup.

the class IntermediateLinkEventPostConverter method process.

@Override
public void process(ProcessPropertyWriter processWriter, BasePropertyWriter nodeWriter, Node<View<? extends BPMNViewDefinition>, ?> node) {
    ThrowEvent throwEvent = (ThrowEvent) nodeWriter.getElement();
    List<EventDefinition> linkEvents = throwEvent.getEventDefinitions();
    if (linkEvents != null && !linkEvents.isEmpty()) {
        addTargetRef(processWriter.getProcess(), throwEvent.getId(), (LinkEventDefinition) linkEvents.get(0));
    }
}
Also used : ThrowEvent(org.eclipse.bpmn2.ThrowEvent) EventDefinition(org.eclipse.bpmn2.EventDefinition) LinkEventDefinition(org.eclipse.bpmn2.LinkEventDefinition)

Aggregations

LinkEventDefinition (org.eclipse.bpmn2.LinkEventDefinition)7 EventDefinition (org.eclipse.bpmn2.EventDefinition)3 CatchEvent (org.eclipse.bpmn2.CatchEvent)2 IntermediateCatchEvent (org.eclipse.bpmn2.IntermediateCatchEvent)2 Test (org.junit.Test)2 IntermediateLinkEventCatching (org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventCatching)2 ConditionalEventDefinition (org.eclipse.bpmn2.ConditionalEventDefinition)1 FlowElement (org.eclipse.bpmn2.FlowElement)1 IntermediateThrowEvent (org.eclipse.bpmn2.IntermediateThrowEvent)1 SignalEventDefinition (org.eclipse.bpmn2.SignalEventDefinition)1 ThrowEvent (org.eclipse.bpmn2.ThrowEvent)1 TimerEventDefinition (org.eclipse.bpmn2.TimerEventDefinition)1 IntermediateLinkEventThrowing (org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventThrowing)1