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

From Senfi Docs
Jump to: navigation, search
Line 1: Line 1:
 
<h1 class="main-heading">Event Inputs</h1>
 
<h1 class="main-heading">Event Inputs</h1>
  
Event inputs are used to pass "variables"/"messages" from a triggered [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Expression|expression]] to the [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Event|event]], and on to the event's [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Event/Action|action]]/[[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Alarm|alarm]].
+
Event inputs are used to pass information from a triggered [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Expression|expression]] to the [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Event|event]], and on to the event's [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Event/Action|action]]/[[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Alarm|alarm]].
  
The following can be embedded:  
+
This section explains how the embed formula is used to embed an event's input values into its description and action's content. There are two ways of doing so:
* [[#Embed Event Name|Embed event name]]
+
# [[#Embed using the UI|Embed using the UI]]
* [[#Embed User-Defined Input|Embed User-Defined Input]]
+
# [[#Embed Formula|Embed Formula]]
* [[#Embed Event Description|Embed event description]]
 
  
===Embed Event Name===
+
See [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Expression#Event_Node|Embed Node Information]] to learn how to pass information from a triggered expression to the event inputs.
You can embed the name of an event in the message of an [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Event/Action|event action]]/[[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Event/Description|event description]].
 
  
To embed:
+
===Embed using the UI===
* Event's name, use <tt>${name}</tt>.
+
# Select the user-defined input which will be shown in the [[File:User_defined_input.png|160px|link=]] '''Click to embed input''' field (under the message of an event's action/event's description box).
  
===Embed User-Defined Input===
+
===Embed Formula===
You can embed the user-defined inputs in the message of an [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Event/Action|event action]]/[[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Event/Description|event description]].
+
* Input formula must begin with "${" and end with "}".
 +
* Content enclosed within the brackets consist of 1 to 2 words, separated by ".".
 +
** '''General:''' ${<input_name>.<2nd word>} 
 +
** 2nd word is used to [[#Format Values|format]] the embedded value
  
To embed:
+
===Format Values===
# Key the user-defined input into the '''Inputs''' field under the '''GENERAL INFORMATION''' tab of the event.
+
The CMS supports two types of formatting:
# Select the user-defined input which will be shown in the [[File:User_defined_input.png|160px|link=]] '''Click to embed input''' field (under the message of an event action/event description box).
+
* [[#Round|Round values]]
 +
* [[#Format Date|Format date]]
  
===Embed Event Description===
+
====Round====
You can embed the description of an event in the message of an [[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Event/Action|event action]]/[[V2/CMS_Tutorial/User_Tools/Creating_Content/Automation/Event/Description|event description]].
+
<div class="important">Note:Value of <input_name> must be a '''number'''.</div>
  
To embed:
+
* '''Round values to nearest integer:''' ${<input_name>.round()}
* Event's description, use <tt>${description}</tt>.
+
* E.g. ${asset_id.round()}
 +
 
 +
====Format Date====
 +
<div class="important">Note:Value of <input_name> must be a '''datetime'''.</div>
 +
 
 +
Dates are parsed using Moment in UTC mode. Refer to [https://momentjs.com/docs/#/parsing/ docs] here.
 +
 
 +
* Format using '''organization's default date-time & UTC offset''': ${<input_name>.to_date_str()}
 +
** E.g. {date_of_incident.to_date_str()}
 +
* Format using a '''specified <preset> format & organization's default UTC offset''': ${<input_name>.to_date_str(<preset>)}
 +
* Format using a '''specified <preset> format & <utc_offset>''': ${<input_name>.to_date_str(<preset> <utc_offset>)}
 +
* Format using a '''specified <format> & <utc_offset>''': ${<input_name>.to_date_str(<format> <utc_offset>)}

Revision as of 21:58, 22 June 2021

Event Inputs

Event inputs are used to pass information from a triggered expression to the event, and on to the event's action/alarm.

This section explains how the embed formula is used to embed an event's input values into its description and action's content. There are two ways of doing so:

  1. Embed using the UI
  2. Embed Formula

See Embed Node Information to learn how to pass information from a triggered expression to the event inputs.

Embed using the UI

  1. Select the user-defined input which will be shown in the User defined input.pngClick to embed input field (under the message of an event's action/event's description box).

Embed Formula

  • Input formula must begin with "${" and end with "}".
  • Content enclosed within the brackets consist of 1 to 2 words, separated by ".".
    • General: ${<input_name>.<2nd word>}
    • 2nd word is used to format the embedded value

Format Values

The CMS supports two types of formatting:

Round

Note:Value of <input_name> must be a number.
  • Round values to nearest integer: ${<input_name>.round()}
  • E.g. ${asset_id.round()}

Format Date

Note:Value of <input_name> must be a datetime.

Dates are parsed using Moment in UTC mode. Refer to docs here.

  • Format using organization's default date-time & UTC offset: ${<input_name>.to_date_str()}
    • E.g. {date_of_incident.to_date_str()}
  • Format using a specified <preset> format & organization's default UTC offset: ${<input_name>.to_date_str(<preset>)}
  • Format using a specified <preset> format & <utc_offset>: ${<input_name>.to_date_str(<preset> <utc_offset>)}
  • Format using a specified <format> & <utc_offset>: ${<input_name>.to_date_str(<format> <utc_offset>)}