[
https://issues.apache.org/jira/browse/MINIFICPP-648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16679694#comment-16679694
]
ASF GitHub Bot commented on MINIFICPP-648:
------------------------------------------
Github user phrocker commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/432#discussion_r231868999
--- Diff: nanofi/src/cxx/Plan.cpp ---
@@ -162,6 +153,21 @@ bool
ExecutionPlan::runNextProcessor(std::function<void(const std::shared_ptr<co
}
std::shared_ptr<core::ProcessSession> current_session =
std::make_shared<core::ProcessSession>(context);
process_sessions_.push_back(current_session);
+ if (input_ff != nullptr) {
+ auto content_repo =
static_cast<std::shared_ptr<minifi::core::ContentRepository>*>(input_ff->crp);
+ std::shared_ptr<minifi::ResourceClaim> claim =
std::make_shared<minifi::ResourceClaim>(input_ff->contentLocation,
*content_repo);
+ auto stream = (*content_repo)->read(claim);
+ std::shared_ptr<minifi::FlowFileRecord> flowFile =
std::static_pointer_cast<minifi::FlowFileRecord>(current_session->create());
+ auto map = static_cast<std::map<std::string,
std::string>*>(input_ff->attributes);
+ if (map) {
+ for (const auto& attr: *map) {
+ flowFile->setAttribute(attr.first, attr.second);
+ }
+ }
+ current_session->importFrom(*stream, flowFile);
+ current_session->transfer(flowFile, core::Relationship("success",
"success"));
+
relationships_[relationships_.size()-1]->put(std::static_pointer_cast<core::FlowFile>(flowFile));
--- End diff --
is there a safeguard to ensure a relationship exists?
> add processor and add processor with linkage nomenclature is confusing
> ----------------------------------------------------------------------
>
> Key: MINIFICPP-648
> URL: https://issues.apache.org/jira/browse/MINIFICPP-648
> Project: NiFi MiNiFi C++
> Issue Type: Improvement
> Reporter: Mr TheSegfault
> Assignee: Arpad Boda
> Priority: Blocker
> Labels: CAPI
> Fix For: 0.6.0
>
>
> add_processor should be changed to always add a processor with linkage
> without compelling documentation as why this exists.. As a result we will
> need to add a create_processor function to create one without adding it to
> the flow ( certain use cases where a flow isn't needed such as invokehttp or
> listenhttp ) this can be moved to 0.7.0 if we tag before recent commits.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)