You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by hemantvsn <he...@gmail.com> on 2017/07/18 11:04:08 UTC

NIFI Expression Language to Evaluate custom function

Can NIFI expression language be used to evaluate custom functions.

For instance, we need to invoke the function,
new org.bson.types.ObjectId().toHexString()

and assign its output to our attribute, is it possible solely using EL?
Im drawing its parallel with SPEL (Spring expression language)

http://docs.spring.io/autorepo/docs/spring-framework/4.0.0.RC2/spring-framework-reference/html/expressions.html

Eg: Class dateClass =
parser.parseExpression("T(java.util.Date)").getValue(Class.class);

Class stringClass =
parser.parseExpression("T(String)").getValue(Class.class);





--
View this message in context: http://apache-nifi-developer-list.39713.n7.nabble.com/NIFI-Expression-Language-to-Evaluate-custom-function-tp16451.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.

Re: NIFI Expression Language to Evaluate custom function

Posted by Joe Witt <jo...@gmail.com>.
The nifi el is not setup for user supplied custom functions.  However, this
is a good use for the scripting processors.  In those you can operate on
data content or attributes with your custom code.

Thanks
Joe

On Jul 18, 2017 7:44 AM, "Joseph Niemiec" <jo...@gmail.com> wrote:

> I believe what your asking for is possible, I am not very familiar with
> Spring though. Check out this commit for the base64encode/decode, lemme
> know if it helps you out.
>
> https://github.com/apache/nifi/commit/6f1af31ff28f60d0eddbee5dafe909
> bc66cc9c71
>
>
>
> On Tue, Jul 18, 2017 at 7:04 AM, hemantvsn <he...@gmail.com> wrote:
>
> > Can NIFI expression language be used to evaluate custom functions.
> >
> > For instance, we need to invoke the function,
> > new org.bson.types.ObjectId().toHexString()
> >
> > and assign its output to our attribute, is it possible solely using EL?
> > Im drawing its parallel with SPEL (Spring expression language)
> >
> > http://docs.spring.io/autorepo/docs/spring-framework/4.0.0.RC2/spring-
> > framework-reference/html/expressions.html
> >
> > Eg: Class dateClass =
> > parser.parseExpression("T(java.util.Date)").getValue(Class.class);
> >
> > Class stringClass =
> > parser.parseExpression("T(String)").getValue(Class.class);
> >
> >
> >
> >
> >
> > --
> > View this message in context: http://apache-nifi-developer-
> > list.39713.n7.nabble.com/NIFI-Expression-Language-to-
> > Evaluate-custom-function-tp16451.html
> > Sent from the Apache NiFi Developer List mailing list archive at
> > Nabble.com.
> >
>
>
>
> --
> Joseph
>

Re: NIFI Expression Language to Evaluate custom function

Posted by Joseph Niemiec <jo...@gmail.com>.
I believe what your asking for is possible, I am not very familiar with
Spring though. Check out this commit for the base64encode/decode, lemme
know if it helps you out.

https://github.com/apache/nifi/commit/6f1af31ff28f60d0eddbee5dafe909bc66cc9c71



On Tue, Jul 18, 2017 at 7:04 AM, hemantvsn <he...@gmail.com> wrote:

> Can NIFI expression language be used to evaluate custom functions.
>
> For instance, we need to invoke the function,
> new org.bson.types.ObjectId().toHexString()
>
> and assign its output to our attribute, is it possible solely using EL?
> Im drawing its parallel with SPEL (Spring expression language)
>
> http://docs.spring.io/autorepo/docs/spring-framework/4.0.0.RC2/spring-
> framework-reference/html/expressions.html
>
> Eg: Class dateClass =
> parser.parseExpression("T(java.util.Date)").getValue(Class.class);
>
> Class stringClass =
> parser.parseExpression("T(String)").getValue(Class.class);
>
>
>
>
>
> --
> View this message in context: http://apache-nifi-developer-
> list.39713.n7.nabble.com/NIFI-Expression-Language-to-
> Evaluate-custom-function-tp16451.html
> Sent from the Apache NiFi Developer List mailing list archive at
> Nabble.com.
>



-- 
Joseph