Example Filtering Records Based on Effective Date using Context Variables

Declare RUL_EFF_DATE1 and RUL_SHORTDESC variables in TIBCO MDM Studio Rulebase Designer; specify usage="local".

Refer the Rulebase sample:

<rulebase metaversion="1.0" xmlns="http://www.tibco.com/cim/rulebase/beans">
<name>rule</name>
<declare usage="local">
<var>RUL_EFF_DATE1</var>
<datatype type="date"/>
</declare>
<declare usage="local">
    <var>RUL_SHORTDESC</var>
    <datatype type="string"/>
</declare>
<constraint>
    <name>con</name>
    <description>con</description>
<condition>
<and>
<eq>
<var>EFFECTIVEDATE</var>
<var>RUL_EFF_DATE1</var>
</eq>
<eq>
<var>SHORTDESC</var>
<var>RUL_SHORTDESC</var>
</eq>
</and>
</condition>
<action>
<access mode="hide_record"/>
</action>
</constraint>
</rulebase>

Pass the context variable in webservice request as below:

        <DataService version="2.0">
         <Identity>
            <DirectoryPath>
               <Directory type="Enterprise">Tech</Directory>
               <Directory type="User">jsmith</Directory>
            </DirectoryPath>
            <Authentication>a</Authentication>
         </Identity>
         <Transaction>
            <Context>
               <Variable name="RUL_EFF_DATE" type="date">07/11/2011</Variable>
            <Variable name="RUL_SHORTDESC" type="string">RECORD7</Variable>
            </Context>
            <Command type="Query">
               <StartCount>1</StartCount>
               <MaxCount>50</MaxCount>
               <MasterCatalogRecord etype="Entity">
                  <ExternalKeys>
                     <Key name="MASTERCATALOGNAME" type="string">CUSTOMER</Key>
                  </ExternalKeys>
               </MasterCatalogRecord>
            </Command>
         </Transaction>
             </DataService>

This hides all records with EFFECTIVEDATE=" 2011-07-11 00:00:00.000" and SHORTDESC =Record7.