How to have two constraints work on same attribute, like for example trim the value and check for duplicate.

How to have two constraints work on same attribute, like for example trim the value and check for duplicate.

book

Article ID: KB0085653

calendar_today

Updated On:

Products Versions
TIBCO Collaborative Information Manager -
Not Applicable -

Description

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.

&ltexecution_directive first_pass="required"/> is catch here.

&ltrulebase metaversion="1.0">
  &ltname&gtCatalog Validations</name>
  &ltdescription&gtCatalog Validations</description>
  &ltexecution_directive first_pass="required"/>
  &ltconstraint>
    &ltname&gtTest1</name>
    &ltdescription&gtTest1</description>
    &ltaction>
      &ltassign>
        &ltvar&gtUOM</var>
        &ltop func="trim">
          &ltvar&gtUOM</var>
        </op>
      </assign>
    </action>
  </constraint>
  &ltconstraint>
    &ltname&gtTest</name>
    &ltdescription&gtTest</description>
    &ltusefor>
      &ltvar&gtUOM</var>
    </usefor>
    &ltaction>
      &ltcheck>
        &ltexplanation&gtThis has to be unique in the master catalog</explanation>
        &ltduplicate>
          &ltvar&gtUOM</var>
        </duplicate>
      </check>
    </action>
  </constraint>
</rulebase>

References:

None

Issue/Introduction

How to have two constraints work on same attribute, like for example trim the value and check for duplicate.