You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Toivo Adams <to...@gmail.com> on 2015/09/05 16:43:09 UTC

Custom ProcessorNode instead of using StandardProcessorNode.

I wanted to create custom Processor but it seems may be I need to create
custom ProcessorNode instead of using StandardProcessorNode.
Is this possible? I mean how can I use my own ProcessorNode, is this
configurable?

NiFi internals are fairly complex (to put it mildly :) )
org_apache_nifi_processor_hierarchy_05sep2015.png
<http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/file/n2677/org_apache_nifi_processor_hierarchy_05sep2015.png>  
processor_controller_05sep2015.png
<http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/file/n2677/processor_controller_05sep2015.png>  
So I started creating some diagrams just to better understand.

For some reason I can’t login to Nifi Confluence/Wiki. Please can I have
access?
Username:  toivoadams
Full Name: Toivo Adams

So I attach diagrams here, Nable at least will show pictures.

Thanks
Toivo




--
View this message in context: http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/Custom-ProcessorNode-instead-of-using-StandardProcessorNode-tp2677.html
Sent from the Apache NiFi (incubating) Developer List mailing list archive at Nabble.com.

Re: Custom ProcessorNode instead of using StandardProcessorNode.

Posted by Joe Witt <jo...@gmail.com>.
Toivo,

You can definitely extend stuff in there and tweak behaviors but you'd
be going deep into custom/forking world.  Obviously we'll help as we
can anyway.

Thanks
Joe

On Sun, Sep 6, 2015 at 4:38 AM, Toivo Adams <to...@gmail.com> wrote:
> My idea is to create business components which can be used as NiFi
> processors.
> But such business components are not directly tied to NiFi.
> Business component can be any java class which doesn’t extend any NiFi class
> or interface.
> For example such class may have method
>
> public Params transform(Integer agreementId, Stuff currentAgreements, Stuff
> incomingInvestmentStructure)
>
> Method transform implements some business logic using data from input
> parameters and created output parameters.
> Such business components have 2 advantages:
> 1.      Many developers understand this as this is similar to procedural way to
> develop software.
> 2.      Existing code can be used easily
>
> Of course such business component cannot be used directly in Nifi.
> So some kind of Wrapper/Controller Is needed. Wrapper will read FlowFile,
> converts to input parameters, call transform method and creates FlowFile
> form output parameters.
> Wrapper is same for all business components.
>
> I was not sure can this be done extending Processor or any of is children.
> Maybe it even is?
>
> So far I don’t know how expose business component name, input parameters
> names and some description to UI.
> UI should see business component name and not Wrapper name.
>
> Thanks
> Toivo
>
>
>
>
> --
> View this message in context: http://apache-nifi-developer-list.39713.n7.nabble.com/Custom-ProcessorNode-instead-of-using-StandardProcessorNode-tp2677p2690.html
> Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

Re: Custom ProcessorNode instead of using StandardProcessorNode.

Posted by Toivo Adams <to...@gmail.com>.
My idea is to create business components which can be used as NiFi
processors.
But such business components are not directly tied to NiFi.
Business component can be any java class which doesn’t extend any NiFi class
or interface.
For example such class may have method 

public Params transform(Integer agreementId, Stuff currentAgreements, Stuff
incomingInvestmentStructure)

Method transform implements some business logic using data from input
parameters and created output parameters.
Such business components have 2 advantages:
1.	Many developers understand this as this is similar to procedural way to
develop software.
2.	Existing code can be used easily

Of course such business component cannot be used directly in Nifi.
So some kind of Wrapper/Controller Is needed. Wrapper will read FlowFile,
converts to input parameters, call transform method and creates FlowFile
form output parameters.
Wrapper is same for all business components.

I was not sure can this be done extending Processor or any of is children.
Maybe it even is?

So far I don’t know how expose business component name, input parameters
names and some description to UI.
UI should see business component name and not Wrapper name.

Thanks
Toivo




--
View this message in context: http://apache-nifi-developer-list.39713.n7.nabble.com/Custom-ProcessorNode-instead-of-using-StandardProcessorNode-tp2677p2690.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

Re: Custom ProcessorNode instead of using StandardProcessorNode.

Posted by Joe Witt <jo...@gmail.com>.
Toivo,

I've added you to the nifi wiki so you should be all set there.

The ProcessorNode isn't a designed extension point.  The things that
are would be things like FlowFileProcessor, Controller Service,
Reporting Task, Prioritizer.  What are you looking to do by extending
the processor node?

Thanks
Joe

On Sat, Sep 5, 2015 at 7:45 AM, Toivo Adams <to...@gmail.com> wrote:
> processor_controller_05sep2015.png
> <http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/file/n2678/processor_controller_05sep2015.png>
>
>
>
> --
> View this message in context: http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/Custom-ProcessorNode-instead-of-using-StandardProcessorNode-tp2677p2678.html
> Sent from the Apache NiFi (incubating) Developer List mailing list archive at Nabble.com.

Re: Custom ProcessorNode instead of using StandardProcessorNode.

Posted by Toivo Adams <to...@gmail.com>.
processor_controller_05sep2015.png
<http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/file/n2678/processor_controller_05sep2015.png>  



--
View this message in context: http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/Custom-ProcessorNode-instead-of-using-StandardProcessorNode-tp2677p2678.html
Sent from the Apache NiFi (incubating) Developer List mailing list archive at Nabble.com.