public FlowElementsContainer findParent(FlowElement childElement) { return findParent(childElement, this); }
public FlowElementsContainer findParent(FlowElement childElement) { return findParent(childElement, this); }
public FlowElementsContainer findParent(FlowElement childElement, FlowElementsContainer flowElementsContainer) { for (FlowElement flowElement : flowElementsContainer.getFlowElements()) { if (childElement.getId() != null && childElement.getId().equals(flowElement.getId())) { return flowElementsContainer; } if (flowElement instanceof FlowElementsContainer) { FlowElementsContainer result = findParent(childElement, (FlowElementsContainer) flowElement); if (result != null) { return result; } } } return null; }
public FlowElementsContainer findParent(FlowElement childElement, FlowElementsContainer flowElementsContainer) { for (FlowElement flowElement : flowElementsContainer.getFlowElements()) { if (childElement.getId() != null && childElement.getId().equals(flowElement.getId())) { return flowElementsContainer; } if (flowElement instanceof FlowElementsContainer) { FlowElementsContainer result = findParent(childElement, (FlowElementsContainer) flowElement); if (result != null) { return result; } } } return null; }
@Override protected void executeValidation(BpmnModel bpmnModel, Process process, List<ValidationError> errors) { List<EndEvent> endEvents = process.findFlowElementsOfType(EndEvent.class); for (EndEvent endEvent : endEvents) { if (endEvent.getEventDefinitions() != null && !endEvent.getEventDefinitions().isEmpty()) { EventDefinition eventDefinition = endEvent.getEventDefinitions().get(0); // Error end event if (eventDefinition instanceof CancelEventDefinition) { FlowElementsContainer parent = process.findParent(endEvent); if (!(parent instanceof Transaction)) { addError(errors, Problems.END_EVENT_CANCEL_ONLY_INSIDE_TRANSACTION, process, endEvent, "end event with cancelEventDefinition only supported inside transaction subprocess"); } } } } }
visitedElements.add(sourceElement.getId()); FlowElementsContainer parentElement = process.findParent(sourceElement); if (parentElement instanceof SubProcess) { sourceElement = (SubProcess) parentElement;