Sun Identity Manager Deployment Reference

Basic Rule Call Syntax

Rules can be called from anywhere XPRESS is allowed, which includes forms, workflows, or even another rule.

Use the XPRESS <rule> expression to call a rule. For example:


<rule name=’Build Email’/>

When the XPRESS interpreter evaluates this expression, the interpreter assumes the value of the name attribute is the name of a rule object in the repository. The interpreter automatically loads the rule from the repository and evaluates that rule. The value returned by the rule becomes the result of the <rule> expression.

In the previous example, no arguments are passed explicitly to the rule. The next example uses an argument element to pass an accountId argument to the rule. In addition, the argument value is passed as a static string, jsmith.


<rule name=’getEmployeeId’>
    <argument name=’accountId’ value=’jsmith’/>
 </rule>

You can also use an expression to calculate the value of an argument, as follows. In this example, the argument value is calculated by evaluating a simple <ref> expression that returns the value of the view attribute user.waveset.accountId.


<rule name=’getEmployeeId’>
    <argument name=’accountId’>
       <ref>user.waveset.accountId</ref>
    </argument>
</rule>

Because calculating argument values by referencing attributes is so common, an alternate syntax is also provided.


<rule name=’getEmployeeId’>
    <argument name=’accountId’ value=’$(user.waveset.accountId)’/>
 </rule>

Both of the previous examples pass the value of the user.waveset.account view attribute as the value of the argument.