Search in sources :

Example 1 with LinkEventDefinition

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

the class IntermediateLinkEventPostConverter method getCatchLinkEventWithSameName.

LinkEventDefinition getCatchLinkEventWithSameName(FlowElementsContainer container, String linkName) {
    for (FlowElement flowElement : container.getFlowElements()) {
        if (flowElement instanceof CatchEvent) {
            CatchEvent event = (CatchEvent) flowElement;
            List<EventDefinition> definitions = event.getEventDefinitions();
            if (definitions == null || definitions.isEmpty()) {
                continue;
            }
            EventDefinition definition = definitions.get(0);
            if (definition instanceof LinkEventDefinition) {
                LinkEventDefinition linkDefinition = (LinkEventDefinition) definition;
                if (linkName.equals(linkDefinition.getName())) {
                    return linkDefinition;
                }
            }
        }
    }
    return null;
}
Also used : LinkEventDefinition(org.eclipse.bpmn2.LinkEventDefinition) FlowElement(org.eclipse.bpmn2.FlowElement) CatchEvent(org.eclipse.bpmn2.CatchEvent) EventDefinition(org.eclipse.bpmn2.EventDefinition) LinkEventDefinition(org.eclipse.bpmn2.LinkEventDefinition)

Example 2 with LinkEventDefinition

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

the class EventPropertyWriter method addLink.

public void addLink(LinkRef linkRef) {
    LinkEventDefinition linkEventDefinition = bpmn2.createLinkEventDefinition();
    linkEventDefinition.setName(replaceIllegalCharsAttribute(linkRef.getValue()));
    addEventDefinition(linkEventDefinition);
}
Also used : LinkEventDefinition(org.eclipse.bpmn2.LinkEventDefinition)

Example 3 with LinkEventDefinition

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

the class IntermediateCatchEventConverterTest method linkEvent.

@Test
public void linkEvent() {
    IntermediateLinkEventCatching definition = mock(IntermediateLinkEventCatching.class);
    LinkEventDefinition eventDefinition = mock(LinkEventDefinition.class);
    CatchEvent catchEvent = mockIntermediateCatchEvent(definition);
    tested.linkEvent(catchEvent);
    verifyCommonProperties(definition);
    verify(propertyReader).getLinkRef();
    verify(definition).setExecutionSet(Mockito.<LinkEventExecutionSet>any());
}
Also used : LinkEventDefinition(org.eclipse.bpmn2.LinkEventDefinition) IntermediateLinkEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventCatching) CatchEvent(org.eclipse.bpmn2.CatchEvent) IntermediateCatchEvent(org.eclipse.bpmn2.IntermediateCatchEvent) Test(org.junit.Test)

Example 4 with LinkEventDefinition

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

the class IntermediateThrowEventConverterTest method verifyLinkEventConvert.

private void verifyLinkEventConvert() {
    IntermediateLinkEventThrowing definition = mock(IntermediateLinkEventThrowing.class);
    LinkEventDefinition eventDefinition = mock(LinkEventDefinition.class);
    IntermediateThrowEvent intermediateThrowEvent = mockIntermediateThrowEvent(definition);
    eventDefinitions.clear();
    eventDefinitions.add(eventDefinition);
    tested.convert(intermediateThrowEvent);
    verify(tested).linkEvent(intermediateThrowEvent);
}
Also used : IntermediateLinkEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventThrowing) LinkEventDefinition(org.eclipse.bpmn2.LinkEventDefinition) IntermediateThrowEvent(org.eclipse.bpmn2.IntermediateThrowEvent)

Example 5 with LinkEventDefinition

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

the class IntermediateCatchEventConverterTest method verifyLinkEventConvert.

private void verifyLinkEventConvert() {
    IntermediateLinkEventCatching definition = mock(IntermediateLinkEventCatching.class);
    LinkEventDefinition eventDefinition = mock(LinkEventDefinition.class);
    IntermediateCatchEvent intermediateCatchEvent = mockIntermediateCatchEvent(definition);
    eventDefinitions.clear();
    eventDefinitions.add(eventDefinition);
    tested.convert(intermediateCatchEvent);
    verify(tested).linkEvent(intermediateCatchEvent);
}
Also used : LinkEventDefinition(org.eclipse.bpmn2.LinkEventDefinition) IntermediateLinkEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateLinkEventCatching) IntermediateCatchEvent(org.eclipse.bpmn2.IntermediateCatchEvent)

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