エリアが位置を含んでいるかどうかの確認
エリアが位置を含んでいるか、含んでいないかを検出します。
以下の演算子を使用して、いくつかのジオメトリーが他のジオメトリーを含んでいるか、または他のジオメトリーに含まれているかどうかをチェックします。
- <a geometry> contains <a geometry>
- the <geometries> contained in <a geometry>
- the <geometries> containing <a geometry>
以下の例で、駐車エリアは、ビジネス・モデル内でポリゴンとして定義されています。
以下のルールは、車がその車に割り当てられた駐車場の外に駐車されている場合、アラートを送信します。
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.";
以下のルールは、駐車場に駐車されている車の数が多すぎる場合、従業員に警告を出します。
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;