From f1d7518547c0a5d1c4a6a47cbf1c4c54e68164e6 Mon Sep 17 00:00:00 2001 From: Bryan Bende Date: Tue, 13 Mar 2018 12:42:33 -0400 Subject: [PATCH] NIFI-4969 Fixing error when importing versioned flow with a processor that uses event driven scheduling. This closes #2539 --- .../org/apache/nifi/controller/StandardProcessorNode.java | 3 ++- .../java/org/apache/nifi/groups/StandardProcessGroup.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java index c6d62a26ea..c3a8f5c95f 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java @@ -627,7 +627,8 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable throw new IllegalStateException("Cannot modify Processor configuration while the Processor is running"); } if (taskCount < 1 && getSchedulingStrategy() != SchedulingStrategy.EVENT_DRIVEN) { - throw new IllegalArgumentException(); + throw new IllegalArgumentException("Cannot set Concurrent Tasks to " + taskCount + " for component " + + getIdentifier() + " because Scheduling Strategy is not Event Driven"); } if (!isTriggeredSerially()) { concurrentTaskCount.set(taskCount); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java index 41779174c4..f0b7b3efca 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java @@ -4072,8 +4072,6 @@ public final class StandardProcessGroup implements ProcessGroup { processor.setAnnotationData(proposed.getAnnotationData()); processor.setBulletinLevel(LogLevel.valueOf(proposed.getBulletinLevel())); processor.setComments(proposed.getComments()); - processor.setMaxConcurrentTasks(proposed.getConcurrentlySchedulableTaskCount()); - processor.setExecutionNode(ExecutionNode.valueOf(proposed.getExecutionNode())); processor.setName(proposed.getName()); processor.setPenalizationPeriod(proposed.getPenaltyDuration()); @@ -4082,6 +4080,8 @@ public final class StandardProcessGroup implements ProcessGroup { processor.setRunDuration(proposed.getRunDurationMillis(), TimeUnit.MILLISECONDS); processor.setSchedulingStrategy(SchedulingStrategy.valueOf(proposed.getSchedulingStrategy())); processor.setScheduldingPeriod(proposed.getSchedulingPeriod()); + processor.setMaxConcurrentTasks(proposed.getConcurrentlySchedulableTaskCount()); + processor.setExecutionNode(ExecutionNode.valueOf(proposed.getExecutionNode())); processor.setStyle(proposed.getStyle()); processor.setYieldPeriod(proposed.getYieldDuration()); processor.setPosition(new Position(proposed.getPosition().getX(), proposed.getPosition().getY()));