Specifying Status Expressions
Keep in mind the following guidelines for specifying status expressions:
Valid operators: AND, OR, NOT, <, >, <=, >=, =, !=, (, )
Valid operands: numbers, tags, true, and false (the true and false operands are not case-sensitive)
Specify strings between single quotes (')
Specify tags and functions between double quotes (")
If an expression is blank, it evaluates to false.
For lines, the expressions can relate to the assets of the line. For example, a line could be in Planned Downtime if either of the two assets in the line are in Planned Downtime. Copy the Planned Downtime expressions for each appropriate asset, and paste them into the Planned Downtime expression for the line.
Functions
The following functions are available for use in the status expressions:
HAS_ALERTS—This function evaluates to true if there are active alerts on the equipment.
ARE_ALL_CHILDREN_RUNNING—This function evaluates to true if all children of this piece of equipment are in the Running state.
IS_SCHEDULED—This function evaluates to true if the current time is within a shift.
IS_DATA_OK—This function evaluates to true if good quality data is detected on all additional properties defined on the Additional Properties page for this piece of equipment, and on all properties and tags used in status expression evaluation or KPI calculations.
* 
For equipment which has properties that are bound to KEPServerEX tags, when the connection to KEPServerEX is lost, the IS_DATA_OK function continues to evaluate to true. For equipment status expressions to check for the KEPServerEX connection status, the isConnected property for the equipment must be included in the appropriate status expressions.
1. On the individual equipment Thing or Thing Template for an equipment type which has properties bound to KEPServerEX tags, override the GetTagPickerProperties service.
2. In the script editor, add the isConnected property to the myList value, and save the service. This allows you to select the isConnected property when editing status expressions from the Status page.
3. On each impacted equipment Thing, edit the appropriate status expressions to include the isConnected property for that piece of equipment. For example, you could edit the status expression for the Warning status on Pump1 as follows:
"isConnected" AND "IS_DATA_OK" AND ("HAS_ALERTS")
4. Click Save to save the updated status expression.
When using one of these functions in an expression, if the function applies to the current piece of equipment, you do not need to specify the equipment’s Thing name in the expression. Functions specified with a Thing name are valid, and can be used to include functions against other equipment within an expression.
For example, if a line named Line1 includes assets named Pump1 and Pump2, then to include a check for alerts on either asset in the expression for the Warning state on Line1, enter an expression such as the following:
"IS_DATA_OK" AND ("HAS_ALERTS" AND "HAS_ALERTS:Asset_Pump1" AND "HAS_ALERTS:Asset_Pump2")
For information on using functions in status expressions when subscription-based status configuration is enabled, see Understanding Subscription-Based Status Calculation.
Default Status Expressions for New Lines and Assets
When lines and assets are initially created, their default status expressions are as follows:
Not ConfiguredNOT"<equipment_thing_name>:isConfigured"
Planned DowntimeNOT "IS_SCHEDULED" OR ("IS_DATA_OK" AND (false))
Warning"IS_DATA_OK" AND ("HAS_ALERTS")
Running
Assets—"IS_DATA_OK" AND (false)
Lines—"IS_DATA_OK" AND ("ARE_ALL_CHILDREN_RUNNING")
Unplanned Downtime"IS_DATA_OK" AND (false)
Unavailabletrue
* 
When a new piece of equipment is created, the isConfigured property on the Thing is set to false. This results in the Not Configured status evaluating to true. Once at least one status expression on the piece of equipment has been edited and saved, or the statuses have been reordered, the isConfigured property is automatically set to true.
If you have custom equipment types, you can determine the default status expressions for new instances of those equipment types. For more information, see Customizing the Default Status Expressions for Custom Equipment Thing Templates.
Status Expressions for Equipment Created Before Release 8.4
Prior to the 8.4 release, some status evaluation logic occurred outside of the status expressions defined on equipment. Starting with the 8.4 release, all information used for status evaluation is present in the expressions. For equipment that was present in ThingWorx Apps before the system was upgraded to 8.4, the existing status expressions are updated to include the current evaluation logic, while retaining the previously defined expressions:
If the existing expression was blank, it is updated to be the current default expression for that state.
Any existing expressions for the Warning, Running, and Unplanned Downtime states are concatenated with the IS_DATA_OK function as follows:
"IS_DATA_OK" AND (<existing expression>)
The Planned Downtime state is moved to the first position after Not Configured. The previously existing expressions for the Warning, Running, and Unplanned Downtime states are combined into an OR list, and included with the previously existing expression for Planned Downtime into the updated expression as follows:
NOT "IS_SCHEDULED" OR ("IS_DATA_OK" AND NOT (<Warning expression> OR <Running expression> OR <Unplanned Downtime expression>) AND (<existing expression>)
Was this helpful?