Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Insert excerpt
_Banners
_Banners
nameactionflow
nopaneltrue

What is a Gateway Action?

The 

Insert excerpt
_action_gateway
_action_gateway
nopaneltrue
 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 point 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. 

Insert excerpt
_gateway_exclusive
_gateway_exclusive
nopaneltrue
 (Single Path)

Toggle on 

Insert excerpt
_toggle_on
_toggle_on
nopaneltrue
 to push a record through the first connection point where the condition is met. 

Insert excerpt
_gateway_inclusive
_gateway_inclusive
nopaneltrue
 (Multiple Paths)

Toggle off 

Insert excerpt
_toggle_off
_toggle_off
nopaneltrue
 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 
    Insert excerpt
    _action_gateway
    _action_gateway
    nopaneltrue
     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 

      Insert excerpt
      _toggle_on
      _toggle_on
      nopaneltrue
       or toggle off 
      Insert excerpt
      _toggle_off
      _toggle_off
      nopaneltrue
       Exclusive

    2. Define Rules for each output connection point clicking the 

      Insert excerpt
      _addIcon
      _addIcon
      nopaneltrue
       icon 

    3. Insert excerpt
      _finish
      _finish
      nopaneltrue
       all settings
  4. Hover over the 
    Insert excerpt
    _action_gateway
    _action_gateway
    nopaneltrue
     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 
      Insert excerpt
      _edit_expression
      _edit_expression
      nopaneltrue

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.

HTML Comment
hiddentrue

Insert excerpt
Gateway Node
Gateway Node
nopaneltrue

Worked Example

Here's a worked example using the Shop the Retail 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
Tip

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.

Disable Save For Blank Records

For this example, we'll create an Auto Save Actionflow that includes a 

Insert excerpt
_action_gateway
_action_gateway
nopaneltrue
 action that disables a save action where a record is blank but allows the save where the record is populated.

Setup In-Grid Editing

  1. On the Shop Stock screen, open the

    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
     configuration for the Available Stock grid

  2. On the
    Insert excerpt
    _property_tabs
    _property_tabs
    nopaneltrue
    , in the View Attributes section, double-click the attribute, itemType 
    1. In the Grid Settings section, untick Read Only
    2. Insert excerpt
      _finish
      _finish
      nopaneltrue
       
      the View Attribute settings
  3. On the
    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
     configuration, click on the
    Insert excerpt
    _property_tabs
    _property_tabs
    nameaction
    nopaneltrue
    , and in the Action Settings section, toggle on 
    Insert excerpt
    _toggle_on
    _toggle_on
    nopaneltrue
     Auto Save
  4. Insert excerpt
    _save
    _save
    nopaneltrue
     all changes

Auto Save Actionflow

  1. In the Action Settings section, under Auto Save Action Method, choose 
    Insert excerpt
    _actionflow
    _actionflow
    nopaneltrue
  2. For the Auto Save Actionflow, click the 
    Insert excerpt
    _addIcon
    _addIcon
    nopaneltrue
     icon to create a new Actionflow 
    1. Name: NullCheck
  3. On the Actionflow, select Click to Connect and choose the Shop Stock data source
  4. The
    Insert excerpt
    _action_connector_mappings
    _action_connector_mappings
    nopaneltrue
     window will open:
    1. For What data is being used? select Edited Records
  5. 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 
    Insert excerpt
    _action_gateway
    _action_gateway
    nopaneltrue
     action onto the canvas and give it a suitable name
  2. Drag the
    Insert excerpt
    _input
    _input
    nameicon
    nopaneltrue
     input connection point node onto the 
    Insert excerpt
    _action_gateway
    _action_gateway
    nopaneltrue
     action
  3. Click on the connector between the the
    Insert excerpt
    _input
    _input
    nameicon
    nopaneltrue
     input connection point 
    and the 
    Insert excerpt
    _action_gateway
    _action_gateway
    nopaneltrue
     action
    1. Map in the attribute, itemType, into the 
      Insert excerpt
      _action_gateway
      _action_gateway
      nopaneltrue
       action 
  4. Click on the 
    Insert excerpt
    _action_gateway
    _action_gateway
    nopaneltrue
     action and toggle on 
    Insert excerpt
    _toggle_on
    _toggle_on
    nopaneltrue
    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:

      Code Block
      themeEmacs
      in.itemType != _NULL


      1. This will map records where the Item Type is changed and is not blank
    3. Insert excerpt
      _finish
      _finish
      nopaneltrue
       the Output Connection Point properties


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

      Code Block
      themeEmacs
      in.itemType == _NULL


      1. This will map records where the Item Type is changed and is blank
    3. Insert excerpt
      _finish
      _finish
      nopaneltrue
       the Output Connection Point properties

  7. Insert excerpt
    _finish
    _finish
    nopaneltrue
     the Gateway properties

    Expand
    titleCheckpoint


Save Setup

  1. Add a
    Insert excerpt
    _action_save
    _action_save
    nopaneltrue
     action to the canvas that saves records to the Shop Stock Processed table
    1. Toggle on
      Insert excerpt
      _toggle_on
      _toggle_on
      nopaneltrue
       
      Auto Save Attributes in the properties and 
      Insert excerpt
      _save
      _save
      nopaneltrue
  2. Hover over the 
    Insert excerpt
    _action_gateway
    _action_gateway
    nopaneltrue
     action and select the save output connection point, then connect this to the 
    Insert excerpt
    _action_save
    _action_save
    nopaneltrue
    action
    1. Map across the itemID attribute from the 
      Insert excerpt
      _action_gateway
      _action_gateway
      nopaneltrue
       action to the 
      Insert excerpt
      _action_save
      _action_save
      nopaneltrue
      action
      1. Note that this attribute was not directly mapped into the 
        Insert excerpt
        _action_gateway
        _action_gateway
        nopaneltrue
         action and has instead passed through it
        1. For more information on setting up a Save action, see 1.09 Save Action Configuration 
Expand
titleCheckpoint

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
    Insert excerpt
    _action_calculate
    _action_calculate
    nopaneltrue
     action to the canvas 
  2. Create an Output Attribute, named ErrorText and containing the string:


    Code Block
    themeEmacs
    "Please provide an item type"


    1. For more information on setting up a Calculate action, see 1.11 Calculate Action Configuration 

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

        Expand
        titleCheckpoint


Testing

  1. Insert excerpt
    _finish
    _finish
    nopaneltrue
     the Shop_Stock_Processed View configuration properties
  2. Close the Actionflow and Shop Stock screen
  3. Reopen the Shop Stock screen and 
    Insert excerpt
    _lock
    _lock
    nopaneltrue
     it 
  4. 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