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?

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"?>
&ltrulebase metaversion="1.0">
    &ltname&gtCatalog Validations</name>
    &ltdescription&gtCatalog Validations</description>
    &ltdeclare>
        &ltvar&gtTIBCO</var>
        &ltlink type="catalog">
            &ltliteral&gtMC2</literal>
        </link>
    </declare>
    &ltdeclare usage="local">
        &ltvar&gtDummy</var>
    </declare>
    &ltconstraint>
        &ltname&gtGetValuefromothercatalog</name>
        &ltdescription&gtTo get value to Dummy variable from other catalog</description>
        &ltaction>
            &ltassign>
                &ltvar&gtDummy</var>
                &lttable source="sql">
                    &ltliteral&gtTIBCO/PRODUCTID</literal>
                    &ltwhere>
                        &ltsql>
                            &lteq>
                                &ltliteral&gtTIBCO/PRODUCTID</literal>
                                &ltconst type="string"&gtone</const>
                            </eq>
                        </sql>
                    </where>
                </table>
            </assign>
        </action>
    </constraint>
    &ltconstraint>
        &ltname&gtTibcoUOM</name>
        &ltdescription&gtCompare the value in other catalog and decide which value to take</description>
        &ltcondition>
            &lteq>
                &ltvar&gtDummy</var>
                &ltconst type="string"&gtone</const>
            </eq>
        </condition>
        &ltusefor>
            &ltvar&gtRECORD_TYPE</var>
        </usefor>
        &ltaction>
            &ltselect>
                &lttable source="sql">
                    &ltliteral&gtTIBCO/PRODUCTID</literal>
                    &ltliteral&gtTIBCO/SHORTDESC</literal>
                </table>
            </select>
        </action>
        &ltaction>
            &ltselect>
            <!-- Aravind: Use this if you want a dropdown from another catalog -->
                <!--table source="sql">
                    &ltliteral&gtTIBCO/PRODUCTID</literal>
                    &ltliteral&gtTIBCO/SHORTDESC</literal>
                </table-->
            <!-- Aravind: Use this if you want a dropdown with constant values -->
                &ltenum>
                    &ltconst type="string"&gtClassic</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?