Oracle Waveset 8.1.1 Deployment Reference

Calculating Values

Methods for dynamically calculating values within forms include:

Generating Field Values

In some forms, you might want to first display a set of abstract derived fields to the user, then generate a different set of concrete resource account attribute values when the form is submitted. This is known as form expansion. Expanded fields are often used in conjunction with derived fields.

Including Rules in Forms

In forms, you typically call a rule to calculate the allowedValues display property or within a <Disable> expression to control field visibility. Within forms, rules could be the most efficient mechanism for storage and reuse of:

For a comprehensive discussion of rules, see Chapter 4, Working with Rules.

Including XPRESS Statements

The XPRESS language is an XML-based expression and scripting language. Statements written in this language, called expressions, are used throughout Waveset to add data transformation capabilities to forms and to incorporate state transition logic within Waveset objects such as Workflow and forms.

XPRESS is a functional language that uses syntax based on XML. Every statement in the language is a function call that takes zero or more arguments and returns a value. Built-in functions are provided, and you can also define new functions. XPRESS also supports the invocation of methods on any Java class and the evaluation of Javascript within an expression.

For a comprehensive discussion of XPRESS features, see Chapter 5, XPRESS Language

Why Use XPRESS?

Expressions are used primarily for the following Waveset tasks:

The expressions contained in these elements can be used throughout Waveset.

Example Expression

In the following example, the <add> element represents a call to the XPRESS function named add.

<add> <ref>counter</ref> <i>10</i> </add>

This function is passed two arguments:

The value returned by the add function will then be the result of adding the integer 10 to the current value of the variable counter. Every function call returns a value for the next operation to use. For example, if the ref call returns the value of the counter, then the <i> call returns the integer 10, then the <add> call returns the addition of the two calls.

Example of Expression Embedded within Form

The following example shows the use of XPRESS logic embedded within an Waveset form. XPRESS is used to invoke one of the FormUtil Java methods that will produce the relevant role-related choices for display in the browser. Note that the expression is surrounded by the <expression> tag.

<Field name=’waveset.role’>
   <Display class=’Select’ action=’true’>
      <Property name=’title’ value=’Role’/>
      <Property name=’nullLabel’ value=’None’/>
      <Property name=’allowedValues’>
         <expression>
            <invoke class=’com.waveset.ui.FormUtil’ name=’getRoles’>
            <ref>:display.session</ref>
        <ref>waveset.original.role</ref>
            </invoke>
         </expression>
      </Property>
   </Display>
 </Field>