slideshow 1 slideshow 2 slideshow 3 slideshow 4 slideshow 5 slideshow 6 slideshow 7

Setting a timeout for User Interaction in vRealize Orchestrator

When using a User Interaction element in your workflow you might want to have it timeout after a certain amount of time. A user interaction accepts an input parameter of the Date-type that contains the date and time when the user interaction should timeout if it is not answered.
 
In the image below you see a workflow that contains a Scriptable task used to create the date_time variable to be used in the user interaction.

User Interaction in vRealize Orchestrator with timeout setting

The Javascript code from the Scriptable task is this (without the comments and logging):

timeout_date = new Date();
timeout_date.setTime( timeout_date.getTime() + (86400000) ); 
 
What is done here is that we get the current date and time and add the amount of milliseconds that represents one day. The math for this is:
1000 (milliseconds) * 3600 (seconds in an hour) * 24 (hours in a day) = 86,400,000
This will make the user interaction timeout after one day. If you would it to timeout after two hours the math would be: 1000 (milliseconds) * 3600 (seconds in an hour) * 2 = 7,200,000
 
The user interaction element then uses your date_time variable as input to decide when to timeout. When it does it throws an error that would end your workflow with a failed condition. If that is what you want then that's fine. But if you want to take action when it has timeout add a next element to the error channel of the input presentation to handle that. You can see that representation in the below image.
 

Scriptable task with javascript to set timeout value

 

Follow us on LinkedIn