final VersionedProcessGroup versionedProcessGroupB = (VersionedProcessGroup) componentB; final VersionedFlowCoordinates coordinatesA = versionedProcessGroupA.getVersionedFlowCoordinates(); final VersionedFlowCoordinates coordinatesB = versionedProcessGroupB.getVersionedFlowCoordinates();
private void verifyImportProcessGroup(final VersionControlInformationDTO vciDto, final VersionedProcessGroup contents, final ProcessGroup group) { if (group == null) { return; } final VersionControlInformation vci = group.getVersionControlInformation(); if (vci != null) { // Note that we do not compare the Registry ID here because there could be two registry clients // that point to the same server (one could point to localhost while another points to 127.0.0.1, for instance).. if (Objects.equals(vciDto.getBucketId(), vci.getBucketIdentifier()) && Objects.equals(vciDto.getFlowId(), vci.getFlowIdentifier())) { throw new IllegalStateException("Cannot import the specified Versioned Flow into the Process Group because doing so would cause a recursive dataflow. " + "If Process Group A contains Process Group B, then Process Group B is not allowed to contain the flow identified by Process Group A."); } } final Set<VersionedProcessGroup> childGroups = contents.getProcessGroups(); if (childGroups != null) { for (final VersionedProcessGroup childGroup : childGroups) { final VersionedFlowCoordinates childCoordinates = childGroup.getVersionedFlowCoordinates(); if (childCoordinates != null) { final VersionControlInformationDTO childVci = new VersionControlInformationDTO(); childVci.setBucketId(childCoordinates.getBucketId()); childVci.setFlowId(childCoordinates.getFlowId()); verifyImportProcessGroup(childVci, childGroup, group); } } } verifyImportProcessGroup(vciDto, contents, group.getParent()); }
final VersionedFlowCoordinates remoteCoordinates = proposed.getVersionedFlowCoordinates(); if (remoteCoordinates == null) { group.disconnectVersionControl(false); final VersionedFlowCoordinates childCoordinates = proposedChildGroup.getVersionedFlowCoordinates();
copy.setName(processGroup.getName()); copy.setPosition(processGroup.getPosition()); copy.setVersionedFlowCoordinates(topLevel ? null : processGroup.getVersionedFlowCoordinates()); copy.setConnections(processGroup.getConnections()); copy.setControllerServices(processGroup.getControllerServices()); if (childGroup.getVersionedFlowCoordinates() == null) { copyChildren.add(stripContentsFromRemoteDescendantGroups(childGroup, false)); } else { childCopy.setName(childGroup.getName()); childCopy.setPosition(childGroup.getPosition()); childCopy.setVersionedFlowCoordinates(childGroup.getVersionedFlowCoordinates());
final VersionedFlowCoordinates coordinates = group.getVersionedFlowCoordinates(); if (coordinates != null) { final String registryUrl = coordinates.getRegistryUrl();
private void compare(final VersionedProcessGroup groupA, final VersionedProcessGroup groupB, final Set<FlowDifference> differences, final boolean compareNamePos) { if (compareComponents(groupA, groupB, differences, compareNamePos, compareNamePos, true)) { return; } if (groupA == null) { differences.add(difference(DifferenceType.COMPONENT_ADDED, groupA, groupB, groupA, groupB)); return; } if (groupB == null) { differences.add(difference(DifferenceType.COMPONENT_REMOVED, groupA, groupB, groupA, groupB)); return; } addIfDifferent(differences, DifferenceType.VERSIONED_FLOW_COORDINATES_CHANGED, groupA, groupB, VersionedProcessGroup::getVersionedFlowCoordinates); if (groupA.getVersionedFlowCoordinates() == null && groupB.getVersionedFlowCoordinates() == null) { differences.addAll(compareComponents(groupA.getConnections(), groupB.getConnections(), this::compare)); differences.addAll(compareComponents(groupA.getProcessors(), groupB.getProcessors(), this::compare)); differences.addAll(compareComponents(groupA.getControllerServices(), groupB.getControllerServices(), this::compare)); differences.addAll(compareComponents(groupA.getFunnels(), groupB.getFunnels(), this::compare)); differences.addAll(compareComponents(groupA.getInputPorts(), groupB.getInputPorts(), this::compare)); differences.addAll(compareComponents(groupA.getLabels(), groupB.getLabels(), this::compare)); differences.addAll(compareComponents(groupA.getOutputPorts(), groupB.getOutputPorts(), this::compare)); differences.addAll(compareComponents(groupA.getProcessGroups(), groupB.getProcessGroups(), (a, b, diffs) -> compare(a, b, diffs, true))); differences.addAll(compareComponents(groupA.getRemoteProcessGroups(), groupB.getRemoteProcessGroups(), this::compare)); } }