How to populate the PRODUCTIDs of all related records where ATTR1 is cc?

How to populate the PRODUCTIDs of all related records where ATTR1 is cc?

book

Article ID: KB0082364

calendar_today

Updated On:

Products Versions
TIBCO MDM -

Description

Two repositories: PARENT and CHILD, relationship from PARENT to CHILD, HAS/IS. Both the repositories have attributes PRODUCTID, PRODUCTIDEXT, ATTR1.
A PARENT record p1,p1 HAS c1,c1,cc and c2,c2,cc and c3,c3. 
How to populate the PRODUCTIDs of all related records where ATTR1 is cc? Note, c1,c1 and c2,c2 qualifies for this condition.

Issue/Introduction

How to populate the PRODUCTIDs of all related records where ATTR1 is cc?

Environment

TIBCO Product name and version: TIBCO MDM All Operating System(s): All Operating Systems

Resolution

Example: Have the following constraints in the PARENT repository catalogvalidation.xml.

<declare>
   <var>CHILD</var>
   <link type="catalog">
   <literal>CHILD</literal>
   <literal>STATE/CONFIRMED</literal>
   </link>
 </declare>

 <declare>
     <var>HAS</var>
     <link type="relationship_record">
     <literal>HAS</literal>
     <literal>PRODUCTID</literal>
     </link>
   </declare>

  <constraint>
  <name>PopulateDropDown</name>
  <description>PopulateDropDown</description>
   <usefor>
   <var>ATTR1</var>
   </usefor>
      <action>
         <select>
            <table source="sql">
            <literal>CHILD/PRODUCTID</literal>
               <where>
                  <sql>
                     <and>
                        <in>
                           <literal>CHILD/PRODUCTID</literal>
                           <var>HAS</var>
                        </in>
                        <eq>
                           <literal>CHILD/ATTR1</literal>
                           <const type="string">cc</const>
                        </eq>
                     </and>
                  </sql>
               </where>
            </table>
         </select>
      </action>
  </constraint>