Validity Expression

Validity Expression is the resource property that determines which Iotellect contexts are compatible with the resource. When a server is started or the validity expression itself is updated, Iotellect Server evaluates this expression for every context in the system. When processing a context, it becomes the Default Context for the expression resolution environment. If the expression evaluates to True, the server considers the resource valid for the current context, and:

The Validity Expression is often used to check the type of context. This is very useful for creating models or dashboards that work with certain types of devices or system resources.

For example, to make a dashboard work with every SNMP device in the system, set the Validity Expression to {.:#type} == 'device.snmp'.

This expression will resolve to True when the type property for the context being checked (indicated by the "." relative context path) equals device.snmp.

Dynamic groups use Validity Expression for consolidating devices of a certain type.

For example, to make a group containing all printer devices in the system, set the Validity Expression to startsWith({.:#type}, 'device') && {.:genericProperties$type} == 'printer'.

This expression will resolve to True when the type property for the context being checked (indicated by the "." relative context path) starts with the device word and the type field of the genericProperties variable (that contains a user-selected type for a device) equals printer.

Validity Expression Resolution Environment:

Default Context

Context which is being verified for validity.

Default Data Table

None.

Default Row

0

Environment Variables

Standard variables only.

Validity Expression Recalculation

The Validity Expression is calculated in the following cases:

  • On server startup, to initially associate the resource with all existing valid contexts

  • When a new context is created, to associate the resource with it if it's valid

  • When a Validity Expression itself is modified, it's recalculated for all context in the system, because a new set of contexts could become valid while others may no longer be valid.

  • When an event specified in Validity Update Rules is fired.

Was this page helpful?