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;
}
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);
}
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());
}
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);
}
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);
}
Aggregations