[
https://issues.apache.org/jira/browse/MINIFICPP-637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16643534#comment-16643534
]
ASF GitHub Bot commented on MINIFICPP-637:
------------------------------------------
Github user phrocker commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/416#discussion_r223733549
--- Diff: libminifi/src/capi/api.cpp ---
@@ -287,6 +288,24 @@ flow *create_getfile(nifi_instance *instance, flow
*parent_flow, GetFileConfig *
return new_flow;
}
+processor *add_processor(flow *flow, const char *processor_name) {
+ ExecutionPlan *plan = static_cast<ExecutionPlan*>(flow->plan);
+ auto proc = plan->addProcessor(processor_name, processor_name);
+ if (proc) {
+ processor *new_processor = new processor();
+ new_processor->processor_ptr = proc.get();
+ return new_processor;
+ }
+ return nullptr;
+}
+int set_property(processor *proc, const char *name, const char *value) {
+ if (name != nullptr && value != nullptr && proc != nullptr) {
+ core::Processor *p =
static_cast<core::Processor*>(proc->processor_ptr);
+ return p->setProperty(name, value) ? 0 : -1;
--- End diff --
can we return a different response code here? maybe -2? If we return
anything here other than zero, probably should differentiate from invalid
arguments.
> extend C API to support adding processors with configuration to existing flows
> ------------------------------------------------------------------------------
>
> Key: MINIFICPP-637
> URL: https://issues.apache.org/jira/browse/MINIFICPP-637
> Project: NiFi MiNiFi C++
> Issue Type: Sub-task
> Reporter: Arpad Boda
> Assignee: Arpad Boda
> Priority: Minor
> Fix For: 0.6.0
>
>
> Create add_processor function that is able to extend a flow with new
> processors. This new function also needs to support setting properties of the
> new processor.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)