Developing with VMware vCenter Orchestrator vCenter Orchestrator 5.5 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition. To check for more recent editions of this document, see http://www.vmware.com/support/pubs.
Developing with VMware vCenter Orchestrator You can find the most up-to-date technical documentation on the VMware Web site at: http://www.vmware.com/support/ The VMware Web site also provides the latest product updates. If you have comments about this documentation, submit your feedback to: docfeedback@vmware.com Copyright © 2008–2013 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws.
Contents Developing with VMware vCenter Orchestrator 7 1 Developing Workflows 9 Key Concepts of Workflows 11 Workflow Parameters 11 Workflow Attributes 11 Workflow Schema 12 Workflow Presentation 12 Workflow Tokens 12 Phases in the Workflow Development Process 12 Access Rights for the Orchestrator Client 12 Testing Workflows During Development 13 Creating and Editing a Workflow 13 Create a Workflow 13 Edit a Workflow 14 Edit a Workflow from the Standard Library 14 Workflow Editor Tabs 15 Provide General
Developing with VMware vCenter Orchestrator Create the Input Parameters Dialog Box for the User Interaction 53 Respond to a Request for a User Interaction 54 Calling Workflows Within Workflows 54 Workflow Elements that Call Workflows 55 Call a Workflow Synchronously 57 Call a Workflow Asynchronously 58 Schedule a Workflow 59 Prerequisites for Calling a Remote Workflow from Within Another Workflow Call Several Workflows Simultaneously 60 59 Running a Workflow on a Selection of Objects 61 Implement the S
Contents Develop a Complex Workflow 102 Create the Complex Workflow Example 103 Create a Custom Action for the Complex Workflow Example 104 Create the Schema of the Complex Workflow Example 105 Create the Complex Workflow Example Zones 107 Define the Parameters of the Complex Workflow Example 109 Define the Bindings for the Complex Workflow Example 109 Set the Complex Workflow Example Attribute Properties 119 Create the Layout of the Complex Workflow Example Input Parameters Validate and Run the Complex
Developing with VMware vCenter Orchestrator Edit the Resource Element Information and Access Rights 146 Save a Resource Element to a File 147 Update a Resource Element 147 Add a Resource Element to a Workflow 148 Add a Resource Element to a Web View 149 5 Creating Packages 151 Create a Package 152 Set User Permissions on a Package 153 Index 155 6 VMware, Inc.
Developing with VMware vCenter Orchestrator Developing with VMware vCenter Orchestrator provides information and instructions for developing custom ® VMware vCenter Orchestrator workflows and actions. In addition, the documentation contains information about the Orchestrator elements that require scripting and provides JavaScript examples. Developing with VMware vCenter Orchestrator also provides instructions about how to create resources and packages.
Developing with VMware vCenter Orchestrator 8 VMware, Inc.
Developing Workflows 1 You develop workflows in the Orchestrator client interface. Workflow development involves using the workflow editor, the built-in Mozilla Rhino JavaScript scripting engine, and the Orchestrator and vCenter Server APIs. n Key Concepts of Workflows on page 11 Workflows consist of a schema, attributes, and parameters. The workflow schema is the main component of a workflow as it defines all the workflow elements and the logical connections between them.
Developing with VMware vCenter Orchestrator n Obtaining Input Parameters from Users When a Workflow Starts on page 41 If a workflow requires input parameters, it opens a dialog box in which users enter the required input parameter values when it runs. You can organize the content and layout, or presentation, of this dialog box in Presentation tab in the workflow editor.
Chapter 1 Developing Workflows n Restore Deleted Workflows on page 79 You can restore workflows that have been deleted from the workflow library. n Develop a Simple Example Workflow on page 79 Developing a simple example workflow demonstrates the most common steps in the workflow development process.
Developing with VMware vCenter Orchestrator Workflow Schema A workflow schema is a graphical representation that shows the workflow as a flow diagram of interconnected workflow elements. The workflow schema is the most important element of a workflow as it determines its logic. Workflow Presentation When users run a workflow, they provide the values for the input parameters of the workflow in the workflow presentation.
Chapter 1 Developing Workflows To allow you to access the Orchestrator client, the administrator must either add you to the Orchestrator administrator LDAP group, or set View, Inspect, Edit, Execute, or Admin permissions to a group that you are a member of. Testing Workflows During Development You can test workflows at any point during the development process, even if you have not completed the workflow or included an end element.
Developing with VMware vCenter Orchestrator A new empty workflow is created in the folder that you chose. What to do next You can edit the workflow. Edit a Workflow You edit a workflow to make changes to an existing workflow or to develop a new empty workflow. Procedure 1 From the drop-down menu in the Orchestrator client, select Design. 2 Click the Workflows view. 3 Expand the workflows hierarchical list to navigate to the workflow that you want to edit.
Chapter 1 Developing Workflows 11 Right-click the duplicate workflow and select Edit. The workflow editor opens. You can edit the duplicate workflow. You duplicated a workflow from the standard library. You can edit the duplicate workflow. Workflow Editor Tabs The workflow editor consists of tabs on which you edit the components of the workflows. Table 1‑1.
Developing with VMware vCenter Orchestrator Provide General Workflow Information You provide a workflow name and desription, define attributes and certain aspects of workflow behavior, set the version number, check the signature, and set user permissions in the General tab in the workflow editor. Prerequisites Open a workflow for editing in the workflow editor. Procedure 1 Click the General tab in the workflow editor. 2 Click the Version digits to set a version number for the workflow.
Chapter 1 Developing Workflows n Define Workflow Attributes on page 17 Workflow attributes are the data that workflows process. n Attribute and Parameter Naming Restrictions on page 18 You can use OGNL expressions to determine input parameters dynamically when a workflow runs. The Orchestrator OGNL parser uses certain keywords during OGNL processing that you cannot use in workflow attribute or parameter names.
Developing with VMware vCenter Orchestrator Procedure 1 Click the General tab in the workflow editor. The attributes pane appears in the bottom half of the General tab. 2 Right-click in the attributes pane and select Add Attribute. A new attribute appears in the attributes list, with String as its default type. 3 Click the attribute name to change it. The default name is attX, where X is a number. NOTE Workflow attributes must not have the same name as any of the workflow's parameters.
Chapter 1 Developing Workflows Table 1‑2.
Developing with VMware vCenter Orchestrator n Foreach Elements and Composite Types on page 38 You can insert a Foreach element in the workflow that you develop to run a sub-workflow that iterates over arrays of parameters or attributes. To improve the understanding and readability of the workflow, you can group several workflow parameters of different types that are logically connected in a single type that is called a composite type.
Chapter 1 Developing Workflows 4 (Optional) Right-click an element in the schema and select Copy. 5 (Optional) Right-click at an appropriate position in the schema and select Paste. Copying and pasting existing schema elements is a quick way of adding similar elements to the schema. All of the settings of the copied element appear in the pasted element, except for the business state. Adjust the pasted element settings accordingly.
Developing with VMware vCenter Orchestrator What to do next You must link and bind the copied schema elements to the existing workflow schema. Promote Input and Output Parameters You can promote the input and output parameters of a child element to the parent workflow. You can promote a custom attribute that you have defined on the General tab of the workflow editor. You can promote predefined attributes only by replacing an input parameter with an attribute of matching type.
Chapter 1 Developing Workflows Procedure 1 (Optional) If you are editing a workflow in the workflow editor, click Save and Close to exit the editor. 2 From the Orchestrator client menu, select Tools > User preferences. 3 Click the General tab. 4 Type the number of results for searches to return in the Finder Maximum Size text box. 5 Click Save and Close in the User Preferences dialog box. You modified the number of results that searches return.
Developing with VMware vCenter Orchestrator Table 1‑3. Schema Elements and Icons (Continued) Schema Element Name 24 Description Icon Location in Workflow Editor User Interaction Allows users to pass new input parameters into the workflow. You can design how the user interaction element presents the request for input parameters and place constraints on the parameters that users can provide. You can set permissions to determine which users can provide the input parameters.
Chapter 1 Developing Workflows Table 1‑3. Schema Elements and Icons (Continued) Schema Element Name Description Icon Location in Workflow Editor Action Element Calls on an action from the Orchestrator libraries of actions. When a workflow reaches an action element, it calls and runs that action. Generic workflow palette Workflow Element Starts another workflow synchronously. As soon as a workflow reaches a workflow element in its schema, it runs that workflow as part of its own process.
Developing with VMware vCenter Orchestrator Table 1‑3. Schema Elements and Icons (Continued) Schema Element Name Description Icon Location in Workflow Editor Nested Workflows Starts several workflows simultaneously. You can choose to nest local workflows and remote workflows that are in a different Orchestrator server. You can also run workflows with different credentials. The workflow waits until all the nested workflows complete before it continues its run.
Chapter 1 Developing Workflows 4 Provide a name for the schema element in the Name text box. This is the name that appears in the schema element in the workflow schema diagram. 5 From the Interaction drop-down menu, select a description. The Interaction property allows you to select between standard descriptions of how this element interacts with objects outside of the workflow. This property is for information only. 6 (Optional) Provide a business status description in the Business Status text box.
Developing with VMware vCenter Orchestrator Table 1‑4. Properties Tabs per Schema Element (Continued) Schema Element Property Tab Description Applies to Schema Element Type IN The IN binding for this element. The IN binding defines the way in which the schema element receives input from the element that precedes it in the workflow. n n n n n n n Info The schema element's general properties and description. The information the Info tab displays depends on the type of schema element.
Chapter 1 Developing Workflows Links and Bindings Links between elements determine the logical flow of the workflow. Bindings populate elements with data from other elements by binding input and output parameters to workflow attributes. To understand links and bindings, you must understand the difference between the logical flow of a workflow and the data flow of a workflow.
Developing with VMware vCenter Orchestrator This example workflow can take the following paths through its logical flow. n n n n Standard path, true decision result, no exceptions. a The decision element returns true. b The SnapVMsInResourcePool workflow runs successfully. c The sendHtmlEmail action runs successfully. d The workflow ends successfully in the completed state. Standard path, false decision result, no exceptions. a The decision element returns false.
Chapter 1 Developing Workflows n Verify that the Schema tab of the workflow editor contains elements. Procedure 1 Place the pointer on the element that you want to connect to another element. A blue and a red arrow appear on the element's right. 2 Place the pointer on the blue arrow. The blue arrow enlarges. 3 Left-click the blue arrow, hold down the left mouse button, and move the pointer to the target element.
Developing with VMware vCenter Orchestrator Figure 1‑2. Example of Workflow Data Flow The data flows through the workflow as follows. 32 1 The workflow starts with input parameters a and b. 2 The first element processes parameter a and binds the result of the processing to workflow attribute c. 3 The first element processes parameter b and binds the result of the processing to workflow attribute d.
Chapter 1 Developing Workflows Element Bindings You must bind all workflow element input and output parameters to workflow attributes. Bindings set data in the elements, and define the output and exception behavior of the elements. Links define the logical flow of the workflow, whereas bindings define the data flow. To set data in an element, generate output parameters from the element after processing, and handle any errors that might occur when the element runs, you must set the element binding.
Developing with VMware vCenter Orchestrator 2 Click the IN tab. The contents of the IN tab depend on the type of element you selected. 3 n If you selected a predefined task, workflow, or action element, the IN tab lists the possible local input parameters for that type of element, but the binding is not set.
Chapter 1 Developing Workflows Decisions are always Boolean functions. The only possible outcomes for each decision are true or false. Custom Decisions Custom decisions differ from standard decisions in that you define the decision statement in a script. Custom decisions return true or false according to the statement you define, as the following example shows.
Developing with VMware vCenter Orchestrator Delete a Linked Decision Element When you delete a linked decision element from a workflow schema, you must specify which workflow paths to delete. Prerequisites Verify that the Schema tab of the workflow editor contains elements, including at least one decision element with true and false paths. Procedure 1 Select the decision element and press Delete. A dialog box with available options appears. 2 3 Select which decision branch to delete.
Chapter 1 Developing Workflows 6 Select a decision statement from the drop-down menu. The statements that the menu proposes are contextual, and differ according to the type of input parameter selected. 7 Add a value that you want the decision statement to match. Depending on the input type and the statement you select, you might see a Not Set (NULL) link in the value text box. Clicking this link gives you a predefined choice of values.
Developing with VMware vCenter Orchestrator 5 Click the Not set button to set the Output Exception Binding value. n Select a parameter to bind to the exception output parameter from the exception attribute binding dialog box. n Click Create parameter/attribute in workflow to create an exception output parameter. 6 Click the target element that defines the exception handling behavior. 7 Click the IN tab in the schema element properties tabs at the bottom of the Schema tab.
Chapter 1 Developing Workflows Using Composite Types A composite type is a group of more than one input parameter or attribute that are connected logically but are of different types. In a Foreach element, you can bind a composite type as an iterator. In this way, the Foreach element takes the values for the grouped parameters at once in every subsequent run of the workflow. For example, suppose that you are about to rename a virtual machine. You need the virtual machine object and its new name.
Developing with VMware vCenter Orchestrator d Select Bind as iterator. You can select Bind as iterator to indicate that the subworkflow must iterate over this parameter or attribute. e Click Create parameter/attribute in workflow. The parameter type must be array so that the subworkflow iterates over the values of this array. f 8 Select Create workflow OUTPUT PARAMETER with the same name and click Ok. On the Outputs tab, verify that the subworkflow's parameters are added as elements of type array.
Chapter 1 Developing Workflows Example: Rename Virtual Machines Suppose that you want to rename 10 virtual machines at a time. For this purpose, you insert a Foreach element in a workflow and select the Rename virtual machine workflow in the element. You create a composite type to connect the vm and the name parameters explicitly. You bind the composite type as an iterator, thus creating a single array that contains both the vm and the name parameter.
Developing with VMware vCenter Orchestrator Defining Presentation Display Groups Each input step can have nodes of its own called display groups. The display groups define the order in which parameter input text boxes appear within their section of the input parameters dialog box. You can define display groups independently of input steps.
Chapter 1 Developing Workflows Setting Parameter Properties Orchestrator allows you to define properties to qualify the input parameter values that users provide when they run workflows. The parameter properties you define impose limits on the types and values of the input parameters the users provide. Every parameter can have several properties. You define an input parameter's properties in the Properties tab for a given parameter in the Presentation tab.
Developing with VMware vCenter Orchestrator 6 Under Value, make the property value either static or dynamic by selecting the corresponding symbol from the drop-down menu. Option Description Static property Dynamic property 7 If you set the property value to static, you select a property value according to the type of parameter for which you are setting the properties.
Chapter 1 Developing Workflows Table 1‑5. Workflow Input Parameter Properties (Continued) Parameter Property Parameter Type Description Predefined answers All simple types Pre-defines a list of possible values for the property as an array of simple types. You either define the array manually or the property calls an action that returns an array of objects of the appropriate type.
Developing with VMware vCenter Orchestrator Table 1‑6. Predefined OGNL Constant Values Constant Value Description ${#__current} Current value of the custom validation property or matching expression property ${#__username} User name of the user who started the workflow ${#__userdisplayname} Display name of the user who started the workflow ${#__serverurl} URL containing the IP address of the server from which the user starts the workflow.
Chapter 1 Developing Workflows 6 Define the External Inputs for a User Interaction on page 51 You specify the information that users must provide during a workflow run as the input parameters of a user interaction. 7 Define User Interaction Exception Behavior on page 52 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.
Developing with VMware vCenter Orchestrator n Identify an LDAP user group to respond to the user interaction request. Procedure 1 Click the Edit icon ( ) of the User Interaction element in the workflow schema. 2 Click the Attributes tab for the user interaction. 3 Click Not set for the security.group source parameter to set which users can respond to the user interaction. 4 (Optional) Select NULL to allow all users to respond to the request for user interaction.
Chapter 1 Developing Workflows Procedure 1 Click the Edit icon ( ) of the User Interaction element in the workflow schema. 2 Click the Attributes tab for the user interaction. 3 Click Not set for the timeout.date source parameter to set the timeout parameter value. 4 (Optional) Select NULL to allow the user interaction to set the workflow to wait indefinitely for the user to respond to the user interaction.
Developing with VMware vCenter Orchestrator 5 Click Create parameter/attribute in workflow to create a workflow attribute. a Name the attribute timerDate. b Select Date from the list of attribute types. c Select Create workflow ATTRIBUTE with the same name. d Leave the attribute value set to Not set, because a scripted function will provide this value. e Click OK. 6 Click the Scripting tab for the scripted workflow element.
Chapter 1 Developing Workflows Procedure 1 Click the Edit icon ( ) of the User Interaction element in the workflow schema. 2 Click the Attributes tab for the user interaction. 3 Click Not set for the timeout.date source parameter to set the timeout parameter value. 4 Select the Date object that encapsulates a relative time and date that you defined in a scripted function and click Select. You set the timeout.date attribute to a relative date and time that a scripted function calculates.
Developing with VMware vCenter Orchestrator You defined the input parameters that the user provides during a user interaction. What to do next Define the exception behavior if the user interaction encounters an error. See “Define User Interaction Exception Behavior,” on page 52. Define User Interaction Exception Behavior 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.
Chapter 1 Developing Workflows 10 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. 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,” on page 53.
Developing with VMware vCenter Orchestrator You created the input parameters dialog box in which users provide input parameters to respond to a user interaction during a workflow run. What to do next For information about creating the presentation steps and groups and setting input parameter properties, see “Creating the Input Parameters Dialog Box In the Presentation Tab,” on page 41.
Chapter 1 Developing Workflows n Call a Workflow Asynchronously on page 58 Calling a workflow asynchronously runs the called workflow independently of the calling workflow. The calling workflow continues its run without waiting for the called workflow to complete. n Schedule a Workflow on page 59 You can call a workflow from a workflow and schedule it to start at a later time and date.
Developing with VMware vCenter Orchestrator Scheduled Workflows A workflow can call a workflow but defer starting that workflow until a later time and date. The calling workflow then continues its run until it ends. Calling a scheduled workflow creates a task to start that workflow at the given time and date. When the calling workflow has run, you can view the scheduled workflow in the Scheduler and My Orchestrator views in the Orchestrator client. Scheduled workflows only run once.
Chapter 1 Developing Workflows 10 Save and close the workflow editor. 11 Repeat Step 5 to Step 10 for all the workflows that use the modified workflow. You propagated a changed workflow to other workflows that call it. Propagate the Input Parameters and Presentation of a Child Workflow to the Parent Workflow If you develop a workflow that calls other workflows, you can propagate the input parameters and the presentation of the child workflows to the parent workflow.
Developing with VMware vCenter Orchestrator 6 Bind the required output parameters to the workflow in the OUT tab of the workflow schema element's. 7 Define the exception behavior of the workflow in the Exceptions tab. 8 Click Close. 9 Click Save at the bottom of the workflow editor. You called a workflow synchronously from another workflow.
Chapter 1 Developing Workflows Schedule a Workflow You can call a workflow from a workflow and schedule it to start at a later time and date. You schedule workflows in another workflow by using the Schedule Workflow element. Prerequisites n Open a workflow for editing in the workflow editor. n Add some elements to the workflow schema. Procedure 1 Drag a Schedule Workflow element from the Generic menu to the appropriate position in the workflow schema.
Developing with VMware vCenter Orchestrator To ensure that the parameters of the remote workflow are resolvable, the inventory objects that the workflow uses must be available both in the remote and the local Orchestrator servers. In case the remote workflow uses objects from a plug-in, the same plug-in must be available on both Orchestrator servers. The inventories of the remote plug-in and the local plug-in must be identical.
Chapter 1 Developing Workflows 8 Define the credentials with which to access the remote server. n Select Inherit to use the same credentials as the user who runs the calling workflow. n Select Dynamic and click Not set to select a set of dynamic credentials that a parameter of the credentials type defines elsewhere in the workflow. n Select Static and click Not set to enter the credentials directly.
Developing with VMware vCenter Orchestrator How to create a workflow that runs a workflow on an array of objects in a loop of workflow elements is demonstrated in “Develop a Complex Workflow,” on page 102. How to run a workflow in a scripted For loop is demonstrated in “Workflow Scripting Examples,” on page 136.
Chapter 1 Developing Workflows 6 Select either of the Start workflows in a series or Start workflows in parallel workflows and link the workflow element to the other elements. 7 Bind the wf input of the Start workflows in a series or Start workflows in parallel workflow to the workflow to run on the objects. For example, to remove any snapshots of all the virtual machines returned by the getAllVirtualMachinesByFolder action, select the Remove all snapshots workflow.
Developing with VMware vCenter Orchestrator n Add some elements to the workflow schema. Procedure 1 2 3 4 5 Drag a Scriptable task element from the Generic menu to the schema of a workflow, before the element that requires the relative Date object for its timeout.date attribute. Click the Edit icon ( ) of the Scriptable task element in the workflow schema. Provide a name and description for the scripted workflow element in the Info properties tab.
Chapter 1 Developing Workflows Prerequisites n Create a workflow. n Open the workflow for editing in the workflow editor. n Add some elements to the workflow schema. Procedure 1 Drag a Waiting Timer element from the Generic menu to the position in the workflow schema at which to suspend the workflow's run. If you implement a scriptable task to calculate the time and date, this element must precede the Waiting Timer element.
Developing with VMware vCenter Orchestrator 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.
Chapter 1 Developing Workflows 10 Create an output parameter with the following properties. a Create the Name property with the value trigger. b Create the Type property with the value Trigger. c Click Create ATTRIBUTE with same name to create the attribute. d Leave the value as Not set. 11 Define any exception behavior in the Exceptions properties tab. 12 Define a function to generate a Trigger object in the Scripting tab.
Developing with VMware vCenter Orchestrator 4 Click the Attributes properties tab. The trigger.ref parameter appears in the list of attributes. 5 Click the trigger.ref parameter's Not set link to bind the parameter to an appropriate Trigger object. The Waiting Event selection dialog box opens, presenting a list of possible parameters to which to bind. 6 Select a predefined Trigger object from the proposed list.
Chapter 1 Developing Workflows 5 Right-click the folder you created and select New element. 6 Provide a name for the configuration element and click Ok. The configuration element editor opens. 7 Increment the version number by clicking the version digits in the General tab and providing a version comment. 8 Provide a description of the configuration element in the Description text box in the General tab. 9 Click the Attributes tab. 10 Click the Add attribute icon ( ) to create a new attribute.
Developing with VMware vCenter Orchestrator Edit The user can edit the workflow. Admin The user can set permissions on the workflow and has all other permissions. The Admin permission includes the View, Inspect, Edit, and Execute permissions. All the permissions require the View permission. If you do not set any permissions on a workflow, the workflow inherits the permissions from the folder that contains it.
Chapter 1 Developing Workflows By default, Orchestrator always performs workflow validation when you run a workflow. You can change the default validation behavior in the Orchestrator client. See “Testing Workflows During Development,” on page 13. For example, sometimes during workflow development you might want to run a workflow that you know to be invalid, for testing purposes. Validate a Workflow and Fix Validation Errors You must validate a workflow before you can run it.
Developing with VMware vCenter Orchestrator Debugging Workflows Orchestrator provides a workflow debugging tool. You can debug a workflow to inspect the input and output parameters and attributes at the start of any activity, replace parameter or attribute values during a workflow run in edit mode, and resume a workflow from the last failed activity. You can debug workflows from the standard workflow library and custom workflows. You can debug custom workflows while developing them in the workflow editor.
Chapter 1 Developing Workflows Example Workflow Debugging You can debug a workflow from the standard workflow library. For example, if you provide an incorrect recipient address, you can correct the value when you debug the Example interaction with email workflow. Prerequisites n Configure the Mail plug-in in the Orchestrator configuration interface. n Log in to the Orchestrator client as a user who can run Mail workflows. Procedure 1 From the drop-down menu in the Orchestrator client, select Design.
Developing with VMware vCenter Orchestrator 5 The next schema element starts running. This sequence repeats for each schema element until the end of the workflow. Workflow Token Check Points When a workflow runs, each schema element is a check point. After each schema element runs, Orchestrator stores workflow token attributes in the database, and the next schema element starts running.
Chapter 1 Developing Workflows 4 Right-click the Create simple virtual machine workflow and select Start workflow. 5 Provide the following information into the Start workflow input parameters dialog box to create a virtual machine in a vCenter Server connected to Orchestrator. Option Action Virtual machine name Name the virtual machine orchestrator-test. Virtual machine folder a b Click Not set for the Virtual machine folder value. Select a virtual machine folder from the inventory.
Developing with VMware vCenter Orchestrator Resuming a Failed Workflow Run If a workflow fails, Orchestrator provides an option to resume the workflow run from the last failed activity. You can change the parameters of the workflow and attempt to resume it, or retain the parameters and make changes to external components that affect the workflow run.
Chapter 1 Developing Workflows Set Custom Properties for Resuming Failed Workflow Runs By default, Orchestrator is not set up to resume failed workflow runs. You can enable Orchestrator to resume failed workflow runs and set a custom timeout period after which failed workflow runs cannot be resumed. Procedure 1 On the Orchestrator server system, navigate to the folder that contains configuration files.
Developing with VMware vCenter Orchestrator Generate Workflow Documentation You can export documentation in PDF format about a workflow or a workflow folder that you select at any time. The exported document contains detailed information about the selected workflow or the workflows in the folder. The information about each workflow includes name, version history of the workflow, attributes, parameter presentation, workflow schema, and workflow actions.
Chapter 1 Developing Workflows 3 Select a workflow version and click Revert to restore the state of the workflow. CAUTION If you have not saved the current workflow version, it is deleted from the version history and you cannot revert back to the current version. The workflow state is reverted to the state of the selected version. Restore Deleted Workflows You can restore workflows that have been deleted from the workflow library.
Developing with VMware vCenter Orchestrator Procedure 1 Create the Simple Workflow Example on page 81 You must begin the workflow development process by creating the workflow in the Orchestrator client. 2 Create the Schema of the Simple Workflow Example on page 82 You can create a workflow's schema in the workflow editor. The workflow schema contains the elements that the workflow runs and determines the logical flow of the workflow.
Chapter 1 Developing Workflows Create the Simple Workflow Example You must begin the workflow development process by creating the workflow in the Orchestrator client. Prerequisites Verify that the following components are installed and configured on the system.
Developing with VMware vCenter Orchestrator Create the Schema of the Simple Workflow Example You can create a workflow's schema in the workflow editor. The workflow schema contains the elements that the workflow runs and determines the logical flow of the workflow. Prerequisites Complete the following tasks. n “Create the Simple Workflow Example,” on page 81. n Open the workflow for editing in the workflow editor. Procedure 1 Click the Schema tab in the workflow editor.
Chapter 1 Developing Workflows 11 From the Generic menu, drag the following scriptable task elements into the schema. n Drag a scriptable task element to the startVM action element and name the scriptable task element Start VM Failed. n Drag a scriptable task element to the vim3WaitTaskEnd action element and name the scriptable task element Timeout 1. n Drag a scriptable task element to the vim3WaitToolsStarted action element and name the scriptable task element Timeout 2.
Developing with VMware vCenter Orchestrator What to do next You can highlight different zones in the workflow. (Optional) Create the Simple Workflow Example Zones You can emphasize different zones in workflow by adding workflow notes of different colors. Creating different workflow zones helps to make complicated workflow schema easier to read and understand. Prerequisites Complete the following tasks. n “Create the Simple Workflow Example,” on page 81.
Chapter 1 Developing Workflows Figure 1‑4. Start VM and Send Email Example Workflow Zones What to do next You must define the workflow's attributes and input and output parameters. Define the Parameters of the Simple Workflow Example In this phase of workflow development, you define the input parameters that the workflow requires to run.
Developing with VMware vCenter Orchestrator 5 Click the Type text box and type vc:virtualm in the search text box in the parameter type dialog box. 6 Select VC:VirtualMachine from the proposed list of parameter types and click Accept. 7 Add a description of the parameter in the Description text box. For example, type The virtual machine to power on. 8 9 Repeat Step 2 through Step 7 to create a second input parameter, with the following values.
Chapter 1 Developing Workflows Bind the Action Elements of the Simple Workflow Example You can bind a workflow's elements together in the workflow editor. Bindings define how the action elements process input parameters and generate output parameters. Prerequisites Complete the following tasks. n “Create the Simple Workflow Example,” on page 81. n “Create the Schema of the Simple Workflow Example,” on page 82. n “Define the Parameters of the Simple Workflow Example,” on page 85.
Developing with VMware vCenter Orchestrator 10 Repeat the preceding steps to bind the input and output parameters to the vim3WaitTaskEnd and vim3WaitToolsStarted action elements. “Simple Workflow Example Action Element Bindings,” on page 88 lists the bindings for the vim3WaitTaskEnd and vim3WaitToolsStarted action elements. 11 Click Save at the bottom of the workflow editor's Schema tab. The action elements' input and output parameters are bound to the appropriate parameter types and values.
Chapter 1 Developing Workflows Table 1‑7. Binding Values of the vim3WaitTaskEnd Action (Continued) Parameter Name Binding Type Bind to Existing or Create Parameter? Binding Values pollRate IN Create n n Local Parameter: pollRate Source parameter: pollRate[attribute] Type: number n Value: 2 n Description: Polling rate in seconds at which vim3WaitTaskEnd checks the advancement of the vCenter Server task.
Developing with VMware vCenter Orchestrator Table 1‑8. Binding Values of the vim3WaitToolsStarted Action Parameter Name Binding Type Bind to Existing or Create Parameter? Binding Values vm IN Automatic binding n Local Parameter: vm n Source parameter: vm[inparameter] Type: VC:VirtualMachine Value: Not editable, variable is not a workflow attribute. Description: The virtual machine to start.
Chapter 1 Developing Workflows 2 3 Set the following general information in the Info tab. Option Action Interaction Select No External interaction. Business Status Select the check box and add the text VM already powered on. Description Leave the text The VM is already powered on, bypassing startVM and waitTaskEnd, checking if the VM tools are up and running.. Click the IN tab. Because this is a custom scriptable task element, no properties are predefined for you.
Developing with VMware vCenter Orchestrator Table 1‑9. Bindings of the Start VM 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[inparameter] Type: VC:VirtualMachine Description: The virtual machine to power on.
Chapter 1 Developing Workflows Table 1‑10. Bindings of the Timeout 1 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[inparameter] Type: VC:VirtualMachine Description: The virtual machine to start. n n errorCode IN Bind n n n n body OUT Bind Local Parameter: errorCode Source parameter: errorCode[attribute] Type: string Description: Catch any exceptions while powering on a VM.
Developing with VMware vCenter Orchestrator Table 1‑11. Bindings of the Timeout 2 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[inparameter] Type: VC:VirtualMachine Description: The virtual machine to power on.
Chapter 1 Developing Workflows 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.
Developing with VMware vCenter Orchestrator Table 1‑14. Bindings of the Send Email Scriptable Task Element Parameter Name Binding Type Bind to Existing or Create Parameter? vm IN Bind Binding Values n Local Parameter: vm n Source parameter: vm[inparameter] Type: VC:VirtualMachine Description: The virtual machine to power on.
Chapter 1 Developing Workflows //Apply the method that sends the email message myEmailMessage.sendMessage(); System.log("Sent email to '"+toAddress+"'"); Define the Simple Workflow Example Exception Bindings You define exception bindings in the Schema tab in the workflow editor. Exception bindings define how elements process errors. The following elements in the workflow return exceptions: startVM, vim3WaitTaskEnd, Send Email, and vim3WaitToolsStarted. Prerequisites Complete the following tasks.
Developing with VMware vCenter Orchestrator Set the Read-Write Properties for Attributes of the Simple Workflow Example You can define whether parameters and attributes are read-only constants or writeable variables. You can also set limitations on the values that users can provide for input parameters. Setting certain parameters to read-only allows other developers to adapt the workflow or to modify it without breaking the workflow's core function. Prerequisites Complete the following tasks.
Chapter 1 Developing Workflows n “Define the Parameters of the Simple Workflow Example,” on page 85. n “Define the Simple Workflow Example Decision Bindings,” on page 86. n “Bind the Action Elements of the Simple Workflow Example,” on page 87. n “Bind the Simple Workflow Example Scripted Task Elements,” on page 90. n “Define the Simple Workflow Example Exception Bindings,” on page 97. n Open the workflow for editing in the workflow editor.
Developing with VMware vCenter Orchestrator You have made both parameters mandatory, defined how the user can select the virtual machine to start, and limited the characters that can be input for the recipient's email address. What to do next You must create the layout, or presentation, of the input parameters dialog box in which users specify a workflow's input parameter values when they run it.
Chapter 1 Developing Workflows 6 Drag the (VC:VirtualMachine)vm parameter under the Virtual Machine display group. In the input parameters dialog box, a text box in which the user types the virtual machine name will appear under a Virtual Machine heading. 7 Repeat the preceding steps to create a display group for the toAddress parameter, setting the following properties: a Create a display group and name it Recipient's Email Address.
Developing with VMware vCenter Orchestrator 5 Right-click the Start VM and Send Email workflow and select Start workflow. The input parameters dialog box opens and prompts you for a virtual machine to start and an email address to send notifications to. 6 Select a virtual machine to start from the vCenter Server inventory. 7 Type an email address to which to send email notifications. 8 Click Submit to start the workflow. A workflow token appears under the Start VM and Send Email workflow.
Chapter 1 Developing Workflows 2 Create a Custom Action for the Complex Workflow Example on page 104 The Check VM scriptable element calls on an action that does not exist in the Orchestrator API. You must create the getVMDiskModes action. 3 Create the Schema of the Complex Workflow Example on page 105 You can create a workflow's schema in the workflow editor. The workflow schema contains the elements that the workflow runs, and determines the logical flow of the workflow.
Developing with VMware vCenter Orchestrator 5 On the General tab of the workflow editor, click the version number digits to increment the version number. For the initial creation of the workflow, set the version to 0.0.1. 6 Click the Server restart behavior value to set whether the workflow resumes after a server restart. 7 In the Description text box, type a description of what the workflow does. 8 Click Save at the bottom of the General tab.
Chapter 1 Developing Workflows 12 n Value: VC:VirtualMachine n Description: The virtual machine for which to return the Disk Modes Add the following scripting in the bottom of the Scripting tab. The following code returns an array of disk modes for the disks of the virtual machine. var devicesArray = vm.config.hardware.device; var retArray = new Array(); if (devicesArray!=null && devicesArray.length!=0) { for (i in devicesArray) { if (devicesArray[i] instanceof VcVirtualDisk) { retArray.
Developing with VMware vCenter Orchestrator 3 Element Type Element Name Position in Schema Workflow Create a snapshot Above the Create Snapshot? custom decision element, linked with a green arrow Scriptable task VM Snapshots Left of the Create a snapshot workflow, linked with a blue arrow Scriptable task Increment Left of the VM Snapshots scriptable task element, linked with a blue arrow Scriptable task Set Output Right of the Pool Has No VMs scriptable task element, linked with a blue arrow
Chapter 1 Developing Workflows Figure 1‑5. Linking of the Take a Snapshot of All Virtual Machines in a Resource Pool Example Workflow What to do next You can optionally define workflow zones by using workflow notes. (Optional) Create the Complex Workflow Example Zones Optionally, you can highlight different zones of the workflow by adding workflow notes. Creating different workflow zones helps to make complicated workflow schema easier to read and understand. Prerequisites Complete the following tasks.
Developing with VMware vCenter Orchestrator Elements in Zone Description VMs remaining? custom decision; getVMDisksModes action, Create Snapshot? decision; Create a snapshot workflow; VM Snapshots scriptable task; Increment scriptable task; Log Exception scriptable task Check whether any virtual machines remain in the resource pool, check that a virtual machine meets the snapshot criteria, take a snapshot, then loop until a snapshot has been taken of all the virtual machines.
Chapter 1 Developing Workflows Define the Parameters of the Complex Workflow Example You define workflow parameters in the workflow editor. The input parameters provide data for the workflow to process. The output parameters are the data the workflow returns when it completes its run. Prerequisites Complete the following tasks. n “Create the Complex Workflow Example,” on page 103. n “Create the Schema of the Complex Workflow Example,” on page 105.
Developing with VMware vCenter Orchestrator 3 Click Save at the bottom of the Schema tab. All the input and output parameters of the elements are bound to the appropriate parameter types and values. What to do next Set the attribute properties. Complex Workflow Example Bindings Bindings define how the simple workflow example's action elements process input and output parameters.
Chapter 1 Developing Workflows Table 1‑15.
Developing with VMware vCenter Orchestrator Table 1‑16. Bindings of the VMs to Process? Decision Element Parameter Name Binding Type Bind to Existing or Create Parameter? numberOfVMs Decision Bind Binding Values n n n n Source parameter: numberOfVMs[attribute] Decision statement: Greater than Value: 0.
Chapter 1 Developing Workflows Table 1‑18. Bindings of the Remaining VMs? Custom Decision Element Parameter Name Binding Type Bind to Existing or Create Parameter? numberOfVMs IN Bind Binding Values n n n n vmCounter IN Bind n n n n Source parameter: numberOfVMs[attribute] Decision statement: Greater than Value: 0.
Developing with VMware vCenter Orchestrator Create Snapshot? Custom Decision Element The Create Snapshot? custom decision element determines whether to take snapshots of virtual machines, depending on the disk modes of the virtual machines. The following table shows the bindings that the Create Snapshot? custom decision element requires. Table 1‑20.
Chapter 1 Developing Workflows Table 1‑21. Bindings of the Create a snapshot Workflow Element Parameter Name Binding Type Bind to Existing or Create Parameter? vm IN Bind Binding Values n n n n name IN Create n n n n description IN Create n n n n memory IN Create n n n n quiesce IN Create Local parameter: name Source parameter: snapshotName[attribute] Type: string Description: The name for this snapshot. The name does not need to be unique for this virtual machine.
Developing with VMware vCenter Orchestrator Table 1‑21. Bindings of the Create a snapshot Workflow Element (Continued) Parameter Name Binding Type Bind to Existing or Create Parameter? snapshot OUT Create Binding Values n n n n errorCode Exception Create Local parameter: snapshot Source parameter: NULL Type: VC:VirtualMachineSnapshot Description: The snapshot taken.
Chapter 1 Developing Workflows Increment Scriptable Task Element The Increment scriptable task element increments the counter that counts the number of virtual machines in the array. The following table shows the bindings that the Increment scriptable task element requires. Table 1‑23.
Developing with VMware vCenter Orchestrator Table 1‑24.
Chapter 1 Developing Workflows The Set Output scriptable task element performs the following scripted function. //Passes the value of the internal attribute to a workflow output parameter snapshotVmArrayOut = snapshotVmArray; Set the Complex Workflow Example Attribute Properties You set the attribute properties in the General tab in the workflow editor. Prerequisites Complete the following tasks. n “Create the Complex Workflow Example,” on page 103.
Developing with VMware vCenter Orchestrator Procedure 1 Click the Presentation tab in the workflow editor. The Take a Snapshot of All Virtual Machines in a Resource Pool workflow has only one input parameter, so creating the presentation is straightforward. 2 Right-click the Presentation node in the presentation hierarchical list and select Create display group. 3 Delete the New step element that appears above the New group element.
Chapter 1 Developing Workflows Procedure 1 Click Validation in the Schema tab of the workflow editor. The validation tool detects any errors in the definition of the workflow. 2 After you have eliminated any errors, click Save and Close at the bottom of the workflow editor. You return to the Orchestrator client. 3 Click the Workflows view. 4 In the workflow hierarchical list, select Workflow Examples > Take a Snapshot of All Virtual Machines in a Resource Pool.
Developing with VMware vCenter Orchestrator 122 VMware, Inc.
2 Scripting Orchestrator uses JavaScript to create building blocks from which you create actions, workflow elements, and policies that access the APIs of the technologies that you plug into Orchestrator. Orchestrator uses the Mozilla Rhino 1.7R4 JavaScript engine as its scripting engine. The scripting engine provides variable type checking, name space management, automatic completion, and exception handling.
Developing with VMware vCenter Orchestrator Limitations of the Mozilla Rhino Implementation in Orchestrator Orchestrator uses the Mozilla Rhino 1.7R4 JavaScript engine. However, the implementation of Rhino in Orchestrator presents some limitations. When writing scripts for workflows, you must consider the following limitations of the Mozilla Rhino implementation in Orchestrator. n When a workflow runs, the objects that pass from one workflow element to another are not JavaScript objects.
Chapter 2 Scripting 5 Writing Scripts on page 127 The Orchestrator scripting engine helps you to write scripts. Automatic insertion of functions and automatic completion of lines of scripting accelerates the scripting process and minimizes the potential for writing errors in scripts. 6 Add Parameters to Scripts on page 129 The Orchestrator scripting engine helps you to import available parameters into scripts.
Developing with VMware vCenter Orchestrator Access the Scripting Engine from the Action or Policy Editor The Orchestrator scripting engine uses the Mozilla Rhino JavaScript engine to help you write scripts for actions or policies. You access the scripting engine for actions and policies from the Scripting tabs in the action and policy editors. Procedure 1 Select an option from the drop-down menu in the Orchestrator client, depending on the type of the element whose scripting you want to edit.
Chapter 2 Scripting Procedure 1 Enter the name or part of a name of an object in the API Explorer Search text box and click Search. To limit your search to a particular object type, uncheck or check the Scripting Class, Attributes & Methods and Types & Enumerations check boxes. 2 Double-click the element in the proposed list. The object is highlighted in the hierarchical list on the left. A documentation pane under the hierarchical list presents information about the object.
Developing with VMware vCenter Orchestrator Procedure 1 Navigate through the hierarchical list of objects on the left of the Scripting tab, or use the API Explorer search function, to select a type, class, or method to add to the script. 2 Right-click the type, class, or method and select Copy. If the scripting engine does not allow you to copy the element you selected, this object is not possible in the context of the script.
Chapter 2 Scripting Table 2‑2. Color Coding of Scripting Keywords (Continued) Keyword Type Text Color in Scripting Tab Output text Green Workflow attributes Pink Workflow inputs Pink Workflow outputs Pink Add Parameters to Scripts The Orchestrator scripting engine helps you to import available parameters into scripts. If you have already defined parameters for the element you are editing, they appear as links in the Scripting tab toolbar.
Developing with VMware vCenter Orchestrator Access the Server File System Using the System.getTempDirectory Method As an alternative to writing to the folders on the Orchestrator server system in which the administrator has set the appropriate permissions, you can write to the default temporary I/O folder. Orchestrator has full read, write, and execute rights in the default temporary I/O folder by default. You obtain the default temporary I/O folder by using the System.
Chapter 2 Scripting ... } catch ( e if e instanceof URIError ) { } n All exceptions that scripts do not catch must be simple string objects of the form :SPACE, as the following example shows. throw "ValidationError: The input parameter 'myParam' of type 'string' is too short." n Write human readable messages as clearly as possible. n Simple string exception type checking must use the following pattern.
Developing with VMware vCenter Orchestrator n Workflow Scripting Examples on page 136 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.
Chapter 2 Scripting Setting and Obtaining Properties from a Hashtable The following JavaScript example sets properties in a hashtable and obtains the properties from the hashtable. In the following example, the key is always a String and the value is an object, a number, a Boolean, or a String. var table = new Properties() ; table.put("myKey",new Date()) ; // get the object back var myDate= table.get("myKey") ; System.
Developing with VMware vCenter Orchestrator Send an Email The following JavaScript example sends an email to the defined recipient, through an SMTP server, with the defined content. var message = new EmailMessage() ; message.smtpHost = "smtpHost" ; message.subject= "my subject" ; message.toAddress = "receiver@vmware.com" ; message.fromAddress = "sender@vmware.com" ; message.addMimePart("This is a simple message","text/html") ; message.
Chapter 2 Scripting } finally { myMailClient.closeFolder(); myMailClient.close(); } File System Scripting Examples 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. NOTE Access to the file system is limited by default. To access the file server from Orchestrator, see “Accessing the Orchestrator Server File System from JavaScript and Workflows,” on page 129.
Developing with VMware vCenter Orchestrator Logging Scripting Examples Workflow scripted elements, actions, and policies require scripting of common logging tasks. You can cut, paste, and adapt these examples into your scripted elements. Persistent Logging The following JavaScript example creates persistent log entries. Server.log("This is a persistant message", "enter a long description here"); Server.warn("This is a persistant warning", "enter a long description here"); Server.
Chapter 2 Scripting Access the Current Workflow Token You can access the current workflow token by using the workflow variable. It is an object of type WorkflowToken that provides access to the current workflow run. The following JavaScript example gets the ID of the workflow token and its start date. System.log("Current workflow run ID: " + workflow.id); System.log("Current workflow run start date: "+workflow.
Developing with VMware vCenter Orchestrator 138 VMware, Inc.
Developing Actions 3 Orchestrator provides libraries of predefined actions. Actions represent individual functions that you use as building blocks in workflows, Web views, and scripts. Actions are JavaScript functions. They take multiple input parameters and have a single return value. They can call on any object in the Orchestrator API, or on objects in any API that you import into Orchestrator by using a plug-in. When a workflow runs, an action takes its input parameters from the workflow's attributes.
Developing with VMware vCenter Orchestrator Procedure 1 From the drop-down menu in the Orchestrator client, select Design. 2 Click the Actions view. 3 Browse the libraries of actions by expanding the nodes of the actions hierarchical list. You can use the Actions view to view information about the actions in the libraries and create and edit actions.
Chapter 3 Developing Actions 4 Right-click the module and select Add action. 5 Type a name for the action in the text box and click OK. Your custom action is added to the library of actions. 6 Right-click the action and select Edit. 7 Click the Scripting tab. 8 To change the default return type, click the void link. 9 Add the action input parameters by clicking the arrow icon. 10 Write the action script. 11 Set the action permissions. 12 Click Save and close.
Developing with VMware vCenter Orchestrator Action Coding Guidelines To optimize the performance of workflows and to maximize the potential to reuse actions, you should follow some basic coding guidelines when creating actions. Basic Action Guidelines When you create an action, you must use basic guidelines. n Every action must include a description of its role and function. n Write short, elementary actions and combine them in a workflow.
Chapter 3 Developing Actions n Do not use an excessive number of parameters in a single action. Use Action Version History You can use version history to revert an action to a previously saved state. You can revert the action state to an earlier or a later action version. You can also compare the differences between the current state of the action and a saved version of the action. Orchestrator creates a new version history item for each action when you increase and save the action version.
Developing with VMware vCenter Orchestrator 144 VMware, Inc.
Creating Resource Elements 4 Workflows and Web views can require as attributes objects that you create independently of Orchestrator. To use external objects as attributes in workflows or Web views, you import them into the Orchestrator server as resource elements. Objects that workflows and Web views can use as resource elements include image files, scripts, XML templates, HTML files, and so on.
Developing with VMware vCenter Orchestrator What to do next Import and edit a resource element. Import an External Object to Use as a Resource Element Workflows and Web views can require as attributes objects that you create independently of Orchestrator. To use external objects as attributes in workflows or Web views, you import them to the Orchestrator server as resource elements. Prerequisites Verify that you have an image file, script, XML template, HTML file, or other type of object to import.
Chapter 4 Creating Resource Elements 9 Check the appropriate check boxes to set the level of permissions for this user group and click OK. Permissions are not cumulative. To allow a user to view the resource element, use it in their workflows or Web views, and change the permissions, you must check all check boxes. 10 Click Save and close to exit the editor. You edited the general information about the resource element and set the user access rights.
Developing with VMware vCenter Orchestrator You updated a resource element that the Orchestrator server contains. Add a Resource Element to a Workflow Resource elements are external objects that you can import to the Orchestrator server for workflows to use as attributes when they run. For example, a workflow can use an imported XML file that defines a map to convert one type of data to another, or a script that defines a function, when it runs.
Chapter 4 Creating Resource Elements Add a Resource Element to a Web View Resource elements are external objects that you can import into the Orchestrator server for Web views to use as Web view attributes. Web view attributes identify objects with which Web view components interact. Prerequisites Verify that you have the following objects in your Orchestrator server: n An image, script, XML, or HTML file, or any other type of object imported into Orchestrator as a resource element.
Developing with VMware vCenter Orchestrator 150 VMware, Inc.
Creating Packages 5 Packages are used for transporting content from one Orchestrator server to another. Packages can contain workflows, actions, policies, Web views, configurations, or resources. When you add an element to a package, Orchestrator checks for dependencies and adds any dependent elements to the package. For example, if you add a workflow that uses actions or other workflows, Orchestrator adds those actions and workflows to the package.
Developing with VMware vCenter Orchestrator Create a Package You can export workflows, policies, actions, plug-in references, resources, Web views, and configuration elements in packages. All elements that an element in a package implements are added to the package automatically, to ensure compatibility between versions. If you do not want to add the referenced elements, you can delete them in the package editor.
Chapter 5 Creating Packages Set User Permissions on a Package You set different levels of permission on a package to limit the access that different users or user groups can have to the contents of that package. You can select the different users and user groups for which to set permissions from the users and user groups in the Orchestrator LDAP or vCenter Single Sign-On server. Orchestrator defines levels of permissions that you can apply to users or groups.
Developing with VMware vCenter Orchestrator 154 VMware, Inc.
Index A Action element 23 action elements, binding 87 Action view 139 actions adding 140 attributes 142 basic guidelines 142 binding 88 coding guidelines 142 creating 104, 140 finding elements that implement 141 naming 142 parameters 142 restoring deleted 143 reusing 139 version history 143 Actions 139 Actions view 140 API Explorer, accessing 126 attributes definition 17, 85 read-write properties 98, 119 audience 7 B binding action elements 87 decision elements 86 scriptable tasks 90 bindings action 88 de
Developing with VMware vCenter Orchestrator L R linking decision elements 35 schema elements 30 long-running workflows date object 63 Date object 63 timer-based 64 trigger 66 Trigger object 63 trigger-based 67 relative date object 49, 63 remote workflow calling 59 prerequisites 59 resource elements adding to workflows 148 adding to Web views 149 editing 146 importing 146 save to file 147 updating 147 viewing 145 resume a failed workflow run 77 resuming a failed workflow run enabling 77 set behavior 76 t
Index color coding of keywords 128 email examples 133 examples 131 exception handling 130 file system examples 135 JavaScript object types 127 LDAP examples 135 logging examples 136 Mozilla Rhino JavaScript engine 124 networking examples 136 scripted elements 123 workflow examples 136 scripting engine 124 search, modifying results 22 search results 20 simple workflow example notes 84 zones 84 Start Workflow element 23 Start workflows in a series workflow 62 Start workflows in parallel workflow 62 system pr
Developing with VMware vCenter Orchestrator propagate input parameters 57 propagate presentation 57 propagating changes 56 restoring deleted 79 resume a failed workflow run 77 resuming a failed workflow run 76 running 73, 74 running in workflow editor 74 running on a selection of objects 61 scheduled 55, 59 standard library 14 starting 55 synchronous 55, 57 testing 13 validation 71 version history 78 workflows, reserved OGNL keywords 18 X XML scripting, E4X 132 158 VMware, Inc.