[
https://issues.apache.org/jira/browse/MINIFICPP-682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16698590#comment-16698590
]
ASF GitHub Bot commented on MINIFICPP-682:
------------------------------------------
Github user arpadboda commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/448#discussion_r236150567
--- Diff: nanofi/include/cxx/CallbackProcessor.h ---
@@ -65,24 +67,19 @@ class CallbackProcessor : public core::Processor {
public:
- void setCallback(void *obj,std::function<void(core::ProcessSession*)>
ontrigger_callback) {
+ void setCallback(void *obj,std::function<void(core::ProcessSession*,
core::ProcessContext *context)> ontrigger_callback) {
objref_ = obj;
callback_ = ontrigger_callback;
}
// OnTrigger method, implemented by NiFi CallbackProcessor
- virtual void onTrigger(core::ProcessContext *context,
core::ProcessSession *session);
+ virtual void onTrigger(core::ProcessContext *context,
core::ProcessSession *session) override;
// Initialize, over write by NiFi CallbackProcessor
- virtual void initialize() {
- std::set<core::Relationship> relationships;
- core::Relationship Success("success", "description");
- relationships.insert(Success);
- setSupportedRelationships(relationships);
- }
+ virtual void initialize() override;
protected:
void *objref_;
- std::function<void(core::ProcessSession*)> callback_;
+ std::function<void(core::ProcessSession*, core::ProcessContext
*context)> callback_;
--- End diff --
Context is required in the callback to:
-Access content
-Access properties (not yet supported, but will be)
> C API: provide functions to create custom processors
> ----------------------------------------------------
>
> Key: MINIFICPP-682
> URL: https://issues.apache.org/jira/browse/MINIFICPP-682
> Project: NiFi MiNiFi C++
> Issue Type: Improvement
> Reporter: Arpad Boda
> Assignee: Arpad Boda
> Priority: Major
> Labels: CAPI, nanofi
> Fix For: 0.6.0
>
>
> Extend C API to:
> -Provide functions that can be used used to implement custom processor.
> -Custom processor should be able to read/update both the content and the
> attributes of flowfile, route to "failure" and "success" relationships.
> -API should support adding these custom processors to flows and invoke them
> as standalones, too.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)