Products | Versions |
---|---|
TIBCO Collaborative Information Manager | - |
Not Applicable | - |
Resolution:
How to have two constraints work on same attribute, like for example trim the value and check for duplicate.
Environment:
TIBCO Product name and version: TIBCO Collaborative Information Manager 7.X.X and 8.X.X
Operating System(s): All Operating Systems
Symptoms:
Cause:
Resolution:
Having the below construct would implement the scenario where it is expected that the attribute UOM to needs to be unique and the value has to be stored without the leading and trailing spaces.
<execution_directive first_pass="required"/> is catch here.
<rulebase metaversion="1.0">
<name>Catalog Validations</name>
<description>Catalog Validations</description>
<execution_directive first_pass="required"/>
<constraint>
<name>Test1</name>
<description>Test1</description>
<action>
<assign>
<var>UOM</var>
<op func="trim">
<var>UOM</var>
</op>
</assign>
</action>
</constraint>
<constraint>
<name>Test</name>
<description>Test</description>
<usefor>
<var>UOM</var>
</usefor>
<action>
<check>
<explanation>This has to be unique in the master catalog</explanation>
<duplicate>
<var>UOM</var>
</duplicate>
</check>
</action>
</constraint>
</rulebase>
References:
None