What is a Gateway Action?
The
Insert excerpt |
---|
| _action_gateway |
---|
| _action_gateway |
---|
nopanel | true |
---|
|
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 |
---|
nopanel | true |
---|
|
(Single Path)
Toggle on
Insert excerpt |
---|
| _toggle_on |
---|
| _toggle_on |
---|
nopanel | true |
---|
|
to push a record through the
first connection point where the condition is met.
Insert excerpt |
---|
| _gateway_inclusive |
---|
| _gateway_inclusive |
---|
nopanel | true |
---|
|
(Multiple Paths)
Toggle off
Insert excerpt |
---|
| _toggle_off |
---|
| _toggle_off |
---|
nopanel | true |
---|
|
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).
The order number assigned to each rule determines the order the rules are evaluated in. In PhixFlow version 11.1.0+, the gateway output connectors display this number with the output connector name, e.g. out : 1.
Image Added
Creating Gateway Actions
- Click and drag the
Insert excerpt |
---|
| _action_gateway |
---|
| _action_gateway |
---|
nopanel | true |
---|
|
icon in the toolbar onto the canvas - Enter a name for the Gateway action, then select Create Action
- In the Gateway action Properties on the right:
Toggle on
Insert excerpt |
---|
| _toggle_on |
---|
| _toggle_on |
---|
nopanel | true |
---|
|
or toggle off Insert excerpt |
---|
| _toggle_off |
---|
| _toggle_off |
---|
nopanel | true |
---|
|
ExclusiveDefine Rules for each output connection point clicking the
Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
icon Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
all settings
- Hover over the
Insert excerpt |
---|
| _action_gateway |
---|
| _action_gateway |
---|
nopanel | true |
---|
|
action on the canvas to see the output connection points- Click on each connection point to connect it to another action node
- Once connected, the rules can be changed directly on the connector by right-clicking and choosing
Insert excerpt |
---|
| _edit_expression |
---|
| _edit_expression |
---|
nopanel | true |
---|
|
Example Setup
This is an example of a simple gateway Actionflow that receives an order status. Where the order the order status is CompleteOpen, the data an email is saved sent but where the order status is OpenComplete, an email the data is sentsaved.
Image RemovedImage Added
HTML Comment |
---|
|
Insert excerpt |
---|
| Gateway Node |
---|
| Gateway Node |
---|
nopanel | true |
---|
|
|
Worked Example
Here's a worked example using the Shop the Retail Data (available from the Learning Centre).
In this example, we are using:
- A 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 |
---|
nopanel | true |
---|
|
action that disables a save action where a record is blank but allows the save where the record is populated.
Setup In-Grid Editing
On the Shop Stock screen, open the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
configuration for the Available Stock grid- On the
Insert excerpt |
---|
| _property_tabs |
---|
| _property_tabs |
---|
nopanel | true |
---|
|
, in the View Attributes section, double-click the attribute, itemType - In the Grid Settings section, untick Read Only
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
the View Attribute settings
- On the
Insert excerpt |
---|
| _action_view |
---|
| _action_view |
---|
nopanel | true |
---|
|
configuration, click on the Insert excerpt |
---|
| _property_tabs |
---|
| _property_tabs |
---|
name | action |
---|
nopanel | true |
---|
|
, and in the Action Settings section, toggle on Insert excerpt |
---|
| _toggle_on |
---|
| _toggle_on |
---|
nopanel | true |
---|
|
Auto Save - all changes
Auto Save Actionflow
- In the Action Settings section, under Auto Save Action Method, choose
Insert excerpt |
---|
| _actionflow |
---|
| _actionflow |
---|
nopanel | true |
---|
|
- For the Auto Save Actionflow, click the
Insert excerpt |
---|
| _addIcon |
---|
| _addIcon |
---|
nopanel | true |
---|
|
icon to create a new Actionflow - Name:
NullCheck
- On the Actionflow, select Click to Connect and choose the Shop Stock data source
- The
Insert excerpt |
---|
| _action_connector_mappings |
---|
| _action_connector_mappings |
---|
nopanel | true |
---|
|
window will open:- For What data is being used? select Edited Records
- Map in the itemType and itemID attributes into the Actionflow
- The itemType attribute is needed for the Gateway Rules
- The itemID attribute is needed to save records back to the Shop Stock data
Gateway Setup
- Drag a
Insert excerpt |
---|
| _action_gateway |
---|
| _action_gateway |
---|
nopanel | true |
---|
|
action onto the canvas and give it a suitable name - Drag the
Insert excerpt |
---|
| _input |
---|
| _input |
---|
name | icon |
---|
nopanel | true |
---|
|
input connection point node onto the Insert excerpt |
---|
| _action_gateway |
---|
| _action_gateway |
---|
nopanel | true |
---|
|
action - Click on the connector between the the
Insert excerpt |
---|
| _input |
---|
| _input |
---|
name | icon |
---|
nopanel | true |
---|
|
input connection point and the Insert excerpt |
---|
| _action_gateway |
---|
| _action_gateway |
---|
nopanel | true |
---|
|
action- Map in the attribute, itemType, into the
Insert excerpt |
---|
| _action_gateway |
---|
| _action_gateway |
---|
nopanel | true |
---|
|
action
- Click on the
Insert excerpt |
---|
| _action_gateway |
---|
| _action_gateway |
---|
nopanel | true |
---|
|
action and toggle on Insert excerpt |
---|
| _toggle_on |
---|
| _toggle_on |
---|
nopanel | true |
---|
|
Exclusive - In the Rules section, double click on the top rule to open the Output Connection Point properties:
- Rename this,
Save
Enter the Expression:
Code Block |
---|
|
in.itemType != _NULL |
- This will map records where the Item Type is changed and is not blank
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
the Output Connection Point properties
- In the Rules section, add another rule:
- Name:
Stop
Enter the Expression:
Code Block |
---|
|
in.itemType == _NULL |
- This will map records where the Item Type is changed and is blank
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
the Output Connection Point properties
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
the Gateway properties Expand |
---|
|
|
Save Setup
- Add a
Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
action to the canvas that saves records to the Shop Stock Processed table- Toggle on
Insert excerpt |
---|
| _toggle_on |
---|
| _toggle_on |
---|
nopanel | true |
---|
|
Auto Save Attributes in the properties and
- Hover over the
Insert excerpt |
---|
| _action_gateway |
---|
| _action_gateway |
---|
nopanel | true |
---|
|
action and select the save output connection point, then connect this to the Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
action- Map across the itemID attribute from the
Insert excerpt |
---|
| _action_gateway |
---|
| _action_gateway |
---|
nopanel | true |
---|
|
action to the Insert excerpt |
---|
| _action_save |
---|
| _action_save |
---|
nopanel | true |
---|
|
action- Note that this attribute was not directly mapped into the
Insert excerpt |
---|
| _action_gateway |
---|
| _action_gateway |
---|
nopanel | true |
---|
|
action and has instead passed through it- For more information on setting up a Save action, see 1.09 Save Action Configuration
Expand |
---|
Image Removed |
Image Added |
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.
- Add a
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
action to the canvas - Create an Output Attribute, named
ErrorText
and containing the string:
Code Block |
---|
|
"Please provide an item type" |
For more information on setting up a Calculate action, see 1.11 Calculate Action Configuration
- Add an
Insert excerpt |
---|
| _action_screen |
---|
| _action_screen |
---|
nopanel | true |
---|
|
action to the canvas that opens the screen, Shop Error Popup - Hover over the
Insert excerpt |
---|
| _action_gateway |
---|
| _action_gateway |
---|
nopanel | true |
---|
|
action and select the stop output connection point, then connect this to the Insert excerpt |
---|
_action_calculate | _action_calculate | nopanel | true |
actionMap the itemType attribute from the Insert excerpt |
---|
_action_gateway | _action_gateway | nopanel | true |
action to the Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
action - Hover over the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
action and select the out output connection point, then connect this to the Insert excerpt |
---|
| _action_screen |
---|
| _action_screen |
---|
nopanel | true |
---|
|
action- Map the Output Attribute, ErrorText from the
Insert excerpt |
---|
| _action_calculate |
---|
| _action_calculate |
---|
nopanel | true |
---|
|
action to the dynamic text component, ErrorMessage on the screen, Shop Error PopupFor more information on setting up an Open Screen action, see 1.07 Open Screen Action Configuration
Expand |
---|
|
|
Testing
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
the Shop_Stock_Processed View configuration properties - Close the Actionflow and Shop Stock screen
- Reopen the Shop Stock screen and it
- 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:
- Edit the text in a cell, then click into another cell to see the first cell auto save
- Delete the text in a cell, then click into another cell to display the error popup
- Note, the cell will not save unless it contains a value