Updating the location of a moving entity
You can update the location of an entity that has a moving geometry attribute to reflect its movements in time. When an event occurs, you can add a snapshot of this location to the entity's movement history, which is stored in the moving geometry attribute.
Use the following operators to update the current location of a moving entity:
move <attribute> of <entity> to <geometry value>
The current location of the geometry corresponds to the value of now.
Use the following operators to update the location of a moving geometry to a new location at a specific time:
move <attribute> of <entity> to <geometry value> at <date & time>
In the following example, if the rule executes, the location attribute of the car entity is updated to the new location of the car at the time of the telemetry report event.
Business model definitions:
a car is a business entity identified by a plate number with a model, a capacity (numeric), a color, a location (a moving geometry).
a telemetry report is a business event related to a car.
a telemetry report has a location (a point).
Rule:
when a new car telemetry report occurs
if
the location of 'the car' is not null
then
move the location of 'the car' to the location of this telemetry report
at the timestamp of this telemetry report;