NIFI-2330: Ensure that we set ProcessGroupDTO's contents after populating sets of components, as the contents dto now copies the sets

This closes #686

Signed-off-by: jpercivall <joepercivall@yahoo.com>
This commit is contained in:
Mark Payne 2016-07-20 11:57:41 -04:00 committed by jpercivall
parent 2a8be95480
commit 39a4d84a62
1 changed files with 10 additions and 10 deletions

View File

@ -133,16 +133,6 @@ public class FlowFromDOMFactory {
final Set<ProcessGroupDTO> processGroups = new HashSet<>(); final Set<ProcessGroupDTO> processGroups = new HashSet<>();
final Set<RemoteProcessGroupDTO> remoteProcessGroups = new HashSet<>(); final Set<RemoteProcessGroupDTO> remoteProcessGroups = new HashSet<>();
final FlowSnippetDTO groupContents = new FlowSnippetDTO();
groupContents.setConnections(connections);
groupContents.setFunnels(funnels);
groupContents.setInputPorts(inputPorts);
groupContents.setLabels(labels);
groupContents.setOutputPorts(outputPorts);
groupContents.setProcessGroups(processGroups);
groupContents.setProcessors(processors);
groupContents.setRemoteProcessGroups(remoteProcessGroups);
NodeList nodeList = DomUtils.getChildNodesByTagName(element, "processor"); NodeList nodeList = DomUtils.getChildNodesByTagName(element, "processor");
for (int i = 0; i < nodeList.getLength(); i++) { for (int i = 0; i < nodeList.getLength(); i++) {
processors.add(getProcessor((Element) nodeList.item(i), encryptor)); processors.add(getProcessor((Element) nodeList.item(i), encryptor));
@ -183,6 +173,16 @@ public class FlowFromDOMFactory {
connections.add(getConnection((Element) nodeList.item(i))); connections.add(getConnection((Element) nodeList.item(i)));
} }
final FlowSnippetDTO groupContents = new FlowSnippetDTO();
groupContents.setConnections(connections);
groupContents.setFunnels(funnels);
groupContents.setInputPorts(inputPorts);
groupContents.setLabels(labels);
groupContents.setOutputPorts(outputPorts);
groupContents.setProcessGroups(processGroups);
groupContents.setProcessors(processors);
groupContents.setRemoteProcessGroups(remoteProcessGroups);
dto.setContents(groupContents); dto.setContents(groupContents);
return dto; return dto;
} }