Connecting Steps and Changing Flow Execution Paths

Last Updated: 07/21/2016 Introduced in Verision: 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.

 

Example

 

We begin in Designer Folder by clicking Create Flow to create new flow.

createFlow

We give our flow a name and click Create to proceed to the Flow Designer.

nameFlow

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.

pickOrCreateForm

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.

clickPickOrCreateForm

In the left side panel we name our new form and click Create to proceed to the Form Designer.

nameForm

Our form is designed as follow…

sendEmailFormDesign

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…

hoverOnOutcome

… And drag it anywhere on the workspace to call Flow Designer Wizard back.

dragAndReleaseOutcome

 

Next, select Send Email step from All Steps[Catalog] > Communication category and click Add to add it to the workspace.

addSendEmailStep

 

From Send Email step’s options select Show Mapping Editor.

showMappingForSendEmail

Map our Form’s outcomes to Send Email inputs as follow. When finished we click Ok to save and close mapping editor.

mappingForSendEmailComplete

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.

addSecondForm

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.

anotherTaskFormDesign

 

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.

 

addGoTo

 

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.

selectSendEmailFormFromGoTo

Click Done to close this Wizard’s pop-up window.

selectDoneToCloseGoTo

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.

dragThrowException

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.

throwExceptionConfig

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.

dragCatchException

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

addFormForException

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”.

exceptionFormDesign

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.

addGoToForException

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.

pickAnotherTaskStep

 

This completes our flow. We can click Debug Flow link from the top Flow Designer’s panel to test our flow.

Note that in Decisions version 3.5 and above, you will need to click Test Flow rather than Debug Flow.

3.5 Test Flow Shot

debugFlow

When debugger is running Send Email Form opens first time. We fill it up and click Send to send first Email.

emailFormFirst

 

Next, our Another Task Form opens and we click Send Another Email to test our first GoTo step.

clickAnotherTask

And our Send Email Form opens again as expected.

firstFormOpensAgain

This time when Another Task Form opens again we click Done to test our Catch Exception step.

clickDone

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.

exitFlow

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.

done

Additional Resources