Products | Versions |
---|---|
TIBCO MDM | - |
Not Applicable | - |
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).
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>