Github user yuri1969 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2222#discussion_r160052865
--- Diff:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java
---
@@ -2601,6 +2601,25 @@ public MutableVariableRegistry getVariableRegistry()
{
return variableRegistry;
}
+ @Override
+ public void verifyCanUpdateTemplate(final String name, final String
templateId) {
+ // ensure the name is specified
+ if (StringUtils.isBlank(name)) {
+ throw new IllegalArgumentException("Template name cannot be
blank.");
+ }
+
+ for (final Template template : getTemplates()) {
+ canUpdateTemplate(name, templateId, template.getDetails());
+ }
+ }
+
+ private void canUpdateTemplate(final String name, final String
templateId, final TemplateDTO processGroupTemplate) {
+ // prevent renaming to another template's name
+ if (name.equals(processGroupTemplate.getName()) &&
!templateId.equals(processGroupTemplate.getId())) {
--- End diff --
@alopresto I was sloppy with that name validation, my mistake.
---