4.1

Table Of Contents
6 Click the timer.date parameter's Not set button to bind the parameter to an appropriate Date object.
The Waiting Timer selection dialog box opens, presenting a list of possible bindings.
n
Select a predefined Date object from the proposed list, for example one defined by a Scriptable
Task element elsewhere in the workflow.
n
Alternatively, create a Date object that sets a specific date and time for the workflow to await.
7 (Optional) Create a Date object that sets a specific date and time that the workflow awaits.
a Click Create parameter/attribute in workflow in the Waiting Timer selection dialog box.
The Parameter information dialog box appears.
b Give the parameter an appropriate name.
c Leave the type set to Date.
d Click Create workflow ATTRIBUTE with the same name.
e Click the Value property's Not set button to set the parameter value.
A calendar appears.
f Use the calendar to set a date and time at which to restart workflow.
g Click OK.
8 Click Save at the bottom of the workflow editor.
You defined a timer that suspends a timer-based long-running workflow until a set time and date.
What to do next
You can create a long-running workflow that waits for a trigger event before continuing.
Create a Trigger Object
Trigger objects monitor event triggers that plug-ins define. For example, the vCenter Server plug-in defines
these events as Task objects. When the task ends, the trigger sends a message to a waiting trigger-based long-
running workflow element, to restart the workflow.
The time-consuming event for which a trigger-based long-running workflow waits must return a VC:Task
object. For example, the startVM action to start a virtual machine returns a VC:Task object, so that subsequent
elements in a workflow can monitor its progress. A trigger-based long-running workflow's trigger event
requires this VC:Task object as an input parameter.
You create a Trigger object in a JavaScript function in a Scriptable Task element. This Scriptable Task element
can be part of the trigger-based long-running workflow that waits for the trigger event. Alternatively, it can
be part of a different workflow that provides input parameters to the trigger-based long-running workflow.
The trigger function must implement the createEndOfTaskTrigger() method from the Orchestrator API.
IMPORTANT You must define a timeout period for all triggers, otherwise the workflow can wait indefinitely.
Prerequisites
You must have created a workflow, opened it for editing in the workflow editor, and added some elements to
the workflow schema. The workflow must declare a VC:Task object as an attribute or input parameter, such as
a VC:Task object from a workflow or workflow element that starts or clones a virtual machine.
Procedure
1 Drag a Scriptable Task element from the Generic menu into the schema of a workflow.
vCenter Orchestrator Developer's Guide
60 VMware, Inc.