Book Image

VMware vRealize Orchestrator Cookbook

By : Daniel Langenhan
Book Image

VMware vRealize Orchestrator Cookbook

By: Daniel Langenhan

Overview of this book

Table of Contents (15 chapters)
VMware vRealize Orchestrator Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Error handling in workflows


This recipe is dedicated to show how to handle errors in workflows. We will learn how to catch errors and redirect them.

Getting ready

We just need a working Orchestrator, and you will need the rights to create new workflows and run them. We will work with the Orchestrator Client.

How to do it...

  1. Create a new workflow. We will reuse this workflow in the Resuming failed workflows recipe in this chapter.

  2. Add the following variables:

    Name

    Type

    Section

    Use

    number

    Number

    IN

    Used to create an intentional error

  3. Assemble the workflow (as seen in the following screenshot) by dragging a scriptable task into the workflow and then a Throw exception element from the generic section onto the scriptable task. Add the two log elements to the workflow by just dropping them onto the lines.

  4. Bind the in-parameter to the scriptable task and add the following script that will throw an error when the value 5 is entered:

    if (Number==5) {
        throw "Intentional Error";
    }
  5. In the scriptable...