[ 
https://issues.apache.org/jira/browse/MINIFICPP-617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16646389#comment-16646389
 ] 

ASF GitHub Bot commented on MINIFICPP-617:
------------------------------------------

Github user arpadboda commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/404#discussion_r222248818
  
    --- Diff: libminifi/src/capi/Plan.cpp ---
    @@ -35,6 +36,41 @@ 
ExecutionPlan::ExecutionPlan(std::shared_ptr<core::ContentRepository> content_re
       stream_factory = 
org::apache::nifi::minifi::io::StreamFactory::getInstance(std::make_shared<minifi::Configure>());
     }
     
    +std::shared_ptr<core::Processor> ExecutionPlan::addCallback(void *obj, 
void (*fp)(processor_session *)) {
    +  if (finalized) {
    +    return nullptr;
    +  }
    +
    +  utils::Identifier uuid;
    +  id_generator_->generate(uuid);
    +
    +  auto ptr = 
core::ClassLoader::getDefaultClassLoader().instantiate("CallbackProcessor", 
uuid);
    +  if (nullptr == ptr) {
    +    throw std::exception();
    +  }
    +  std::shared_ptr<processors::CallbackProcessor> processor = 
std::static_pointer_cast<processors::CallbackProcessor>(ptr);
    +  processor->setCallback(obj, fp);
    +  processor->setName("CallbackProcessor");
    +
    +  return addProcessor(processor, "CallbackProcessor", 
core::Relationship("success", "description"), true);
    +}
    +
    +bool ExecutionPlan::setProperty(const std::shared_ptr<core::Processor> 
proc, const std::string &prop, const std::string &value) {
    +  uint32_t i = 0;
    +  logger_->log_debug("Attempting to set property %s %s for %s", prop, 
value, proc->getName());
    +  for (i = 0; i < processor_queue_.size(); i++) {
    +    if (processor_queue_.at(i) == proc) {
    +      break;
    +    }
    +  }
    +
    --- End diff --
    
    ```
    size_t i = std::distance(processor_queue_.begin(), 
std::find(processor_queue_.begin(), processor_queue_.end(), proc));
    ```


> Introduce previously created python example
> -------------------------------------------
>
>                 Key: MINIFICPP-617
>                 URL: https://issues.apache.org/jira/browse/MINIFICPP-617
>             Project: NiFi MiNiFi C++
>          Issue Type: New Feature
>            Reporter: Mr TheSegfault
>            Assignee: Mr TheSegfault
>            Priority: Major
>
> I've had this sitting around a while. I've re-based and tested to ensure it 
> still works. has some bugs but is a simple proof of concept.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to