Connecting Steps and Changing Flow Execution PathsLast Updated: 05/02/2018 Introduced in Version: 2.0
This article describes how Flow Designer Wizard helps to simplify Flow Design process. Next, this article briefly describes using GoTo step to jump between flow steps and Catch Exception step to catch exception and provide user with error information instead of crashing the flow if exception occurs.
We begin in Designer Folder by clicking Create Flow to create new flow.
We give our flow a name and click Create to proceed to the Flow Designer.
Flow Designer opens with Flow Designer Wizard on the workspace. We expand Flows, Rules, Forms and Reports > Forms[Interaction] category and select [Pick or Create Form] item. We click Add to place this step to the workspace.
In the resulting pop-up window Wizard allows us to set up this form. We click Pick or Create Form link at the top of this pop-up window.
In the left side panel we name our new form and click Create to proceed to the Form Designer.
Our form is designed as follow…
We save and close Form Designer to return to the Flow Designer. In the Flow Designer we hover on the outcome from our Form step.
Next, select Send Email step from All Steps[Catalog] > Communication category and click Add to add it to the workspace.
From Send Email step’s options select Show Mapping Editor.
Map our Form’s outcomes to Send Email inputs as follow. When finished we click Ok to save and close mapping editor.
Back in the Flow Designer we calling the Wizard back by dragging Send Email’s outcome somewhere on the workspace. Next, we add new Form by locating [Pick or Create Form] step and clicking Add button.
This form has only two buttons and designed to provide the user with a control over the flow. When Form’s design completed we save and close the Form Designer to return back to our Flow Designer.
We call our Flow Designer Wizard back again by dragging Send Another Email outcome from our Another Task Form. To add next step to our flow we are going to use Wizard’s Search Bar this time. Type “goto” into Wizard’s Search Bar and hit Enter on the keyboard. Select the GoTo step found by Wizard and click Add to add it to the workspace. Read more about using GoTo Step here: Jumping Position in a Flow with the GoTo Step.
Next, our Wizard allows us to configure GoTo step in the resulting pop-up window. GoToStepName dropdown list provides us with all Flow’s steps we can jump to when the flow reaches this GoTo step. We select Send Email Form here because we want our user to be able to send another Email.
Another Task Form has second outcome Done that is not currently connected. We are going to use this outcome to throw exception. We are going to use ToolBox this time to find the desirable step for this operation. Type “exception” in the Search Bar in TooBox and hit Enter on the keyboard. From the shown results drag and drop onto the workspace Throw Exception step.
We connect Another Task Form’s Done outcome to Throw Exception step. Next we configure Throw Exception step the following way… For its message Mapping Type – Constant and “Exit Flow” for the Value.
Mention that Throw Exception step does not have outcome. And our end step remains unconnected. We drag and drop Catch Exception step to the workspace from the search results in the ToolBox from the previous step of this tutorial. Read more about handling exceptions here: Catching All Unhandled Exceptions.
Next, we use Catch Exception’s outcome to call Flow Designer Wizard by dragging it like we did previously in this tutorial. In the Wizard we locate [Pick or Create Form] step. Click Add…
We create a new Form that is designed as following… It asks the user if he or she is sure to exit. And it is going to have two outcomes: “Yes” and “No”.
Next, we connect this Form Step’s “Yes” outcome to our flow’s end step. We use “No” outcome step to call the Wizard again. In the Wizard we are going to use Search Bar to search for GoTo step and click Add to add it to our workspace.
In the resulting pop-up window we configure our GoTo step to jump to Another Task Form. We use GoToStepName dropdown list for this. We click Done when our GoTo step is configured.
This completes our flow. We can click Debug Flow link from the top Flow Designer’s panel to test our flow.
When debugger is running Send Email Form opens first time. We fill it up and click Send to send first Email.
Next, our Another Task Form opens and we click Send Another Email to test our first GoTo step.
And our Send Email Form opens again as expected.
This time when Another Task Form opens again we click Done to test our Catch Exception step.
The exception was caught and we click Yes to complete the Flow. Mention that if we click No the flow jumps back to Another Task Form where we can click Send Another Email and jump back to the first form.
After we click “Yes” our flow runs to the end step and the debugger’s diagram opens… We can see that the flow ran with no errors even though we intentionally threw an exception.