Github user markap14 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1812#discussion_r116860379
--- Diff:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSynchronizer.java
---
@@ -961,13 +963,36 @@ private Position toPosition(final PositionDTO dto) {
return new Position(dto.getX(), dto.getY());
}
- private void updateProcessor(final ProcessorNode procNode, final
ProcessorDTO processorDTO, final ProcessGroup processGroup, final
FlowController controller)
+ private void configureNewProcessor(final ProcessorNode procNode, final
ProcessorDTO processorDTO, final ProcessGroup processGroup, final
FlowController controller)
+ throws ProcessorInstantiationException {
+ final ProcessorConfigDTO config = processorDTO.getConfig();
+ procNode.setProcessGroup(processGroup);
+ updateProcessor(procNode, processorDTO);
+
+ if (config.getAutoTerminatedRelationships() != null) {
+ final Set<Relationship> relationships = new HashSet<>();
+ for (final String rel :
config.getAutoTerminatedRelationships()) {
+ relationships.add(procNode.getRelationship(rel));
+ }
+ procNode.setAutoTerminatedRelationships(relationships);
+ }
+
+ procNode.setProperties(config.getProperties());
+
+ final ScheduledState scheduledState =
ScheduledState.valueOf(processorDTO.getState());
+ if (ScheduledState.RUNNING.equals(scheduledState)) {
+ controller.startProcessor(processGroup.getIdentifier(),
procNode.getIdentifier());
+ } else if (ScheduledState.DISABLED.equals(scheduledState)) {
--- End diff --
Nevermind - you can ignore this comment too. After reading through it a
couple more times it's making sense. This is for a new processor so a scheduled
state of stopped can be ignored, since it's the initial state for a processor.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---