Web Components for Insights Hub and Industrial IoT
Rule Table
The Rule Table displays all created Rules for Asset Types in a table view.
A triggered Rule is marked in the overview table with the color of the configured severity.
Examples¶
Interface¶
Selector¶
<mdsp-rule-table></mdsp-rule-table>
Properties¶
Name | Type | Corresponding attribute | Default | Description | Allowed Values |
---|---|---|---|---|---|
assetId | string | asset-id | Configures the asset ID whose rules are displayed using its asset ID. | ||
assetTypeId | string | asset-type-id | Configures the asset type whose rules are displayed using its asset type ID. | ||
context | string | context | Configures the context of the component. See also here. | ||
errorNotification | boolean | error-notification | Enables error control if an error is thrown. This can be used for debug purposes. For productive use, the error event should be caught and handled in the application. See also here. | ||
locale | string | locale | Specifies the locale in which the component is displayed. The locales en and de are provided by default.See also here. | ||
localeManager | LocaleManager | Returns a LocaleManager object. This can be used to add locales or to get the locale settings. See also here. | |||
model | RuleDataModelProxy | Returns an object for data model handling, refer to RuleDataModelProxy model. | |||
multiSelectable | boolean | multi-selectable | false | Enables selection of multiple rules if true . | |
pagerMode | PagerMode | pager-mode | Simple | Configures the table's pagination mode. | - Simple - Advanced - Advanced2 - Hidden |
pageSize | number | page-size | 100 | Configures the initial page size. | 1 - (pageSizeLimit of this component) |
selectable | boolean | selectable | false | Enables rule selection if true . | |
stickyHeader | boolean | sticky-header | false | Specifies whether the table header is sticky if true . | |
tableFormatters | IDataTableFormatters | Used to define formatters for column header and values. Pass an object which fulfills the interface IDataTableFormatters. | |||
view | IViewModel | Returns an object for view handling, refer to IViewModel model. |
Events¶
Name | Type | Description |
---|---|---|
selectedRuleChanged | EventEmitter<IRule> | Triggered when the selection of a rule changes. |
selectedRulesChanged | EventEmitter<IRule[]> | Triggered when the selection of multiple rules changes. |
connected | EventEmitter<any> | Triggered after the component is created, initialized and appended to the DOM tree. |
error | EventEmitter<MdspUiError> | Triggered when an error occurs in the component or while accessing APIs. See also here. |
Models¶
IDataModel
interface IDataModel {
// forces reload of data, e.g. re-loading the rules
refresh(): void;
}
IViewModel
interface IViewModel {
refresh(): void;
}
Remarks¶
- The number of rules which can be activated simultaneously is limited and depends on the selected plan size.
To enhance the rule limit further "Rules Quota Upgrade" packages can be purchased in the Store. For latest information refer to the IoT Value Plan product sheets or contact customer support. - The rule engine triggers only in case of state changes. If values are still violated, the rules are not triggered again.
Example
A rule has been created to monitor a value greater 90.
Now the value changes from 89 to 91 - means a state change happens - and the rule will be triggered and perform the configured actions.
Next the value changes from 91 to 100 - here no state change happens, as the rule is already violated, it won't be triggered again.
Roles¶
mdsp:core:tsm.full-access
(for full access like create and delete)mdsp:core:tsm.read-only
(read only)
Snippets¶
Refresh the Rule Table¶
The data model of the Rule Table can be refreshed to get the latest list of rules, for example to update the view cyclically.
ruleTableComp.model.refresh();
Overwrite asset id in table headers with asset name¶
With the snippet below, you can format the table header and the columns, for example, to replace the asset type with a more descriptive text or to show text in different languages.
document.querySelector('mdsp-rule-table').tableFormatters = {
columnFormatters: {
"assetType": {
header: function(value){
return "Asset Type";
},
value: function(value){
return "DUMMY_REPLACE_ASSET_TYPE";
}
},
}
Display Rule Table in different contexts¶
If the rule table is used without the asset type attribute set, all rules in the tenant a user has access to will be shown.
The table can be filtered with a specific asset type:
ruleTableComp.assetTypeId = 'myCustomAssetType'
In this case only Rules configured for myCustomAssetType
will be displayed.
Except where otherwise noted, content on this site is licensed under the Development License Agreement.