Difference between revisions of "V2/CMS Tutorial/User Tools/Creating Content/Automation/Expression"

From Senfi Docs
Jump to: navigation, search
Line 32: Line 32:
  
 
See [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Expression/Node|Node Type]] for more information about each Node Type.
 
See [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Expression/Node|Node Type]] for more information about each Node Type.
 +
 +
====Steps====
 +
<div class="important">Note: Apart from the "Result" node, all other nodes must be [[#Configure Nodes|configured]].</div>
 +
 +
# Create "Metric" nodes, one for each Input metric.
 +
# Attach an "Asset" node (input) to each "Metric".
 +
# Transform data using "[[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Expression/Node#Data Transformation|Data Transformation]]" nodes (if necessary).
 +
# Create "Compare" and/or "Logic" nodes. ([[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Expression/Node#Logic|more information]]) to construct the necessary logic.
 +
#* Logic graph should output a single Boolean (True/False) value.
 +
#* "Compare" and "Logic" nodes can be nested.
 +
#* More than 2 inputs can be attached to each "Logic" node.
 +
# Attach output of Logic graph to the "Result" node.
 +
# Create "Event" nodes, one for each desired Event.
 +
# Attach the "Result" node (input) to each "Event" node.
 +
[[File:Triggering_event.png|thumb|600px|center|event_3 is triggered when result changes from False to True <br> event_4 is triggered when result changes from True to False|link=]]
 +
 +
====Configure Nodes====
 +
Each node contains attributes & options which you can modify. To modify the attributes of a node, simply '''select''' the node (in the working area). A window will popup to allow you to configure the node.
 +
 +
===== Aggregate node =====
 +
This section explains the output of each "Aggregate" node option.
 +
* '''Sum:''': Sum of all input values.
 +
* '''Count:''' Number of input values.
 +
* '''Average:''' Average of the input values.
 +
* '''Median:''' Median value of the input values.
 +
* '''Max:''' Largest input value.
 +
* '''Min:''' Smallest input value.
 +
* '''Mode:''' Input value that appears most often.
 +
* '''Range:''' Difference between the largest and smallest input value (max - min).
 +
* '''Stddev:''' [https://en.wikipedia.org/wiki/Standard_deviation standard deviation]
 +
* '''Percentile:''' [https://en.wikipedia.org/wiki/Percentile percentile].
 +
** This option accepts an additional "Percentile Value" parameter.
 +
* '''Every:''' Outputs true if every input value fulfils the condition.
 +
** This option accepts an additional "Condition" parameter.
 +
* '''Any:''' Outputs true if at least 1 input value fulfils the condition.
 +
** This option accepts an additional "Condition" parameter.
 +
 +
===== Function node =====
 +
This section explains the output of each "Function" node option.
 +
* '''Absolute value of:''' Absolute value of the input.
 +
* '''Round to nearest integer:''' Input rounded to the nearest integer.
 +
* '''Round up:''' Input rounded up.
 +
* '''Round down:''' Input rounded down.
 +
* '''Custom transformation (Map):''' Input transformed based on a custom mathematical expression.
 +
** This option accepts an additional "mathematical operator" and "value" parameter to form a custom mathematical expression.

Revision as of 18:31, 22 June 2021

Add Expression

Note: Mandatory fields are marked with an ‘*’. The following steps assume that the user is already logged in.

Steps

  1. Go to the Automation Icon.pngAutomation tab.
  2. Select the EXPRESSION tab and then Add.pngADD NEW.
  3. Fill in Name of the Expression.
  4. Set the Type of the Expression by choosing from the Expression type.pngType dropdown list.
    • Immediate (Default): Expression is checked when new values are received for any of the selected Input Measurement.
    • Polling: Expression is checked periodically regardless of whether there are new values for any of the selected Input Measurement.
  5. Choose to Enable.pngenable or Disable.png disable the expression.
  6. Construct Expression.
  7. Select SUBMIT (top right corner) to create the expression.

Construct Expression

This section will guide you on how to construct an expression using the EXPRESSION EDITOR when adding an expression in the CMS. The goal here is to tell Senfi how to detect an event that you want to be notified of/should be responded to.

The Expression Editor is a graph-based Drag & Drop editor.

Expression Editor

Arrows coming in from the left of a node indicate its input and those going out from its right indicate its output.

Input & Output of a Node

Each Node falls into one of the following categories:

  • Asset Identifier
  • Input
  • Data Transformation
  • Logic
  • Result
  • Event

Data originates from Metric nodes, is transformed by Data Transformation and/or Logic nodes, and eventually consumed by Result & Event nodes.

See Node Type for more information about each Node Type.

Steps

Note: Apart from the "Result" node, all other nodes must be configured.
  1. Create "Metric" nodes, one for each Input metric.
  2. Attach an "Asset" node (input) to each "Metric".
  3. Transform data using "Data Transformation" nodes (if necessary).
  4. Create "Compare" and/or "Logic" nodes. (more information) to construct the necessary logic.
    • Logic graph should output a single Boolean (True/False) value.
    • "Compare" and "Logic" nodes can be nested.
    • More than 2 inputs can be attached to each "Logic" node.
  5. Attach output of Logic graph to the "Result" node.
  6. Create "Event" nodes, one for each desired Event.
  7. Attach the "Result" node (input) to each "Event" node.
event_3 is triggered when result changes from False to True
event_4 is triggered when result changes from True to False

Configure Nodes

Each node contains attributes & options which you can modify. To modify the attributes of a node, simply select the node (in the working area). A window will popup to allow you to configure the node.

Aggregate node

This section explains the output of each "Aggregate" node option.

  • Sum:: Sum of all input values.
  • Count: Number of input values.
  • Average: Average of the input values.
  • Median: Median value of the input values.
  • Max: Largest input value.
  • Min: Smallest input value.
  • Mode: Input value that appears most often.
  • Range: Difference between the largest and smallest input value (max - min).
  • Stddev: standard deviation
  • Percentile: percentile.
    • This option accepts an additional "Percentile Value" parameter.
  • Every: Outputs true if every input value fulfils the condition.
    • This option accepts an additional "Condition" parameter.
  • Any: Outputs true if at least 1 input value fulfils the condition.
    • This option accepts an additional "Condition" parameter.
Function node

This section explains the output of each "Function" node option.

  • Absolute value of: Absolute value of the input.
  • Round to nearest integer: Input rounded to the nearest integer.
  • Round up: Input rounded up.
  • Round down: Input rounded down.
  • Custom transformation (Map): Input transformed based on a custom mathematical expression.
    • This option accepts an additional "mathematical operator" and "value" parameter to form a custom mathematical expression.