Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
VMware vRealize Orchestrator Cookbook. - Second Edition

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

Product type Book
Published in Nov 2016
Publisher Packt
ISBN-13 9781786462787
Pages 556 pages
Edition 2nd Edition
Languages
Author (1):
Daniel Langenhan Daniel Langenhan
Profile icon Daniel Langenhan

Table of Contents (19) Chapters

VMware vRealize Orchestrator Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Installing and Configuring Orchestrator 2. Optimizing Orchestrator Configuration 3. Distributed Design 4. Programming Skills 5. Visual Programming 6. Advanced Programming 7. Interacting with Orchestrator 8. Better Workflows and Optimized Working 9. Essential Plugins 10. Built-in Plugins 11. Additional Plugins 12. Working with vSphere 13. Working with vRealize Automation

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 chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}