Using the workflow debugging function

This recipe showcases how to use the debug feature to find and resolve errors in a workflow. The debug function was introduced in version 5.5.

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.

We need a new workflow, and to make things easier we reuse some old workflows, such as 00.00 BasicWorkflow and 05.03.01 Error Handling from the example package.

How to do it...

  1. Create a new workflow and add the 00.00 BasicWorkflow and 05.03.01 Error Handling workflows (as shown in the following screenshot).
  2. Bind all variables as required.
  3. Right-click on the first element of your workflow and select Toggle breakpoint. A blue ball appears on the left next to the element.
  4. You can debug a workflow either while still in edit mode or when you exit it. Choose one and click on Debug (the bug icon) to start the debug process.
  5. The debug process starts the workflow and will stop the execution on the first breakpoint. It will not execute the step the breakpoint is located on, but stops before it. Please note that you have access to all variables and logs during the debug process:

    How to do it...

  6. While debugging a workflow, you have choices such as Cancel, Answer, Resume (F8), Step into (F5), Step over (F6), and Step return (F7). You can use the icons or the function keys to perform the said processing. See the How it works... section for more details.
  7. Use Step into to work through the workflow.

How it works...

The debugging feature was introduced in vCO 5.5. Before this feature existed, debugging Orchestrator was quite a bit more complicated and mostly involved using logs to write checkpoints and display variable content. With the debugging feature, things are now fairly easy. The debugging feature ties in with the checkpoints that Orchestrator uses when it executes a workflow. Orchestrator writes all variable content to its database before it executes one step. These checkpoint variables are displayed in the debug process.

You can set multiple breakpoints in each script and advance to them directly using Resume (F8).

The following table shows all the actions you can take during debugging:

Action

Description

Cancel

This stops the workflow execution.

Answer

This answers an interaction that the workflow has issued.

Resume

This resumes the workflow until the next breakpoint.

Step into

This steps into an element and starts debugging inside the element. This can also be used to go to the next element.

Step over

This will step over an element. The debugging will not enter the element.

Step return

This steps out of an element. The debugging will continue with the main element.

There's more...

When you use complex variables such as arrays or objects (for example, a VM), the content can be rather vast and won't be displayed in the Values section. In this case, have a closer look at the Variables screen. You will notice a small i icon before the variable value. Clicking on it will show you the content of the variable in a separate window. However, this doesn't work for all variable types. Properties and complex variables such as PowerShell output will not show up.

There's more...

See also

The example workflow 04.05 Debugging Workflows.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset