From the View and manage expression rules page, you can edit an expression rule from within the table.
Note: Not all settings for the rule can be changed in this inline editor. For example, you cannot edit the trigger event from this page. To edit the entire rule, click the name of the rule (not the () icon and make changes in the displayed Configure the expression rule page.
1. Navigate to this page (on the View menu of the Axeda Configuration application, select Expression Rules).
2. Click the () icon next to the name of an expression rule. When you click this icon, details of the selected rule are displayed in the table.
3. As long as you have the privileges needed to edit rules, you can edit the rule from the table. The details for the rule that you can change here include the following items:
§ Rule -- the name assigned to the rule when it was created. You can change the name of the rule in this field. You can use up to 50 alphanumeric and special characters for a name.
§ Description -- text concerning the purpose of the rule and describing what action it will take. You can use up to 2000 characters (no limitations on the types of characters).
Notes:
For DefinedConfiguration rules: you cannot specify Then
or Else expressions; therefore, you cannot specify
any actions to run for these rules. For DefinedConfiguration rules, the
Platform evaluates only the If expression in
order to determine if the defined configurations match or do not match.
(The Platform stores the outcome of the match for use in later deployment
criteria.)
For ConfigurationValidation rules for SDK/API requests (or UI provided
via Asset Configuration SDK/API): you cannot specify Then
or Else expressions. If the rule can be evaluated
for both agent supplied configurations and for SDK/API (or UI) requests
then you can specify Then or Else expressions (but know that the Platform
will only evaluate these Then and Else
expressions for Agent supplied configurations). Also, Validation messages
are available for ConfigurationValidation rules defined for SDK/API (or
UI) requests.
Also note that DefinedConfiguration
and ConfigurationValidation rules are only available with an Axeda ConnectedConfiguration
license. If the Axeda Platform is not licensed for ConnectedConfiguration, you will not
have access to these rules.
§ If expression
-- the condition to evaluate when the trigger message occurs. This expression
contains variables and functions; the expression MUST evaluate to a Boolean
result (true/false). For assistance with expression rule syntax, refer
to the list of topics that follow this list. Examples of variables include
Alarm name or Alarm severity. Examples of functions include sum() or avg().
Examples of conditions:
TTLRE1>3
TTLRE3>=10.09
A more complex example condition:
round(avg(TTLRE51,TTLRE52,TTLRE53))==2
&& floor(TTLRE51)==-3
§ Then expression -- the action to take when the IF expression evaluates to true. Examples of actions include creating an alarm, setting a data item, sending a request for a data item to an asset, or restarting an asset.
§ Else expression -- the action(s) to take (if any) when the IF expression evaluates to false.
§ Validation Message
-- (ConfigurationValidation
rules only): when a ConfigurationValidation
rule set to evaluate based on SDK/API (or UI) validation requests is false,
the rule returns any defined Validation Message.
You can type the message you want displayed back to the user when this
If expression does not evaluate to true. Use
variables supported by the current context to provide real data and object
information. You can use any supported expression variables and any cfg*()
functions to create the data for your message. Make sure to enclose your
message
Example:
Assume your If expression determines if the model and
serial for the asset defined in the configuration path matches a specified
model and serial number.
If expression: CfgStrValue("/DeviceSync/ManagedDevice/@deviceModel")
== "c6000" && CfgStrValue("/DeviceSync/ManagedDevice/@serialNumber")
== "1010-2"
The
end user will want to know when the model and serial number are not as
expected (that is, when the If expression evaluates to false). To relay
this information to the end user, you can configure a validation message
similar to the following:
Validation message: contactableDevice '"
+ Device.serial + "|" + Device.model + "' had the wrong
serial number in the configuration. Model=" + CfgStrValue("/DeviceSync/ManagedDevice/@deviceModel")
+ " and Serial=" + CfgStrValue("/DeviceSync/ManagedDevice/@serialNumber")"
When the expression evaluates to true, the Platform will replace variables
and functions in the validation message with actual data for the asset
in context and display a message similar to the following to the user:
Device CG2000 | CG200-model had the wrong serial
number in configuration. Model= CG200-model and Serial= CG2000 (for example).
§ General information about the syntax - Syntax rules for Expression Rules
§ Functions - Functions reference for expression rules
§ Operators - Supported Operators for Expression Rules
§ Actions - Actions Reference for Expression Rules
The following information is available here, but you cannot edit it:
§ Created By and Creation Time -- the Axeda Applications login name of the person who created the rule and the date and time that the rule was initially saved.
§ Modified By and Modified
Time -- the Axeda Applications login name of the person who last
edited the rule and the date and time that the changes were last saved.
4. When you make changes to the rule here, click Validate to check that the changes keep the rule valid. If the rule is valid, the If, Then, and Else fields turn green. If an error is detected, the field containing the error turns red and a message appears, explaining the error.
5. Once you have corrected an error, click Validate again.
6. When ready, click Save to save your changes. To discard your changes, continue to the next step to hide the expression rule without saving.
7. To hide the details for a rule, click the icon. If you saved your changes, any changes to the Name or Description appear in the appropriate columns. If you discarded your changes, they disappear and the columns display the Name and Description as they were before the editing.