CfgNumItems() Function

Note: This function is an Axeda ConnectedConfiguration  feature. If the Axeda Platform is not licensed for ConnectedConfiguration, you will not have access to this function.

CfgNumItems() determines how many configuration items exist in the related asset configuration. This function can operate on the asset in scope or it can be specified to operate on another, specified asset. See ConnectedConfiguration functionality for more information.

Operating on the asset in scope

CfgNumItems() function determines how many entries exist for the specified Path based on the configuration items for the asset in context. Returns Integer.

Format:

Integer CfgNumItems(String "path")

where:

path -- The Path to search. Trailing or leading Asterisk (*) wildcards are allowed. Optional. If not defined, the Path of the asset in scope for the expression rule is used

Example:

The following example determines if less than 3 configuration items are defined in the specified Path for the asset in scope. If so, an Audit message is created.

If: CfgNumItems("/DeviceSync/ManagedDevices/ManagedDevice/ModularInstrument/Module/@type") <= 3

Then: Audit("data-management", "ACME123 Instrument is reporting the wrong number of items")

 

Operating on a specified asset

CfgNumItems() can also operate on a specified asset, rather than the asset in scope.

Format:

Integer CfgNumItems(String "path", String "modelNumber", String "serialNumber")

where:

path -- The Path to search. Trailing or leading Asterisk (*) wildcards are allowed. Optional. If not defined, the Path of the specified asset is used.

modelNumber -- The model of the asset for this comparison

serialNumber-- The serial number of the asset for this comparison

Example:

The following example determines if more than one"type" module is defined for the specified asset (as defined by model and serial number). If so, then the server creates an audit message.

If: CfgNumItems("/DeviceSync/ManagedDevices/ManagedDevice/ModularInstrument/Module/@type", "modelXYZ", "serial123") > 1

Then: Audit("data-management", "Instrument is reporting more than one "type" modules)

Notes on Rule Execution: