Posted: Fri Nov 18, 2011 1:25 pm Post subject: Parsing question
Disciple
Joined: 21 Jul 2003 Posts: 169 Location: IA
Looking thru the example on version 7 of the toolkit I came across a sample for large messages (currently we have one message taking 6 hours to gnerate 380,000 + messages)
I see in the sample code they have this:
DECLARE ROOT_LEVEL CONSTANT CHARACTER 'SaleEnvelope';
DECLARE HEADER CONSTANT CHARACTER 'Header';
DECLARE REPEATING_ELEMENT_COUNT CONSTANT CHARACTER 'SaleListCount';
DECLARE REPEATING_ELEMENT CONSTANT CHARACTER 'SaleList';
IF FIELDNAME( InputBody.{ROOT_LEVEL}.{HEADER}.*[>]) = REPEATING_ELEMENT_COUNT THEN
Is this type of coding not using the parser since CONSTANTS are being used, or what is the advantage?
Let's get a couple of things straight:
- ESQL changes message trees.
- A parser creates message trees from messages, or creates messages from message trees.
Maybe you are getting confused about on-demand parsing. ESQL can sometimes cause the parser to do some parsing. This happens when Parse Timing is set to 'On Demand' AND the message flow ( ESQL in this case ) tries to access a field that has not yet been parsed.
Now to answer your question. This line:
Code:
DECLARE ROOT_LEVEL CONSTANT CHARACTER 'SaleEnvelope';
...is just declaring a constant string value for ESQL to use. This line:
Code:
IF FIELDNAME( InputBody.{ROOT_LEVEL}.{HEADER}.*[>]) = REPEATING_ELEMENT_COUNT THEN
...is getting the name of a field in the message tree, and comparing that name to a constant string value. The field in question is the last child of InputBody.SaleEnvelope.Header.
I'm not sure why the author decided to declare/use those string constants, rather than writing the path references in the standard way. Maybe the other ESQL needs them. Whatever the reason, I can assure you that the parser still needs to create the message tree so that the ESQL can operate on it.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum