Versions Compared

Key

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

Insert excerpt
_Banners
_Banners
nameactionflow
nopaneltrue

mention here: Prioritise Throughput Over Ordering

What is an Analysis Action?

An 

Insert excerpt
_run_analysis_icon
_run_analysis_icon
nopaneltrue
 Analysis Action action runs analysis on tables. For more information about running tables, see Analysis Models for Batch Processing Data

Note

Analysis actions only allow transactional tables with a Period of Transactional to be included to ensure correct model operation.

Example

In a weather application, a user can search for the weather data for any location using a form field connected to an actionflow. Image Removed

The actionflow is set up as follows:

Image Removed

Each time the application user runs the action, the calculate node selects a number from a sequence to add the ForecastID identifier. When the subsequent analysis node runs, it saves the ForecastID to the tables that are being run.

The expressions in the tables can reference:

  • the ForecastID identifier. '_context.ForecastID'
  • The location provided by the user   '_context.Location'.

The location value is sent in an API call using HTTP collectors connected to a HTTP datasource, as shown in the following analysis model:

Image Removed

Using Context Parameters

Tables that are being run may rely on context parameters in their attribute expressions. Adding attributes with the same name as the context parameters to the analysis node will work in the same way.

Creating Analysis Actions

  1. Click and drag the 
    Insert excerpt
    _run_analysis_icon
    _run_analysis_icon
    nopaneltrue
     Analysis action icon from the toolbar onto the canvas
  2. Enter a name for the Analysis action, then select Create Action
  3. In the Analysis action 
    Insert excerpt
    _property_settings
    _property_settings
    nopaneltrue
     on the right, populate the following details, as required

Tables

Add tables to this list to run analysis on when the Actionflow is triggered. Analysis is ran simultaneously on all tables in this list.

  • To add a table, in the Tables section click the 
    Insert excerpt
    _tables
    _tables
    nameicon
    nopaneltrue
     icon to open a list of tables for the application in the Repository
  • Drag a table from the list into the Tables section

Input Parameters & _Context 

Attributes mapped into Analysis actions can be used in the attribute expressions on the table using the internal variable _context, e.g._context.AttributeName.

To do this, add attributes to the Input Parameters section of the Analysis action properties using the same name as in the Expression for the attribute on the table. 

Image Added

Image Added

For example, if a table relies on the expression '_context.Name', an attribute called 'Name' can be added to the analysis nodeAnalysis action. The value for this can then be mapped to this attribute from any preceding connection.

Example Uses

If your table contains a Last Updated attribute, you can use Input Parameters and the _context variable to map an Output Attribute containing the expression now or today from a Calculate action onto the Input Parameters on the Analysis action, and then into the table using the _context variable.

Advanced

When an Analysis action is used in an Actionflow, the records are processed in parallel. While we can control the order records exit an Analysis action, we cannot control the order they are processed.

Insert excerpt
_check_

property

box_

tabs

tick
_check_

property_tabsnamebasic-hnopanel

box_tick
nopaneltrue
 Prioritise Throughput Over Ordering to process records in parallel to optimise performance. This means the order records are processed is nondeterministic.

When disabled (default), records are processed in the order they are provided.

_parent
HTML Comment
hiddentrue

Insert excerpt

_parent

Analysis Node
Analysis Node
nopaneltrue

Basic Settings

FieldDescriptionNameEnter the name for the analysis node.Description

We recommend that you always enter a description to explain the purpose of this item.

Tables

This section has a toolbar with standard buttonsThe grid contains a list of tables. 

To add a table, in the section toolbar click  Insert excerpt_table_list_table_listnopaneltrue to open a repository tab filtered to show tables by application. Drag a table from the list into the grid.To remove a table, select one and in the section toolbar click  Insert excerpt_delete_deletenopaneltrue.

Advanced

FieldDescriptionPrioritise Throughput Over Ordering Insert excerptActionflow PropertiesActionflow PropertiesnamePrioritiseThroughputOverOrderingnopaneltrue Insert excerpt_property_tabs_property_tabsnameaccess-hnopaneltrue Insert excerpt_access_accessnopaneltrue Insert excerpt_audit_auditnopaneltrue HTML Comment
hiddentrue
Insert excerptAnalysis NodeAnalysis Nodenopaneltrue1.02 Actionflow Principles

Worked Example

Here is a worked example using 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 these example, we'll be working on the Shop Stock screen

Import Bulk Stock

In this example, we'll set up an Actionflow that runs analysis on a table importing a bulk stock delivery and we'll map values into this data. As an optional process, we'll combine this bulk stock delivery with our existing stock and display this on the Shop Stock screen. 

Image Added

Review Tables

  1. Open the Analysis Model, Actionflow Intermediate Data
  2. Click on the tables to review the data
    1. The Shop_Stock_Processed table contains the data on your Shop Stock screen and ERD
    2. The Shop_Stock_Additional_Processed table represents a new delivery of stock into your warehouse and requires combining into main stock data
      1. This is the table we will run analysis on as part of this example
      1. Note that this table has a Period of Transactional, which will allow us to run analysis on it via the Actionflow

Actionflow Setup

  1. On the Shop Stock screen, add an Actionflow to the Image Added icon
  2. Set the Input to 
    Insert excerpt
    _actionflow_on_click
    _actionflow_on_click
    nopaneltrue
  3. Add a
    Insert excerpt
    _action_calculate
    _action_calculate
    nopaneltrue
     action to the canvas and connect the 
    Insert excerpt
    _input
    _input
    nopaneltrue
     node to it
  4. On the Calculate action, add two Output Attributes:
    1. Name: distributionCentreID
      1. Type: Integer
      2. Expression: 1001
    2. Name: distributionCentre
      1. Type: String
      2. Expression: "North"
  5. Add a 
    Insert excerpt
    _action_analysis
    _action_analysis
    nopaneltrue
     action to the canvas
  6. On its Properties, in the Tables section, click the 
    Insert excerpt
    _tables
    _tables
    nameicon
    nopaneltrue
     icon
    1. Drag across the Shop_Stock_Additional_Processed table from the Repository to the Analysis action properties
  7. Connect the Calculate action to the Analysis action and map across both attributes
    1. Click on the Analysis action to view these two attributes in the Input Parameters

Table Attributes Setup

  1. On the Analysis Model, Actionflow Intermediate Data, click on the table, Shop_Stock_Additional_Processed
  2. Double-click on the attribute, distributionCentreID, and change the Expression to _context.distributionCentreID
    1. This is then referring to the attribute setup on the Calculate action
  3. Make the same change for the attribute, distributionCentre, so it too is referring to the attribute set on the Calculate action
  4. Save the Analysis Model

Image Added

At this point, you can run the Actionflow and see the results of the Actionflow in the Shop_Stock_Additional_Processed table, which will now contain 50 records, along with the values for Distribution Centre ID and Distribution Centre as set in the Calculate action.

Optionally, follow the additional steps below to combine the new stock data with our existing stock data and display it on the Shop Stock screen.

Combine Data & Display (Optional)

  1. On the Actionflow, create a 
    Insert excerpt
    _action_view
    _action_view
    nopaneltrue
     action with the Primary Table, Shop_Stock_Additional_Processed, and connect the Analysis action to the View action
    1. In its Properties, in the Data Retrieval Options section, set the Data Range to Latest
      1. This will ensure that this data isn't continuously added if the Actionflow is run repeatedly
    2. For the Output Attributes section, click the 
      Insert excerpt
      _attributes_icon
      _attributes_icon
      nopaneltrue
       icon and drag across all attributes
  2. Create a 
    Insert excerpt
    _action_save
    _action_save
    nopaneltrue
     action to save the data to the Shop_Stock_Processed table
    1. In its Properties, in the Basic Settings section, set the Type to Insert and
      Insert excerpt
      _toggle_on
      _toggle_on
      nopaneltrue
       toggle on Auto Save Attributes
  3. Connect the View to the Save action and map across all attributes
    1. Image Added

  4. Expand
    titleCheckpoint

    Image Added


  5. On the Shop Stock screen, run the Actionflow by pressing Image Added Import New Stock
  6. The additional 50 records will be added to the Available Stock grid


Tip

If you go wrong at any point and alter your data in an unexpected way, you can roll back your training data to its original state - see Rolling Back Test Data.


Image Added