nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy LoPresto <alopresto.apa...@gmail.com>
Subject Re: use attributed defined in the same UpdateAttribute processor
Date Fri, 17 May 2019 01:23:57 GMT
Mark,

How do we currently resolve situations where an attribute and a variable have the same name?
The attribute is applied first, correct? (Applies to property descriptors that are scoped
for attributes)

Andy LoPresto
alopresto@apache.org
alopresto.apache@gmail.com
PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69

> On May 16, 2019, at 18:21, Mark Payne <markap14@hotmail.com> wrote:
> 
> We could probably handle this without the user interface changing. The processor could
be smart enough to determine the proper ordering to evaluate the properties based on whether
or not it references another property. For example if properties are:
> 
> first.name = John
> last.name = Doe
> greeting = Hello, ${full.name}
> full.name = ${first.name} ${last.name}
> 
> The processor does not currently order these in any ways. But it could be improved to
determine that full.name must be evaluated before greeting and both first.name and last.name
must be evaluated before full.name.
> 
> That way users wouldn’t have to manually order anything. If there were a circular reference
then the order could remain indeterminate and 2 processors could be used. 
> 
> -Mark
> 
> Sent from my iPhone
> 
> On May 16, 2019, at 8:03 PM, Andy LoPresto <alopresto@apache.org> wrote:
> 
>> You have to do this in two subsequent UpdateAttribute instances because the order
of attribute definition (within an instance) is not deterministic. We have gotten a lot of
questions about this, so perhaps it makes sense to investigate as a new feature. However,
if that decision is made, I think substantial changes to the interface would need to be made
to allow for manual reordering of property descriptors, which is not currently supported,
and the transmission of that data via the DTOs in the API would need to be changed as well,
because JSON keys are not ordered. 
>> 
>> Andy LoPresto
>> alopresto@apache.org
>> alopresto.apache@gmail.com
>> PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69
>> 
>>> On May 16, 2019, at 2:08 PM, Boris Tyukin <boris@boristyukin.com> wrote:
>>> 
>>> Hi guys,
>>> 
>>> is it possible to reuse just defined attribute in another attribute in the same
instance of UpdateAttribute processor or I really have to use two separate UpdateAttribute
processors?
>>> 
>>> For example, I define name=boris and then I want to add another attribute greetings=Hi
${name}
>>> 
>>> If I do it in NiFi 1.9, greetings attribute is set to "Hi "
>> 

Mime
View raw message