NIFI-8771: This closes #5205. Ensure that we consider root process group level Controller Services when determining whether or not the dataflow is empty

Signed-off-by: Joe Witt <joewitt@apache.org>
This commit is contained in:
Mark Payne 2021-07-08 16:43:31 -04:00 committed by Joe Witt
parent 777f9029b1
commit 2025999310
No known key found for this signature in database
GPG Key ID: 9093BF854F811A1A
2 changed files with 8 additions and 0 deletions

View File

@ -683,6 +683,7 @@ public class StandardFlowSynchronizer implements FlowSynchronizer {
&& CollectionUtils.isEmpty(contents.getOutputPorts())
&& CollectionUtils.isEmpty(contents.getProcessGroups())
&& CollectionUtils.isEmpty(contents.getRemoteProcessGroups())
&& CollectionUtils.isEmpty(contents.getControllerServices())
&& parameterContextId == null;
}

View File

@ -215,6 +215,7 @@ public class FlowFromDOMFactory {
final Set<LabelDTO> labels = new HashSet<>();
final Set<ProcessGroupDTO> processGroups = new HashSet<>();
final Set<RemoteProcessGroupDTO> remoteProcessGroups = new HashSet<>();
final Set<ControllerServiceDTO> controllerServices = new HashSet<>();
NodeList nodeList = DomUtils.getChildNodesByTagName(element, "processor");
for (int i = 0; i < nodeList.getLength(); i++) {
@ -256,6 +257,11 @@ public class FlowFromDOMFactory {
connections.add(getConnection((Element) nodeList.item(i)));
}
nodeList = DomUtils.getChildNodesByTagName(element, "controllerService");
for (int i=0; i < nodeList.getLength(); i++) {
controllerServices.add(getControllerService((Element) nodeList.item(i), encryptor, encodingVersion));
}
final FlowSnippetDTO groupContents = new FlowSnippetDTO();
groupContents.setConnections(connections);
groupContents.setFunnels(funnels);
@ -265,6 +271,7 @@ public class FlowFromDOMFactory {
groupContents.setProcessGroups(processGroups);
groupContents.setProcessors(processors);
groupContents.setRemoteProcessGroups(remoteProcessGroups);
groupContents.setControllerServices(controllerServices);
dto.setContents(groupContents);
return dto;