5.5

Table Of Contents
You defined the input parameters that the user provides during a user interaction.
What to do next
Define the exception behavior if the user interaction encounters an error. See “Define User Interaction
Exception Behavior,” on page 52.
Define User Interaction Exception Behavior
If a user does not provide the input parameters within the timeout period, the user interaction returns an
exception. You can define the exception behavior in a scripted function.
If you do not define the action for the workflow to take if the user interaction times out, the workflow ends
in the Failed state. Defining the exception behavior is a good workflow development practice.
Prerequisites
n
Add a user interaction element to the workflow schema.
n
Set the security.group and timer.date attributes for the user interaction.
n
Define the external input parameters of the user interaction.
Procedure
1
Click the Edit icon ( ) of the User Interaction element in the workflow schema.
2 Click the Exception tab.
3 Click Not set for the output exception binding.
4 Click Create parameter/attribute in workflow to create an exception attribute to which to bind the user
interaction.
The Parameter information dialog box opens.
5 Create an errorCode attribute.
An errorCode attribute has the following default properties:
n
Name: errorCode
n
Type: string
n
Create: Create workflow ATTRIBUTE with the same name
n
Value: Type an appropriate error message.
6 Click OK to close the Parameter information dialog box.
7 Drag a scriptable task element over the user interaction element in the workflow schema.
A red dashed arrow, which represents the exception link, appears between the two elements. The
scriptable task element binds automatically to the errorCode attribute from the user interaction.
8 Double-click the scriptable task element and provide an appropriate name.
For example, Log timeout.
9 In the Scripting tab of the scriptable task element, write a JavaScript function to handle the exception.
For example, to record the timeout in the Orchestrator log, write the following function:
System.log("No response from user. Timed out.");
Developing with VMware vCenter Orchestrator
52 VMware, Inc.