I was wondering if the following was possible in MQSI. I want to create a generic rules processor. Rules would be read from a database in XML that indicate an element in the message to check against a value.
<Rule>
<condition>
<element>customer</element>
<compare>EQ</compare>
<compareValue>ABC</compareValue>
<condition>
</Rule>
So the ESQL would ideally read the conditions, for each one get the element contained in the element tag of the rule. Check the compare tag with the compare value, and return true/false.
I just don't know if there's a way to specifiy a variable name as the element name in the input document. I realize the setup of the rule must match the element name in the document, but this would allow one rule node regardless of the message type. Any thoughts on this would be appreciated. Thanks.
OutputRoot.XML.
Hi,
Use can use the EVAL function in ESQL to do this. Declare dynamic variables in ESQL and do any type of dynamic processing. But this make ur programs slower to run at run time.
But the way u want I think can be achieved by simply using the IF THEN ELSE loop like IF InputRoot.XML.Rule.compare='EQ' THEN IF InputRoot.XML.Rule.element=InputRoot.XML.Rule.compareVale Then Set OutputRoot.XML.Rule.Result='TRUE'; ELSE SET OutputRoot.XML.Rule.Result='FALSE'
END IF; ,......ELSe....END IF;
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