Testing expressions involves two steps:
Check the syntax with the lh command.
Enable tracing to ensure the expression is working as intended.
Confirm that you have %WSHOME%\bin in your PATH environment variable. (For information on changing environment variables to work with Identity Manager, see the section of Installation Guide that describes using command-line tools.)
If %WSHOME%\bin is not in your path, then you must change to %WSHOME%\bin before you can run the tools.
From the command line, enter lh xmlparse <xpress_file> where xpress_file represents the name of the file that contains the XML you want to test. This command parses the file for XML correctness and displays error messages in the console.
Consider putting %WSHOME%\bin in your PATH environment variable. This will permit you to use whichever directory you are currently in as your working directory. This will also allow you to run the Identity Manager lh command from any current working directory.
Once you have written and successfully stored an expression in the repository, you can turn on XPRESS tracing to determine if the expression is functioning correctly. XPRESS trace messages are sent to the standard output device. Since XPRESS is typically evaluated within the application server, the trace messages are sent to the console window or log file that was active when the application server was started.
There are two forms of XPRESS tracing:
Global trace. When global trace is enabled, all XPRESS expressions are traced.
Block-level trace. When block level tracing is used, only expressions within designated blocks are traced. Block tracing can be set only within a field element in a form or within an expression in a workflow.
Typically, block-level tracing is preferable because it reduces the amount of trace output, which is then easier to analyze.
To enable global trace, set a Waveset.properties file entry named xpress.trace to the value true. If you change the Waveset.properties file while the application server is running, you must either restart the application server, or go to the Debug Page and click Reload Properties.
To perform block-level trace, wrap the expressions you want to trace in a <block> expression and include the attribute trace=’true’ in the block start tag.
<block trace=’true’> <invoke name=’getTime’ class=’java.util.Date’/> </block> or <Default> <block trace = ’true’> <ref>global.accountId</ref> </block> </Default>
Do not use the <block> element in the following ways.
<block trace=’true’> <Field name =’field1’> … </Field> </block> or <Field name=’Field2’> <block trace=’true’> <Default> <ref>global.accounts</ref> </Default> </block> </Field>
The trace messages include the names of the functions, the values of each argument, and the return values.
To turn tracing off for XPRESS, set the xpress.trace value to false, and reload the Waveset.properties file.