You can test JavaScript expressions
to ensure that the JavaScript syntax
is correctly constructed.
About this task
To ensure that there are no syntax errors flagged at run
time when the event runtime attempts to resolve the JavaScript expression, you can test the JavaScript expression in Event Designer.
In
the Event Explorer view, open the business object, event, or action
asset in which you want to use a JavaScript expression.
Procedure
- In the relevant field Definition section,
select Javascript as the Definition Type. Enter
the JavaScript expression.
- When the JavaScript expression
is complete, click Test JavaScript.
- The Assign Temporary Values window
opens. Enter suitable test values for each of the fields listed in
the Name column. The Name column lists all of the fields
that are used in the JavaScript expression.
If a value field is left blank, the corresponding field is replaced
with "NULL" in the JavaScript expression.
All of the fields are substituted, with either the test values that
you enter or "NULL".
- Click Run. The test values
are substituted into the expression and the resulting JavaScript code is executed.
- The Console view opens and the JavaScript Test Results are
displayed.
- If there are any errors reported, correct the JavaScript expression and test the updated
code.
Example
The following screen captures show the sequence used to test
the JavaScript expression
used in a field called
minutes added.
Enter
the JavaScript expression
and then click Test JavaScript.
Enter suitable
test values for the fields used in the JavaScript expression and click Run.
Check the JavaScript Test Results to
see whether the test is successful.