How to pre-populate attributes only the in the related repository search screen and NOT in the repository search screen.

How to pre-populate attributes only the in the related repository search screen and NOT in the repository search screen.

book

Article ID: KB0084927

calendar_today

Updated On:

Products Versions
TIBCO MDM -
Not Applicable -

Description

Description:

Assume two repositories A and B, with a relationship between them. If we want to add a related record X (for repository B) to the parent record Y (for repository A), we get to the record search screen to search records for repository B when clicking on the "Add Relationship" button. We want to pre-populate an attribute (e.g., attribute1) of repository B in a drop-down list. Meanwhile, we do not want to pre-populate these attributes when we try to search records before repository B directly (on the Browse and Search screen for repository B).

Resolution

Use the context variable CONTEXT_RELATIONSHIP/NAME to determine if it is on the search screen through direct "Browse and Search" or through the "Add Relationship" button. Place the following searchcontrolrules.xml to the catalog id folder of B:

<?xml version="1.0" encoding="UTF-8"?>
<rulebase metaversion="1.0">
   <name>Search Control Rules</name>
   <description>Search Control Rules</description>

   <constraint>
      <name>con</name>
      <description>con</description>
      <usefor>
        <var>attribute1</var>
      </usefor>

      <condition>
            <defined>
               <var>CONTEXT_RELATIONSHIP/NAME</var>
            </defined>
      </condition>
      <action>
         <select novalue="no">
            <enum>
              <const type="string">A</const>
       <const type="string">B</const>
            </enum>
         </select>
      </action>
   </constraint>
</rulebase>

Issue/Introduction

How to pre-populate attributes only the in the related repository search screen and NOT in the repository search screen.

Additional Information

N/A