Sun Identity Manager Deployment Reference

Variables and Function Definition Expressions

Use the following functions to reference and define variables and functions within expressions.

ref Function

References the value of a variable. The variable can either be an external variable supported by the host application or an internal variable defined with <defvar>.

Example 1


Example 2

<defvar name=’milk’><s>milkvalue</s></defvar>
<defvar name=’shake’><s>milk</s></defvar>

evaluates to <s>milkshake</s>

defvar Function

Defines a new variable. The variable can then be referenced by any expression within and below the containing expression in which the variable was defined. The variable must be given a name using the XML attribute name.

A defvar statement should not reference itself. If it does, it will cause a loop.

Note –

Avoid the following constructions.

<defvar name=’fullname’>


<defvar name=’counter’/>

Example 1

The following expression defines a variable and initializes its value to a list of two elements.

<defvar name=’theList’>

Example 2

The following expression defines a variable and initializes its value to the integer zero.

<defvar name=’counter’>

defarg Function

Defines an argument within a function defined with <defun>. Arguments are similar to variables, but they must be defined in the order in which arguments are passed to the function.


<defarg name=’arg1’/>
<defarg name=’arg2’/>

defun Function

Defines a new function. The <defarg> function must be used to declare the arguments to a function. Use the <call> function to execute the function. Functions are typically defined within forms.


<defun name=’add100’>
   <defarg name=’input’/>

call Function

Calls a user-defined function. The arguments to call are assigned to arguments with <defarg> in the so-called function. The order of the call arguments must match the order of the <defarg>s. In previous releases, the call function could be used to call rules. Now, use the rule function for that purpose.


The following expression returns 142.

<call name=’add100’>

rule Function

Calls a rule. The arguments to rule are passed by name using the argument element. The value of an argument can be specified with the value attribute if it is a simple string. The argument value can also be calculated with an expression by omitting the value attribute and instead writing an expression within the body of the argument element.

A <rule> element can also call another rule that dynamically calculate the name of another rule to call.

For more information on creating or calling rules in forms and workflows, see the chapter titled Rules.


The following expression returns the employee ID of the designated user.

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

<rule name=’getEmployeeId’>
   <argument name=’accountId’>

The following expression calls another rule that calculates the returned value.

    <argument name=’arg1’>