Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

What is a Gateway Action?

The  Gateway action acts as a decision point and controls the path that records take as they flow through an Actionflow. Data flow is controlled by the expressions on each output connection points and these provide the logic for which path the data flows. Several output connection points can be added, with decision logic on each one.

Exclusive vs Inclusive

Control whether or not a record is pushed through one or more outputs. 

 Exclusive Gateway (Single Path)

Toggle on  to push a record through the first connection point where the condition is met. 

 Inclusive Gateway (Multiple Paths)

Toggle off  to push a record through all connection points where the conditions are met. 

Rules

For each output connection point, rules (expressions) can be defined to be evaluated. If the condition is met, the record will go through the connection point or points (depending on if the gateway is exclusive or inclusive, see above).

Creating Gateway Actions

  1. Click and drag the  Gateway icon in the toolbar onto the canvas
  2. Enter a name for the Gateway action, then select Create Action
  3. In the Gateway action  Properties on the right:
    1. Toggle on  or toggle off  Exclusive

    2. Define Rules for each output connection point clicking the  icon 

    3.  Apply and Close all settings
  4. Hover over the  Gateway action on the canvas to see the output connection points
    1. Click on each connection point to connect it to another action node
    2. Once connected, the rules can be changed directly on the connector by right-clicking and choosing  Edit Expression

Example Setup

This is an example of a simple gateway Actionflow that receives an order status. Where the order status is Complete, the data is saved but where the order status is Open, an email is sent.

Worked Example

Here's a worked example using the Shop Data (available from the Learning Centre).

In this example, we are using:  

  • Shop Stock screen containing a grid of the Shop Stock data, a pie chart of the Shop Stock data and a grid of the Shop Departments data  - this screen was created using the Multi-Tile template

If you are completing this chapter as part of the Actionflow course and using a training instance, the data and screens have already been pre-loaded into the Actionflow Intermediate Application. For this example, we'll be working on the grid on the Shop Stock screen.

GIF/SCREENSHOT OF FINISHED RESULT

For this example, we'll create an Auto Save Actionflow that includes a  Gateway action. If you have not completed 2.02 In-Grid Editing Actionflows, expand the section below and follow the steps to complete the initial setup of the Auto Save action and remove Read Only on the Item Type attribute.

 Configuring a View to Read Only and Auto Save

In-Grid Editing for Department Data

Configure a grid to automatically save changes made directly to the grid.


  1. On the Shop Stock screen, open the   View configuration for the Departments grid

  2. On the  Properties tab, in the View Attributes section, double-click the attribute, departmentName 
    1. In the Grid Settings section, untick Read Only
    2.  Apply and Close the View Attribute settings
  3. On the   View configuration, click on the  Actions tab, and in the Action Settings section, toggle on  Auto Save
  4.  Apply all changes
  5. To test,  Lock the screen and double-click on an Name cell in the Departments grid, then make a change 
  6. Click outside of the cell to save the change

     Checkpoint

Auto Save Actionflow

  1. Open the view configuration and click on the  Actions tab
  2. In the Action Settings section, under Auto Save Action Method, choose  Actionflow
  3. For the Auto Save Actionflow, click the  icon to create a new Actionflow 
    1. Name: NullCheck
  4. On the Actionflow, select Click to Connect and choose the Shop Stock data source
  5. Click on the input connection point to open the  Connector Mappings window:
    1. For What data is being used? select Edited Records
  6. Map in the itemType and itemID attributes into the Actionflow
    1. The itemType attribute is needed for the Gateway Rules
    2. The itemID attribute is needed to save records back to the Shop Stock data 

Gateway Setup

  1. Drag a  Gateway action onto the canvas and give it a suitable name
  2. Drag the  input connection point node onto the  Gateway action
  3. Click on the connector between the the  input connection point and the  Gateway action
    1. Map in the attribute, itemType, into the  Gateway action 
  4. Click on the  Gateway action and toggle on  Exclusive
  5. In the Rules section, double click on the top rule to open the Output Connection Point properties:
    1. Rename this, Save
    2. Enter the Expression:

      in.itemType != _NULL
      1. This will map records where the Item Type is changed and is not blank
    3.  Apply and Close the Output Connection Point properties

  6. In the Rules section, add another rule:
    1. Name: Stop
    2. Enter the Expression:

      in.itemType == _NULL
      1. This will map records where the Item Type is changed and is blank
    3.  Apply and Close the Output Connection Point properties

Save Setup

  1. Add a  Save action to the canvas that saves records to the Shop Stock data
    1. Toggle on  Auto Save Attributes 
  2. Hover over the  Gateway action and select the save output connection point, then connect this to the  Save action
    1. Map across the itemID attribute from the  Gateway action to the  Save action
      1. Note that this attribute was not directly mapped into the  Gateway action and has instead passed through it
        1. For more information on setting up a Save action, see 1.09 Save Action Configuration 

Stop Setup

For the stop route in our Actionflow, we want the record to not be saved back to the table if it is blank and instead we want to show an error popup to the user.

  1. Add a  Calculate action to the canvas 
  2. Create an Output Attribute, named ErrorText and containing the string:
    "Please provide an item type"
    1. For more information on setting up a Calculate action, see 1.11 Calculate Action Configuration 

  3. Add an  Open Screen action to the canvas that opens the screen, Shop Stock Error Popup
  4. Hover over the  Gateway action and select the stop output connection point, then connect this to the  Calculate action
    1. Map the itemType attribute from the  Gatewayaction to the  Calculate action
  5. Hover over the  Calculate action and select the out output connection point, then connect this to the  Open Screen action
    1. Map the Output Attribute, ErrorText from the  Calculate action to the dynamic text component, ErrorMessage on the screen, Shop Stock Error Popup
      1. For more information on setting up an Open Screen action, see 1.07 Open Screen Action Configuration

Testing

  1. Close the Actionflow and Shop Stock screen
  2. Reopen the Shop Stock screen 
  3. Double-click on a cell in the Item Type column on the Available Stock grid and make the following changes to see your Actionflow in action:
    1. Edit the text in a cell, then click into another cell to see the first cell auto save
    2. Delete the text in a cell, then click into another cell to display the error popup
      1. Note, the cell will not save unless it contains a value

  • No labels