nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Clarke <matt.clarke....@gmail.com>
Subject Re: Expression Language 'getOrDefault'
Date Tue, 03 May 2016 11:03:00 GMT
Devin,
      You can use the "advanced" capability of the UpdateAttribute
processor to do what you want here. When you configure that processor there
is an advanced UI button to the bottom right of the config window. Within
this UI you can create conditional rules (it is like if/then logic). So
your rule would have a condition that checks for the existence of an
attribute (isNull for example) and if it does not exist create it.

Matt
On May 3, 2016 6:27 AM, "Devin Fisher" <devin.fisher@perfectsearchcorp.com>
wrote:

> I'm looking for the ability similar to the 'getOrDefault'[1] in the Java
> Map class.  I would like to access an attribute if the flow file has it but
> be able to define a default if it don't. I've looked over the doc and can't
> find a way to do it and wanted to see if someone else has done it.
>
> Devin
>
> [1]
> https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#getOrDefault-java.lang.Object-V-
>

Mime
View raw message