fgerlits commented on code in PR #1895:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1895#discussion_r1916912569


##########
libminifi/src/core/flow/StructuredConfiguration.cpp:
##########
@@ -191,23 +192,78 @@ void 
StructuredConfiguration::parseParameterContexts(const Node& parameter_conte
     uuid = id;
     auto parameter_context = std::make_unique<ParameterContext>(name, uuid);
     parameter_context->setDescription(getOptionalField(parameter_context_node, 
schema_.description, ""));
+    
parameter_context->setParameterProvider(getOptionalField(parameter_context_node,
 schema_.parameter_provider, ""));
     for (const auto& parameter_node : 
parameter_context_node[schema_.parameters]) {
       checkRequiredField(parameter_node, schema_.name);
       checkRequiredField(parameter_node, schema_.value);
       checkRequiredField(parameter_node, schema_.sensitive);
       auto parameter_name = parameter_node[schema_.name].getString().value();
       auto parameter_value = parameter_node[schema_.value].getString().value();
       auto sensitive = parameter_node[schema_.sensitive].getBool().value();
+      auto provided = 
parameter_node[schema_.provided].getBool().value_or(false);
       auto parameter_description = getOptionalField(parameter_node, 
schema_.description, "");
       if (sensitive) {
         parameter_value = 
utils::crypto::property_encryption::decrypt(parameter_value, 
sensitive_values_encryptor_);
       }
-      parameter_context->addParameter(Parameter{parameter_name, 
parameter_description, sensitive, parameter_value});
+      parameter_context->addParameter(Parameter{
+        .name = parameter_name,
+        .description = parameter_description,
+        .sensitive = sensitive,
+        .provided = provided,
+        .value = parameter_value});
     }
 
     parameter_contexts_.emplace(name, 
gsl::make_not_null(std::move(parameter_context)));
   }
+}
+
+void StructuredConfiguration::parseParameterProvidersNode(const Node& 
parameter_providers_node) {
+  if (!parameter_providers_node || !parameter_providers_node.isSequence()) {
+    return;
+  }
+  for (const auto& parameter_provider_node : parameter_providers_node) {
+    checkRequiredField(parameter_provider_node, schema_.name);
 
+    auto type = getRequiredField(parameter_provider_node, schema_.type);
+    logger_->log_debug("Using type {} for parameter provider node", type);
+
+    std::string fullType = type;
+    if (auto short_type = utils::string::partAfterLastOccurrenceOf(type, '.')) 
{
+      type = *short_type;
+    }

Review Comment:
   For example, if the helper function is changed, this could be:
   ```suggestion
       std::string fullType = type;
       type = utils::string::partAfterLastOccurrenceOf(type, '.');
   ```



-- 
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