In the last few chapters, we learned how to build new workflows and improve them. What we haven't covered yet is how we can catch errors and deal with them. By using presentation properties, we have already learned how to reduce the amount of errors by introducing a method that can be used to limit the user's possibilities to enter wrong values. Now, we need to have a look at how we deal with "real" errors, such as what happens if the new VM can't be built because there isn't enough disk space on the datastore.
Logs help us keep track of what's happening in the workflow as well as the settings.
We will also have a look at the debug modus of Orchestrator and learn how we can use it to test our workflows.
The debug mode
Lets' start with the Orchestrator debug mode; you may have noticed that the schema has some interesting extra buttons next to the validation. There is a play button and one that looks like a bug. We will now focus our attention on this second icon.
The Orchestrator debug mode allows you to stop and resume a workflow execution, and inspect the parameters to see the values that they currently have. You can already imagine what a great help this is.
In the Orchestrator Client, open the InstallFreshVM workflow for editing.
Right-click on the first element in the workflow (it should be the translateOS2GuestOS) and select Toggle Breakpoint. A blue dot should now be seen to the left of the element.
Now, click on Debug, .
The normal workflow input window will open. Select the values and submit it.
As soon as you submit it, the workflow will start and pause on the first element. The element is now greenish in color.
To the right, an extra window opens and shows all the parameters in the Variables tab.
Please note that vmGuestOS is currently empty, as it shows Not set. This indicates that the workflow execution stopped before the action was executed.
Now, we want to continue the execution of the workflow step by step. Click on Step into, or press F5.
The workflow executes the action and stops on the scriptable task, but it does not execute it. Check the vmGuestOS parameter.
You can now go ahead and click on Step into or press F5 until the workflow has finished. Alternatively, you can just click on Resume, , to finish it.
The following control functions are used to debug:
Icon
Name
Key
Description
Cancel
This stops a workflow execution.
Answer
This answers a user interaction which the workflow issued.
Resume
This resumes the workflow until the next breakpoint.
Step into
F5
This steps into an element and starts debugging inside the child element. This can also be used to go to the next element.
Step over
F6
This will step over an element. The debugging will not enter the child element.
Step return
F7
This steps out of a child element. The debugging will continue with the parent element.