Überprüfen, ob eine Fläche eine Position enthält
Ermitteln Sie, ob eine Fläche eine Position enthält oder nicht.
Verwenden Sie die folgenden Operatoren, um zu überprüfen, ob einige Geometrien
in anderen Geometrien enthalten sind bzw. andere Geometrien enthalten:
- <a geometry> contains <a geometry>
- the <geometries> contained in <a geometry>
- the <geometries> containing <a geometry>
In den folgenden Beispielen wird die Parkfläche als Polygon im Geschäftsmodell definiert.
Die folgende Regel sendet einen Alert, wenn das Fahrzeug außerhalb des ihm zugewiesenen Parkplatzes geparkt wird.
when a car returned event occurs
definitions
set 'assigned parking area' to the parking area of the parking lot of this car returned event;
if
it is not true that 'assigned parking area' contains the location of this car returned event
then
print "The car is parked outside the assigned parking lot.";
Die folgende Regel warnt den Mitarbeiter, dass zu viele Fahrzeuge auf einem Parkplatz geparkt wurden.
when a car returned event occurs
definitions
set 'parking lot area' to the parking area of the parking lot of this car returned event;
set 'cars in parking lot' to all cars in the cars of 'the organization'
where 'parking lot area' contains the location of each car;
if
the number of elements in 'cars in parking lot' is more than the available places of the parking lot
then
print "Too many cars are parked in " + the name of the parking lot of this car returned event;