How to have a two lookups based on a condition, where the condition has to be framed using the values of some attributes from the other master catalog?
book
Article ID: KB0090801
calendar_today
Updated On:
Products
Versions
TIBCO Collaborative Information Manager
-
Not Applicable
-
Description
Resolution: It could be done. Please find the attached catalog validation.xml file, where I used some local variable. Here in this solution, variable "Dummy" does a look to other catalog and get the value of the productid. Now I define another constraint where I compare this Dummy variable with an expected constant valuen and have the actions based on the output of the condition.
<?xml version="1.0" encoding="UTF-8"?> <rulebase metaversion="1.0"> <name>Catalog Validations</name> <description>Catalog Validations</description> <declare> <var>TIBCO</var> <link type="catalog"> <literal>MC2</literal> </link> </declare> <declare usage="local"> <var>Dummy</var> </declare> <constraint> <name>GetValuefromothercatalog</name> <description>To get value to Dummy variable from other catalog</description> <action> <assign> <var>Dummy</var> <table source="sql"> <literal>TIBCO/PRODUCTID</literal> <where> <sql> <eq> <literal>TIBCO/PRODUCTID</literal> <const type="string">one</const> </eq> </sql> </where> </table> </assign> </action> </constraint> <constraint> <name>TibcoUOM</name> <description>Compare the value in other catalog and decide which value to take</description> <condition> <eq> <var>Dummy</var> <const type="string">one</const> </eq> </condition> <usefor> <var>RECORD_TYPE</var> </usefor> <action> <select> <table source="sql"> <literal>TIBCO/PRODUCTID</literal> <literal>TIBCO/SHORTDESC</literal> </table> </select> </action> <action> <select> <!-- Aravind: Use this if you want a dropdown from another catalog --> <!--table source="sql"> <literal>TIBCO/PRODUCTID</literal> <literal>TIBCO/SHORTDESC</literal> </table--> <!-- Aravind: Use this if you want a dropdown with constant values --> <enum> <const type="string">Classic</const> </enum> </select> </action> </constraint> </rulebase>
Issue/Introduction
How to have a two lookups based on a condition, where the condition has to be framed using the values of some attributes from the other master catalog?