Author |
Message
|
pcelari |
Posted: Mon Jan 05, 2015 12:31 pm Post subject: How to match against existence of a field in Route node? |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
I wonder how to test the existence of a field before matching its value.
for example,
$Root/XMLNSC/COMPLAINT/VERSION testing existence.
$Root/XMLNSC/COMPLAINT/VERSION = 2
any insight would be appreciated.
 _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
shashivarungupta |
Posted: Mon Jan 05, 2015 12:41 pm Post subject: Re: How to match against existence of a field in Route node? |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
pcelari wrote: |
I wonder how to test the existence of a field before matching its value. |
what have you tried to figure that out ?
 _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jan 05, 2015 1:32 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
If you mean that you want to take one route if a tag has a specific value, and another route if it simply exists, then code 2 tests.
If you want to test that it exists and has a specific value, then the test for the specific value will obviously fail if the tag does not exist.
Or are you asking a different question? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
shashivarungupta |
Posted: Mon Jan 05, 2015 2:33 pm Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
Vitor wrote: |
If you want to test that it exists and has a specific value, then the test for the specific value will obviously fail if the tag does not exist. |
I hope, his question is the one you've mentioned then following should be suitable.
It totally depends what he is looking for while checking the field for some value or if that exists at all and then do some logical comparison. Following will work in any case, I believe :
Code: |
IF FIELDTYPE(InputRoot.XMLNS.Message1.Name)
IS NULL THEN
// Name field does not exist, take error
action....
... more ESQL ...
ELSE
// Name field does exist, continue....
... more ESQL ...
END IF
|
Vitor wrote: |
Or are you asking a different question? |
Could be.
 _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 06, 2015 6:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
shashivarungupta wrote: |
Following will work in any case, I believe :
Code: |
IF FIELDTYPE(InputRoot.XMLNS.Message1.Name)
IS NULL THEN
// Name field does not exist, take error
action....
... more ESQL ...
ELSE
// Name field does exist, continue....
... more ESQL ...
END IF
|
|
Not in a Route node it won't..... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
pcelari |
Posted: Tue Jan 06, 2015 6:39 am Post subject: |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
Yes, this is exactly what I mean. Sorry for not being clear enough.
 _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 06, 2015 8:26 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pcelari wrote: |
Yes, this is exactly what I mean. Sorry for not being clear enough. |
I was more worried I was answering a different question and providing an answer that was, at best, irrelevant. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|