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.
This function will perform operations on a Configuration Item for a specified actual asset configuration (Path expression). The actual nature of the operation depends on the values passed to the function. The CfgItem function returns String.
This function will return the current value of a specified configuration item in the Path of the asset in the rule execution context:
String CfgItem(String "path", String "value")
where:
path -- The Path defined for this operation. Trailing or leading Asterisk (*) wildcards are allowed. Optional. If not defined, the Path of the related asset is used.
value- a literal string or an attribute; identifies that you want to return the current value for the related configuration item
The following example determines if the actual configuration for the asset in expression rule scope defines a value of "172.16.254.1" for the ipAddress configuration item. An audit message is created with the results of the comparison.
If: CfgItem("/DeviceSync/ManagedDevice/ModularInstrument/@ipAddress", "value") != "172.16.254.1"
Then: Audit("data-management", "ACME123 has the wrong IP address")
This function will return the previous value of a specified configuration item in the Path of the specified asset.
String CfgItem(String "path", String "value", String "modelNumber", String "serialNumber")
where:
path -- The Path defined for this comparison. Trailing or leading Asterisk (*) wildcards are allowed. Optional. If not defined, the Path in scope is used.
value- a literal string or an attribute; identifies that you want to return the previous value for this item
modelNumber -- The model of the asset configuration (Path) for this operation
serialNumber-- The serial number of the asset configuration (Path) for this operation
The following example determines if the previous actual configuration for the asset (defined by model and serial number) defined a value of "172.16.254.1" for the ipAddress configuration item. An audit message is created with the results of the comparison.
If: CfgItem("/DeviceSync/ManagedDevice/ModularInstrument/@ipAddress", "value", "modelXYZ", "serial123") == "172.16.254.1"
Then: Audit("data-management", "The previous IP address for ACME123 was 172.16.254.1")
Else: Audit("data-management", "The previous IP address for ACME123 was incorrect")
For asset in rule execution
This function will return the age (in seconds since 1970 Unix Epoc) of the value of the related configuration item for the actual configuration of the asset in the rule execution context. This is the date when the value was persisted, as opposed to any valued defined and not yet persisted (that is, in memory only).
String CfgItem(String "path", String "age")
where:
path -- The Path defined for this comparison. Trailing or leading Asterisk (*) wildcards are allowed. Optional. If not defined, the Path in scope is used.
age- a literal string or an attribute; identifies that you want to return the age of the current value for this configuration item
The following example determines if the value of the configuration item "make" was not changed on Tuesday, 15 Nov 2011 17:02:08 GMT. If true, then the server creates an audit message.
If: CfgItem("/DeviceSync/ManagedDevice/ModularInstrument/@make", "age") != "1321376528"
Then: Audit("data-management", "The make the asset was not correctly modified in the update performed on Tuesday, 15 Nov 2011 17:02:08 GMT.")
For a specified asset
This function will return the age of the value (in seconds since 1970 Unix Epoc) for a specified asset. This is the date when the value was persisted, as opposed to any valued defined and not yet persisted.
String CfgItem(String "path", String "age", String "modelNumber", String "serialNumber")
where:
path -- The Path defined for this comparison. Trailing or leading Asterisk (*) wildcards are allowed. Optional. If not defined, the Path in scope is used.
age- a literal string or an attribute; identifies that you want to return the age of the current value for this configuration item
modelNumber -- The model of the asset configuration (Path) for this operation
serialNumber-- The serial number of the asset configuration (Path) for this operation
The following example determines if the value of "make" for the ACME_Z asset (defined by model and serial number) was not changed on Tue, 15 Nov 2011 17:02:08 GMT. If true, then the server creates an audit message.
If: CfgItem("/DeviceSync/ManagedDevice/ModularInstrument/@make", "age", "modelXYZ", "serial123") != "1321376528"
Then: Audit("data-management", "The make of ACME123 was not correctly modified in the update performed on Tuesday, 15 Nov 2011 17:02:08 GMT.)
For asset in rule execution
This function will determine if the in-flight (non-persisted) updated value for the specified configuration item differs from the existing persisted value for the configuration item for the asset in the rule execution context.
String CfgItem(String "path", String "changed")
where:
path -- The Path defined for this comparison. Trailing or leading Asterisk (*) wildcards are allowed. Optional. If not defined, the Path in scope is used.
changed- a literal string or an attribute; identifies that you want to determine if the current, inflight value is different from the current, persisted value for the related configuration item.
The following example determines if the current, inflight value of the configuration item "make" for the asset in expression rule in scope is different from the persisted value for "make". If true, then the server creates an audit message.
If: CfgItem("/DeviceSync/ManagedDevice/ModularInstrument/@make", "changed")
Then: Audit("data-management", "The current value for make is different from the saved value for make")
For a specified asset
This function will determine if the in-flight (non-persisted) updated value for the defined configuration item differs from the persisted value for the item corresponding to the specified model and asset number.
String CfgItem(String "path", String "changed", String "modelNumber", String "serialNumber")
where:
path -- The Path defined for this comparison. Trailing or leading Asterisk (*) wildcards are allowed. Optional. If not defined, the Path in scope is used.
changed- a literal string or an attribute; identifies that you want to determine if the current, inflight value is different from the current, persisted value for the related configuration item.
modelNumber -- The model of the asset configuration (Path) for this operation
serialNumber-- The serial number of the asset configuration (Path) for this operation
The following example determines if the current, inflight value of configuration item "make" for the ACME_Z asset (defined by model and serial number) is different from the persisted value for "make". If true, then the server creates an audit message.
If: CfgItem("/DeviceSync/ManagedDevice/ModularInstrument/@make", "changed", "modelXYZ", "serial123")
Then: Audit("data-management", "The current make of ACME_Z is different from the saved value for make.")
For asset in rule execution
This function will return the timestamp of the specified configuration item, in seconds since 1970 Unix Epoc, for the asset in the rule execution context.
String CfgItem(String "path", String "time")
where:
path -- The Path defined for this comparison. Trailing or leading Asterisk (*) wildcards are allowed. Optional. If not defined, the Path in scope is used.
time - a literal string or an attribute; identifies that you want to get the time when the configuration item was last modified
The following example determines if the timestamp for the configuration item "type" for the asset in expression rule scope is less than 1321376528 (or Tuesday, 15 Nov 2011 17:02:08 GMT) If true, then the server creates an audit message.
If: CfgItem("/DeviceSync/ManagedDevice/ModularInstrument/Module/@type", "time") < "1321376528"
Then: Audit("data-management", "The modular type has not been changed since before Tuesday, 15 Nov 2011 17:02:08 GMT")
For a specified asset
This function will return the timestamp of the configuration item in seconds since 1970 Unix Epoc for the configuration item corresponding to the specified Path and asset (defined by model and serial number).
String CfgItem(String "path", String "time", String "modelNumber", String "serialNumber")
where:
path -- The Path defined for this comparison. Optional. If not defined, the Path in scope is used.
time - a literal string or an attribute; identifies that you want to get the time when the configuration item was last modified
modelNumber -- The model of the asset configuration (Path) for this operation
serialNumber-- The serial number of the asset configuration (Path) for this operation
This function will return the timestamp of the configuration item in seconds since 1970 Unix Epoc for the configuration item corresponding to the specified Path and asset (defined by model and serial number).
The following example determines if the value of the configuration item "type" for this asset (defined by model and serial number) was changed before "Tuesday, 15 Nov 2011 17:02:08 GMT". If true, then the server creates an audit message.
If: CfgItem("/DeviceSync/ManagedDevice/ModularInstrument/Module/@type", "time", "modelXYZ", "serial123") < "1321376528"
Then: Audit("data-management", "The modular type of the ACME_Z asset has not been changed since before Tuesday, 15 Nov 2011 17:02:08 GMT")
Notes on Rule Execution:
The Platform first compares the incoming configuration event with non-persisted configuration values. If the value is not found or if the path was specified for a different asset than the one in the current context of the event, then the Platform checks persisted (saved) values. The rule will NOT trigger if the Configuration event does not provide any paths that are used in the Expression rule.
If the rule does not evaluate, make sure the following are true: the Path exists as specified, you've used valid function argument types and the correct number of arguments, the asset you identified exists as specified (modelNumber/serialNumber). Also for CfgStrValue, CfgDoubleValue, CfgBooleanValue, CfgItem, CfgHas, CfgLongValue: the rule will not evaluate if multiple node/values are found for the specified path (with or without wildcard). Finally, if a rule defined with SetCfgValue action doesn't execute, make sure the SetCfgValue action path does not contain any trailing or leading wildcards ‘*’ .