protected static void getParentIdMap(ProcessGroupSchema processGroupSchema, Map<String, String> output, Function<ProcessGroupSchema, Collection<? extends BaseSchemaWithId>> schemaAccessor) { schemaAccessor.apply(processGroupSchema).forEach(p -> output.put(p.getId(), processGroupSchema.getId())); processGroupSchema.getProcessGroupSchemas().forEach(p -> getParentIdMap(p, output, schemaAccessor)); }
public Map<String, Object> toMap() { Map<String, Object> result = mapSupplier.get(); String id = getId(); if (!ID_DEFAULT.equals(id)) { result.put(ID_KEY, id); } StringUtil.doIfNotNullOrEmpty(getName(), name -> result.put(NAME_KEY, name)); putListIfNotNull(result, PROCESSORS_KEY, processors); putListIfNotNull(result, CONTROLLER_SERVICES_KEY, controllerServiceSchemas); putListIfNotNull(result, PROCESS_GROUPS_KEY, processGroupSchemas); putListIfNotNull(result, INPUT_PORTS_KEY, inputPortSchemas); putListIfNotNull(result, OUTPUT_PORTS_KEY, outputPortSchemas); putListIfNotNull(result, FUNNELS_KEY, funnels); putListIfNotNull(result, CONNECTIONS_KEY, connections); putListIfNotNull(result, REMOTE_PROCESS_GROUPS_KEY, remoteProcessGroups); return result; }
addValidationIssue(OUTPUT_PORTS_KEY, wrapperName, "must be empty in root group as external input/output ports are currently unsupported"); } else if (ID_DEFAULT.equals(getId())) { addValidationIssue(ID_KEY, wrapperName, "must be set to a value not " + ID_DEFAULT + " if not in root group");
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());