Hi,

In your example you have hard coded the condition in updateonattribute and
what am trying is pass that condition dynamically from file. Aim of the
flow is tomorrow we don't want to touch the flow file to change the
condition whereas we have to change only the file.

My aim is to create a flow where user has to give a file. File contain list
of table name which has to remove on the flow.

Example:
Database contains following table
test1
test2
test3
test4
test5

File contains
test3

ExecuteSql should run only for
test1
test2
test4
test5

I tried the below flow which is not working.(I know this is wrong approach
as get file generate flow file which will go executesql this should not
happen). I just shared what i tried.

routeonattribute(filterpoint)

1) GetFile->ExtractText->filterpoint
2) Listdatabasetable ->filterpoint -> (unmatched) ExecuteSql


If you get on idea please let me know.  Right now i am changing
routeonattribute value manually. Expectation is convert to automatic.



On Fri, Oct 7, 2016 at 7:42 PM, Andy LoPresto <[email protected]> wrote:

> Hi Selvam,
>
> I talked to Bryan and we figured out a way you can do this now. Despite my
> response on the other thread, you don’t even need the *literal* operator to
> accomplish this. I’ve included a link to a template [1] that accomplishes
> this, but the long and short of it is just to compare the attribute
> “expression” to the literal value ‘true' in your RouteOnAttribute. This
> will compare the String ‘true’ or ‘false’ to the String literal ‘true’ and
> return a boolean result. In this example I used matched/unmatched, but I
> also tried an example where I made two dynamic relationships and routed on
> the relationship name, and that worked as well. Good luck.
>
> [1] https://gist.github.com/alopresto/e0458804c642339c5bb32dd9a008f2c5
>
>
> Andy LoPresto
> [email protected]
> *[email protected] <[email protected]>*
> PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69
>
> On Oct 7, 2016, at 6:25 AM, Bryan Bende <[email protected]> wrote:
>
> Selvam,
>
> I don't believe there is a way to do this right now.
>
> Your scenario requires two-levels of evaluation... it first needs to
> evaluate ${expression} to get the value of that, then it needs to do it
> again to evaluate the resulting expression.
>
> Currently that is not how expression language works, it only performs the
> first evaluation and in the case of RouteOnAttribute that needs to return a
> boolean.
>
> -Bryan
>
>
> On Fri, Oct 7, 2016 at 4:41 AM, Selvam Raman <[email protected]> wrote:
>
>> Hi Bran,
>>
>> I have an expression in file that have more than 10 condition. I am
>> reading a file using list and fetchs3. Using extracttext i am extracting as
>> attribute (test).
>>
>> I am trying to use test in routeonattribute but it shows an error like it
>> was expecting boolean but having string value.
>>
>> please let me know if you have any question.
>>
>> Thanks,
>> selvam R
>>
>> Thanks,
>> Selvam R
>>
>> On Thu, Oct 6, 2016 at 8:57 PM, Bryan Bende <[email protected]> wrote:
>>
>>> Hello,
>>>
>>> I'm not totally sure, but I think this creates two levels of expression
>>> language and won't work.
>>>
>>> Typically the flow file would have an attribute like db.table.name and
>>> then in RouteOnAttribute you would define a property like test =
>>> ${db.table.name:equals('test')}.
>>>
>>> -Bryan
>>>
>>> On Thu, Oct 6, 2016 at 3:31 PM, Selvam Raman <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> can we refer to an attribute from a previous processor for specifying a
>>>> boolean clause in routeonattribute processor.
>>>>
>>>> For Eg. : A flowfile from a previous processor has  a attribute called
>>>> expression with value ${db.table.name:equals('test')} . Can we refer
>>>> to this ${expression} attribute as a boolean clause in routeonattribute
>>>> processor ?
>>>>
>>>> --
>>>> Selvam Raman
>>>> "லஞ்சம் தவிர்த்து நெஞ்சம் நிமிர்த்து"
>>>>
>>>
>>>
>>
>>
>> --
>> Selvam Raman
>> "லஞ்சம் தவிர்த்து நெஞ்சம் நிமிர்த்து"
>>
>
>
>


-- 
Selvam Raman
"லஞ்சம் தவிர்த்து நெஞ்சம் நிமிர்த்து"

Reply via email to