This project has moved. For the latest updates, please go here.

<rule-ref> element

A rule or rule group only needs to be defined once to be able to be reused in another rule group. The <rule-ref> element is used to refer to a previously defined rule or rule group using its ID.

XML Attribute Description Allowed Values
rule-id The unique ID of the rule being referenced Any ID defined an existing rule or rule-group object

Example

<rule-group id="AccountNameIsPresentAndGidLessThan500" operator="And">
    <rule xsi:type="sshma:rule-AttributePresenceRule" id="AccountNameIsPresent" attribute="accountName" operator="IsPresent"/>
    <rule xsi:type="sshma:rule-SingleValuedAttributeValueRule" id="GidLessThan500" attribute="gid" operator="LessThan" value="500"/>
</rule-group>

<rule-group id="RuleRefExample" operator="And">
    <rule-ref rule-id="AccountNameIsPresentAndGidLessThan500"/>
    <rule xsi:type="sshma:rule-AttributeChangeRule" id="groupAccountNameModified" attribute="accountName" triggers="Add,Update"/>
</rule-group>
The example above re-uses the AccountNameIsPresentAndGidLessThan500 group in the RuleRefExample group, saving from having to re-write the rules out again.

Last edited Sep 21, 2013 at 2:34 AM by ryannewington, version 1