Sun Identity Manager Deployment Reference

Java and JavaScript Expressions

Use the following functions to call and manipulate Java classes or JavaScript functions from within expressions.

invoke Function

Invokes a method on a Java object or class.

There are two forms of this function:

static method

<invoke class=’class name’ name=’method name’>
   <!--method argument 0 -->
   <!--method argument n-->

instance method

<invoke class=’method name’>
   <!--the object to invoke the method on -->
   <!--method argument 0 -->
   <!--method argument n-->

To use this function, you must be familiar with the class and method names you want to call, the arguments they take, and the method’s actions. This function is frequently used to call the following Identity Manager classes:

For more information, see the available documentation for these classes.

new Function

Creates an instance of a Java class. The class name is provided in the XML class attribute and must be fully qualified with the class package name.

You can also use this function to create a new object and return it as the value of an expression or rule without necessarily invoking methods on it.


<new class=’classname’/>
<!--constructor argument 0-->
<!--constructor argument n-->

script Function

Encapsulates a fragment of JavaScript. When this expression is evaluated, the JavaScript interpreter is launched to process the script. The value of the expression is the value of the last JavaScript statement. Within the script, the object env can be used to access variables in the host application.

Avoid using JavaScript in performance-critical expressions such as <Disable> expressions in forms. Short XPRESS expressions are easier to debug using the built-in tracing facilities. Use JavaScript for complex logic in workflow actions.


   var arg1 = env.get(’arg1’);
   arg1 + 100;

   var cal Now = Calendar.getInstance();
   cal Now.getTime()