Author |
Message
|
vinod_sri |
Posted: Wed Jul 04, 2007 6:55 am Post subject: user defined esql: function in Mapping Node |
|
|
Apprentice
Joined: 10 Dec 2003 Posts: 42 Location: Atlanta
|
Hi,
I have two issues in handling the Mapping Node. I am very much in need of your advise and help in resolving them.
1. Can anyone please tell me where to write and how to execute an user defined esql: function in a Mapping Node? I have added an .esql file to my project and written a function. But seems it is not working that way. Somehow somewhere I am not doing it right.
2. My requirement is to write an esql: function which can let me navigate to the any desired Tag in an array of Tags. I coundn't find any function or a way to use cardinality in the mapping node. Please tell me how to implement cardinality in Mapping Node as we do it in Compute Node.
Thanks a lot,
Vinod |
|
Back to top |
|
 |
SOLOHERO |
Posted: Wed Jul 04, 2007 8:05 pm Post subject: Mapping node |
|
|
Centurion
Joined: 01 Feb 2007 Posts: 107
|
I dont think you can do such thing in mapping node, if i am not wrong that was why compute node is for,and one way i think is when you click in the mapping node refer it to the esql file that you created. _________________ Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jul 05, 2007 2:22 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You certainly can call an ESQL function from a mapping node.
You just put in "esql:" and the name of the function and then the arguments.
I'm too lazy to actually spend half a minute digging up the references in the Info Center - but I know there's a page or so about doing this. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
vinod_sri |
Posted: Thu Jul 05, 2007 7:06 am Post subject: user defined esql: function in Mapping Node |
|
|
Apprentice
Joined: 10 Dec 2003 Posts: 42 Location: Atlanta
|
Hi,
Thanks for the suggestions. Here I am using the Mapping Node to create a new message by extrating a portion of the incoming message. The message has several Tags and I need only a few specific tags as the output message. So I need to identify the tags from an array of Tags. Usually the tags are identified by using the TAG_NAME field.
So, in the Map_script editor I used
[color = red] for $source/GCSS_Event/GDS/TAG_Record
if
condition $source/GCSS_Event/GDS/TAG_Record/TAG_Name = 'TAG0100' [/color]
But some tags' TAG_NAME field is null. So, In this case, I don't know how to identify this Tag in Mapping Node. If it is compute Node I can specify the correct index in an array of all Tags.
like DECLARE TAG_Count INTEGER 0;
DECLARE TAG_Index INTEGER 1;
SET TAG_Count = CARDINALITY(InputRoot.MRM.GDS.TAG_Record[]);
WHILE TAG_Index <= TAG_Count DO
SET TAG_Index = TAG_Index + 1;
END WHILE;
Please give me an idea how to achieve this in the Mapping Node.
Thanks a Lot
Vinod |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jul 05, 2007 7:15 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Yes, there's a function to let you get at the current loop counter in a for loop.
I'm too lazy to dig it up in the Info Center, but there's a page in the section on Developing Mappings. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wbi_telecom |
Posted: Thu Jul 05, 2007 7:46 am Post subject: |
|
|
 Disciple
Joined: 15 Feb 2006 Posts: 188 Location: Harrisburg, PA
|
You can call esql functions in mapping node but from my personal experience it it advisable to use the mapping node strictly for straight forward mapping.
If you want to perform complex message manipulation, its better to use ESQL in compute node. For big, complicated message processing the mapping node takes a lot of time and resources.
Cheers, |
|
Back to top |
|
 |
|