fix import error for input processors with controller services
@@ -172,17 +172,28 @@ public class TemplateInstanceCreator {
log.info("Attempt to update/validate controller services for template.");
//update any references to the controller services and try to assign the value to an enabled service if it is not already
+ boolean updatedControllerServices = false;
if (input != null) {
log.info("attempt to update controllerservices on {} input processor ", input.getName());
- templateCreationHelper.updateControllerServiceReferences(Lists.newArrayList(inputProcessors), staticConfigPropertyStringMap);
+ List<NifiProperty> updatedProperties = templateCreationHelper.updateControllerServiceReferences(Lists.newArrayList(inputProcessors), staticConfigPropertyStringMap);
+ updatedControllerServices = !updatedProperties.isEmpty();
}
log.info("attempt to update controllerservices on {} processors ", (nonInputProcessors != null ? nonInputProcessors.size() : 0));
- templateCreationHelper.updateControllerServiceReferences(nonInputProcessors, staticConfigPropertyStringMap);
+ List<NifiProperty> updatedProperties = templateCreationHelper.updateControllerServiceReferences(nonInputProcessors, staticConfigPropertyStringMap);
+ if(!updatedControllerServices){
+ updatedControllerServices = !updatedProperties.isEmpty();
+ }
log.info("Controller service validation complete");
//refetch processors for updated errors
entity = restClient.getProcessGroup(processGroupId, true, true);
nonInputProcessors = NifiProcessUtil.getNonInputProcessors(entity);
+ inputProcessors = NifiProcessUtil.getInputProcessors(entity);
+ if(inputProcessors != null && !inputProcessors.isEmpty()) {
+ input = inputProcessors.get(0);
+ }
+
+
///make the input/output ports in the category group as running
if (isCreateReusableFlow()) {
log.info("Reusable flow, attempt to mark the connection ports as running.");
