5.5

Table Of Contents
The OK scriptable task element requires the following scripted function.
body = "The VM '"+vm.name+"' has started successfully and is ready for use";
//Writes the following event in the vCO database
Server.log(body);
Send Email Failed Scriptable Task Element
The Send Email Failed scriptable task element receives notice that the sending of the email failed, and writes
the event in the Orchestrator log.
The following table shows the input parameter bindings that the Send Email Failed scriptable task element
requires.
Table 113. Bindings of the Send Email Failed Scriptable Task Element
Parameter Name Binding Type
Bind to Existing or
Create Parameter? Binding Values
vm
IN Bind
n
Local Parameter: vm
n
Source parameter: vm[in-
parameter]
n
Type: VC:VirtualMachine
n
Description:
The virtual machine to
power on.
toAddress
IN Bind
n
Local Parameter: toAddress
n
Source parameter:
toAddress[in-parameter]
n
Type: string
n
Description:
The email address of the
person to inform of the
result of this workflow
emailErrorCode
IN Create
n
Local Parameter:
emailErrorCode
n
Source parameter:
emailErrorCode[attrbute]
n
Type: string
n
Description:
Catch any exceptions while
sending an email
The Send Email Failed scriptable task element requires the following scripted function.
//Writes the following event in the vCO database
Server.error("Couldn't send result email to '"+toAddress+"' for VM '"+vm.name, "Exception found:
"+emailErrorCode);
Send Email Scriptable Task Element
The purpose of the Start VM and Send Email workflow is to inform an administrator when it starts a virtual
machine. To do so, you must define the scriptable task that sends an email. To send the email, the Send
Email scriptable task element needs an SMTP server, addresses for the sender and recipient of the email, the
email subject, and the email content.
The following table shows the input and output parameter bindings that the Send Email scriptable task
element requires.
Chapter 1 Developing Workflows
VMware, Inc. 95