Reader small image

You're reading from  VMware vRealize Orchestrator Cookbook. - Second Edition

Product typeBook
Published inNov 2016
PublisherPackt
ISBN-139781786462787
Edition2nd Edition
Right arrow
Author (1)
Daniel Langenhan
Daniel Langenhan
author image
Daniel Langenhan

Daniel Langenhan is a Virtualisation expert with formidable skills in Architecture, Design and Implementation for large multi-tier systems. His experience and knowledge of process management, enterprise-level storage, Linux and Windows operation systems has made him and his business a highly sought after international consultancy in the Asia-Pacific and European regions for multinational clientele in the areas of Finance, Communication, Education and Government. Daniel has been working with VMware products since 2002 and is directly associated with VMWare since 2008. His proven track record of successful integrations of Virtualisation into different business areas while minimizing cost and maximizing reliability and effectiveness of the solution for his clients. Currently, Daniel is operating in the Europe and Asia-Pacific region with his company vLeet GmbH and Melbourne Business Boosters Pty Ltd. Daniel's expertise and practical approach to VMWare has resulted in the publication of the following books: Instant VMware vCloud Starter, Packt Publishing VMware View Security Essentials, Packt Publishing VMware vCloud Director Cookbook, Packt Publishing VMware vRealize Orchestrator Cookbook, Packt Publishing VMware vRealize Orchestrator Essentials, Packt Publishing He has also lent his expertise to many other publishing projects as a Technical Editor.
Read more about Daniel Langenhan

Right arrow

JavaScript special statements


This recipe introduces three usages that are rather advantageous and important, try, catch, and finally functions.

Getting ready

We need a new workflow and a scriptable task inside it to try these out.

The example workflow, 06.02 JavaScript special statements, contain all the following examples.

How to do it...

There are two sections in this recipe.

The try, catch, and finally statement

When writing any code, you want to make sure that when the code produces an error, you are still able to execute some critical operations, such as closing an open connection:

  1. Create a scriptable task and enter the following code:

          try { 
            //Main code; 
             System.log("Start Main"); 
             if (error) { 
                   throw("Create Error"); 
             } 
             System.log("End Main"); 
          } 
          catch( ex ) { 
            // error handling  
            System.log("Error: "+ex); 
          } finally { 
            /...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
VMware vRealize Orchestrator Cookbook. - Second Edition
Published in: Nov 2016Publisher: PacktISBN-13: 9781786462787

Author (1)

author image
Daniel Langenhan

Daniel Langenhan is a Virtualisation expert with formidable skills in Architecture, Design and Implementation for large multi-tier systems. His experience and knowledge of process management, enterprise-level storage, Linux and Windows operation systems has made him and his business a highly sought after international consultancy in the Asia-Pacific and European regions for multinational clientele in the areas of Finance, Communication, Education and Government. Daniel has been working with VMware products since 2002 and is directly associated with VMWare since 2008. His proven track record of successful integrations of Virtualisation into different business areas while minimizing cost and maximizing reliability and effectiveness of the solution for his clients. Currently, Daniel is operating in the Europe and Asia-Pacific region with his company vLeet GmbH and Melbourne Business Boosters Pty Ltd. Daniel's expertise and practical approach to VMWare has resulted in the publication of the following books: Instant VMware vCloud Starter, Packt Publishing VMware View Security Essentials, Packt Publishing VMware vCloud Director Cookbook, Packt Publishing VMware vRealize Orchestrator Cookbook, Packt Publishing VMware vRealize Orchestrator Essentials, Packt Publishing He has also lent his expertise to many other publishing projects as a Technical Editor.
Read more about Daniel Langenhan