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
Add a user interaction element to the workflow schema.
Procedure
- Log in to the Automation Orchestrator Client.
- Navigate to , and select your workflow.
- Select the Schema tab.
- Select your User interaction element.
- Create an exception handling variable.
- Under Exception handling, click Select variable.
- To create an exception handling variable, click Create New.
- Name the variable errorCode.
- Under Value, enter an appropriate error message.
- Click Create.
- 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 variable from the user interaction.
- Define the exception handling script.
- Enter an appropriate name for the Scriptable task element.
For example,
Log timeout.
- 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
Automation Orchestrator log, write the following function:
System.log("No response from user. Timed out.");
- Link and bind the scriptable task element that handles exceptions to the element that follows it in the workflow.
For example, link and bind the scriptable task element to a
Throw exception element to end the workflow with an error.
- To finish editing your workflow, click Save.
Results
You defined the exception behavior if the user interaction times out.
What to do next
Create the dialog box in which users provide input parameters. See Create the Input Parameters Dialog Box for the User Interaction.