The 'location' is the current location of the asset for which the rule was generated. If the message that causes the rule to run is a MobileLocation trigger, you can use the unqualified symbol name location to obtain the current posted location value as the MobileLocation object. For all other triggers you need to use the fully-qualified name including the namespace Location, for example, Location.location.
Note: When used with an Event trigger, the "location" refers to the last reported location of the asset. This may not be the "current" location.
Use this namespace with asset-related triggers and NOT with system-related triggers. See Using Appropriate Actions and Namespaces with Triggers for Expression Rules.
The Location namespace does not take any local variables. It does take the following symbols:
location -- the current
location of the asset. This symbol contains the latitude and longitude
coordinates for the location (returns a String). For example:
Then/Else:
Audit("data-management",
"Current location is" + str(Location.location))
converts the latitude/longitude pair to a String for purposes
of writing the data to an Audit message.
age -- the elapsed time, in seconds, since the last reported location (returns a Long).
time -- the time that the last location was reported, presented using the local time of the Axeda® Platform, not of the asset. Note that this symbol returns the number of seconds since 1970 as the time, enabling you to subtract the current time at the Platform (Now function) from the time the location was reported to determine the age of the location (returns a Long).
Notice that the namespace always starts with a capital letter while the symbol always starts with a lowercase letter.
The location is always resolved as a data item first before it is tried as a real location. This sequence allows you to have a location data item. To reference the actual location, you must use the namespace: Location.location. For best practices, use the namespace and symbol for the data item as well (DataItem.location.value).