Verificando se uma área contém um local
Detecte se uma área contém ou não contém um local.
Use os operadores a seguir para verificar se algumas geometrias contêm ou estão contidas em outras geometrias:
- <a geometry> contains <a geometry>
- the <geometries> contained in <a geometry>
- the <geometries> containing <a geometry>
Nos exemplos a seguir, a área de estacionamento é definida como um polígono no modelo de negócios.
A regra a seguir envia um alerta se o carro for estacionado fora de seu estacionamento designado.
when a car returned event occurs
definições
set 'assigned parking area' to the parking area of the parking lot of this car returned event;
se
it is not true that 'assigned parking area' contains the location of this car returned event
então
print "The car is parked outside the assigned parking lot.";
A regra a seguir avisa o funcionário de que muitos carros estão estacionados em um estacionamento.
when a car returned event occurs
definições
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;
se
the number of elements in 'cars in parking lot' is more than the available places of the parking lot
então
print "Too many cars are parked in " + the name of the parking lot of this car returned event;