markap14 commented on a change in pull request #5452:
URL: https://github.com/apache/nifi/pull/5452#discussion_r730928751



##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
##########
@@ -765,8 +772,54 @@ public ProcessorEntity updateProcessor(final Revision 
revision, final ProcessorD
     }
 
     @Override
-    public List<ConfigVerificationResultDTO> 
verifyProcessorConfiguration(final String processorId, final ProcessorConfigDTO 
processorConfig, final Map<String, String> attributes) {
-        return processorDAO.verifyProcessorConfiguration(processorId, 
processorConfig, attributes);
+    public List<ConfigVerificationResultDTO> 
verifyProcessorConfiguration(final String processorId, final Map<String, 
String> properties, final Map<String, String> attributes) {
+        return processorDAO.verifyProcessorConfiguration(processorId, 
properties, attributes);
+    }
+
+    @Override
+    public ConfigurationAnalysisEntity analyzeProcessorConfiguration(final 
String processorId, final Map<String, String> properties) {
+        final ProcessorNode processorNode = 
processorDAO.getProcessor(processorId);
+        final ProcessGroup processGroup = processorNode.getProcessGroup();
+        final ParameterContext parameterContext = 
processGroup.getParameterContext();
+
+        final Map<String, String> referencedAttributes = 
determineReferencedAttributes(properties, processorNode, parameterContext);
+
+        final ConfigurationAnalysisDTO dto = new ConfigurationAnalysisDTO();
+        dto.setComponentId(processorId);
+        dto.setProperties(properties);
+        dto.setReferencedAttributes(referencedAttributes);
+
+        final ConfigurationAnalysisEntity entity = new 
ConfigurationAnalysisEntity();
+        entity.setConfigurationAnalysis(dto);
+        return entity;
+    }
+
+    private Map<String, String> determineReferencedAttributes(final 
Map<String, String> properties, final ComponentNode componentNode, final 
ParameterContext parameterContext) {

Review comment:
       The intent is that the UI will populate the form with whatever values 
are provided. For now, we will provide `null`, but in the future we will 
probably populate it based on recent provenance events or on the attributes of 
the last FlowFile processed, if any (assuming user has appropriate permissions 
to view provenance etc.). We don't want to have to change the REST API in the 
future to add that in, so this is just kind of future-proofing that.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to