lordgamez commented on a change in pull request #1132:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1132#discussion_r681683404



##########
File path: libminifi/src/core/yaml/YamlConnectionParser.cpp
##########
@@ -29,24 +29,48 @@ namespace yaml {
 // This is no longer needed in c++17
 constexpr const char* YamlConnectionParser::CONFIG_YAML_CONNECTIONS_KEY;
 
+void YamlConnectionParser::addNewRelationshipToConnection(const std::string& 
relationship_name, const std::shared_ptr<minifi::Connection>& connection) const 
{
+  core::Relationship relationship(relationship_name, "");
+  logger_->log_debug("parseConnection: relationship => [%s]", 
relationship_name);
+  connection->addRelationship(std::move(relationship));
+}
+
+void YamlConnectionParser::addFunnelRelationshipToConnection(const 
std::shared_ptr<minifi::Connection>& connection) const {
+  utils::Identifier srcUUID;
+  try {
+    srcUUID = getSourceUUIDFromYaml();
+  } catch(const std::exception&) {
+    return;
+  }
+  auto processor = parent_->findProcessorById(srcUUID);
+  if (!processor) {
+    logger_->log_error("Could not find processor with id %s", 
srcUUID.to_string());
+    return;
+  }
+
+  auto& processor_ref = *processor.get();
+  if (typeid(minifi::core::Funnel) == typeid(processor_ref)) {
+    addNewRelationshipToConnection(minifi::core::Funnel::Success.getName(), 
connection);
+  }

Review comment:
       Removed in bb83a0d48c8d39d3ff03082e29fabd0ee370ac5b as the yml parser 
runs the source parsing for all processors and those that do not have need any 
source (and not Funnels) like `GetFile` will get this error message printed 
unnecessarily.




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