4.1

Table Of Contents
Orchestrator JavaScript Examples
You can cut, paste, and adapt the Orchestrator JavaScript examples to help you write JavaScripts for common
orchestration tasks.
n
Basic Scripting Examples on page 120
Workflow scripted elements, actions, and policies require basic scripting of common tasks. You can cut,
paste, and adapt these examples into your scripted elements.
n
Email Scripting Examples on page 122
Workflow scripted elements, actions, and policies require scripting of common email-related tasks. You
can cut, paste, and adapt these examples into your scripted elements.
n
File System Scripting Examples on page 122
Workflow scripted elements, actions, and policies require scripting of common file system tasks. You
can cut, paste, and adapt these examples into your scripted elements.
n
LDAP Scripting Examples on page 123
Workflow scripted elements, actions, and policies require scripting of common LDAP tasks. You can cut,
paste, and adapt these examples into your scripted elements.
n
Logging Scripting Examples on page 123
Workflow scripted elements, actions, and policies require scripting of common logging tasks. You can
cut, paste, and adapt these examples into your scripted elements.
n
Networking Scripting Examples on page 124
Workflow scripted elements, actions, and policies require scripting of common networking tasks. You
can cut, paste, and adapt these examples into your scripted elements.
n
vCenter Server Scripting Examples on page 124
Workflow scripted elements can include scripting of common vCenter Server tasks. You can cut, paste,
and adapt these examples into your scripted elements.
n
Workflow Scripting Examples on page 126
Workflow scripted elements, actions, and policies require scripting examples of common workflow tasks.
You can cut, paste, and adapt these examples into your scripted elements.
Basic Scripting Examples
Workflow scripted elements, actions, and policies require basic scripting of common tasks. You can cut, paste,
and adapt these examples into your scripted elements.
Access XML Documents
The following JavaScript example allows you to access XML documents from JavaScript by using the
ECMAScript for XML (E4X) implementation in the Orchestrator JavaScript API.
NOTE In addition to implementing E4X in the JavaScript API, Orchestrator also provides a Document Object
Model (DOM) XML implementation in the XML plug-in. For information about the XML plug-in and its sample
workflows, see the vCenter Orchestrator Admninistration Guide.
var people = <people>
<person id="1">
<name>Moe</name>
</person>
<person id="2">
<name>Larry</name>
vCenter Orchestrator Developer's Guide
120 VMware, Inc.