You can pass arguments to a rule to control its behavior, and a rule can reference and modify variables maintained by a form or workflow.
Rules are primarily referenced within forms and workflows, but you can also reference rules in other user-data related areas, such as
Roles: Use a role-assignment rule to dynamically assign owners and approvers to a role.
Active Sync: Use Process or Correction rules to control what happens when an Active Sync-enabled adapter detects changes to a resource account.
Reconciliation: Use special rule subtypes (such as confirmation and correlation rules) during reconciliation. These subtypes are described later in this chapter.
Because the XPRESS and XML Object languages are both written in XML, the XPRESS and XML Object code examples used in this chapter are similar.
The following example shows how to use the <Rule> element to define a basic rule expression, in which the rule definition name is getApprover, the rule argument name is department, the argument’s default value is Tampa, and the rule body returns the Sales Manager or HR Manager string values.
<Rule name=’getApprover’> <Comments> This rule determines the appropriate approver for a particular department.</Comment> <RuleArgument name=’department’/> <RuleArgument name=’location’ value=’Tampa’/> <cond> <eq><ref>department</ref><String>sales</String></eq> <cond> <eq><ref>location</ref><String>Tampa</String></eq> <String>Tampa Sales Manager</String> <String>Sales Manager</String> </cond> <String>HR Manager</String> </cond> <MemberObjectGroups> ObjectRef type=’ObjectGroup’ name=ExampleChoc’/> </MemberObjectGroups> </Rule>