Jumping Position in a Flow with the GoTo StepLast 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.
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.
Our first step will be to generate a unique identifier to be part of each new user’s email address.
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.
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:
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.
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.
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.
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.
Also define a unique EntityName for our new user account.
For each account, EntityName will follow the pattern “user[Guid].”
To complete our mapping, we’ll change the mapping of memberOf to Null and give each account a constant password of “admin”
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.
Once Add New Account 1 is finished, our flow displays a form with the buttons Add New User and Cancel.
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.