Jumping Position in a Flow with the GoTo Step

Last Updated: 02/12/2016 Introduced in Verision: 2.0

The Go To Step component jumps the current position of a flow to a step elsewhere in the flow.

It can be found in the Flow Designer, in the Toolbox panel, under Flow Management.

Example

Our example flow will create a new user account, then display a very simple form – [Form] One More Task – with two buttons: Add New User and Cancel. Clicking Add New User will create a new user account. Clicking Cancel will complete the program’s flow. To ensure that each new user is not a duplicate and can be saved without errors, we will generate a unique email address for each one before it’s saved.

For this example, our form [Form] One More Task has already been created.

debugFormDisplayed

 

Our first step will be to generate a unique identifier to be part of each new user’s email address.

Select a Generate Guid component, which can be found in the Flow Designer’s start-up window, under the All Steps [Catalog] > Data category. Click Add to add it to the workspace.
 
 flowStarts
 
Our next step will be to create a new user account.

In the Toolbox panel, under Integration > Internal Services > Account Service, drag an Add New Account component to the workspace following the Generate Guid step.

Next, place a Go To Step component, which can be found in the Toolbox panel, under Flow Management, on the workspace.

Our last added step will display our form.

From the Forms [Interaction] > [Current Folder] category we drag a One More Task component to the workspace.

Now that we have all of our steps, structure the steps and connect as follows:

flowConnected

 

For Go To Step 1 to work, it has to know which step to go to. We could tell it to go to Add New Account 1, but it is necessary for new accounts to have a unique identifier generated by Generate Guid 1. With Go To Step 1 selected, go to the Properties panel, and, from the GoToStepName drop-down list, select Generate Guid 1.

setGoTo

 
 
Next, configure how new accounts are created by selecting Add New Account and clicking the Show Mapping Editor link to open it in the Mapping Editor.
 showMappingForAddAccount
 

We only need to map a few select fields for our new user accounts to be valid, but we do have one special requirement: that the email address include our unique identifier. To create a new account, change the mapping type of account from Ignore to Build Data. This will allow us to manually generate all of the properties that belong to a user account.

buildDataForAccount

 

The property we’re interested in is EmailAddress. When we change its mapping type from Ignore to Text Merge Plain, we make it possible to merge multiple values into one plain text value.

EmailAddressTextMergePlain

 

We define this single value in the Merge Text Editor by combining simple text with variables that can be dragged and dropped onto our editor’s canvas. In this case, the EmailAddress will follow the pattern “user[Guid]@mycompany.com,” where [Guid] is the unique identifier outputted in the previous step.

textEditorForEmail

 

Also define a unique EntityName for our new user account.

Select the Text Merge.Plain option for EntityName.

For each account, EntityName will follow the pattern “user[Guid].”

textEditorForName

 

To complete our mapping, we’ll change the mapping of memberOf to Null and give each account a constant password of “admin”

passwordConst

 

Our example flow is complete. When we run it in our debugger, the Events pane shows us that a user account is created using the unique identifier generated in the first step.

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

3.5 Test Flow Shot

debugForm

 

Once Add New Account 1 is finished, our flow displays a form with the buttons Add New User and Cancel.

debugFormDisplayed

 

Clicking Add New User directs our flow to Go To Step 1, which then directs our flow back to Generate Guid 1 and repeats the process of adding a new account all over again.

diagramGoToStep

 

 

Additional Resources