use of org.apache.nifi.minifi.commons.schema.FunnelSchema in project nifi-minifi by apache.
the class ConfigTransformer method addProcessGroup.
protected static void addProcessGroup(Document doc, Element element, ProcessGroupSchema processGroupSchema, ParentGroupIdResolver parentGroupIdResolver) throws ConfigurationChangeException {
try {
String processGroupId = processGroupSchema.getId();
addTextElement(element, "id", processGroupId);
addTextElement(element, "name", processGroupSchema.getName());
addPosition(element);
addTextElement(element, "comment", processGroupSchema.getComment());
for (ProcessorSchema processorConfig : processGroupSchema.getProcessors()) {
addProcessor(element, processorConfig);
}
for (PortSchema portSchema : processGroupSchema.getInputPortSchemas()) {
addPort(doc, element, portSchema, "inputPort");
}
for (PortSchema portSchema : processGroupSchema.getOutputPortSchemas()) {
addPort(doc, element, portSchema, "outputPort");
}
for (FunnelSchema funnelSchema : processGroupSchema.getFunnels()) {
addFunnel(element, funnelSchema);
}
for (ProcessGroupSchema child : processGroupSchema.getProcessGroupSchemas()) {
Element processGroups = doc.createElement("processGroup");
element.appendChild(processGroups);
addProcessGroup(doc, processGroups, child, parentGroupIdResolver);
}
for (RemoteProcessGroupSchema remoteProcessGroupSchema : processGroupSchema.getRemoteProcessGroups()) {
addRemoteProcessGroup(element, remoteProcessGroupSchema);
}
for (ConnectionSchema connectionConfig : processGroupSchema.getConnections()) {
addConnection(element, connectionConfig, parentGroupIdResolver);
}
for (ControllerServiceSchema controllerServiceSchema : processGroupSchema.getControllerServices()) {
addControllerService(element, controllerServiceSchema);
}
} catch (ConfigurationChangeException e) {
throw e;
} catch (Exception e) {
throw new ConfigurationChangeException("Failed to parse the config YAML while trying to creating the root Process Group", e);
}
}
Aggregations