/AWS1/IF_LOC=>BATCHEVALUATEGEOFENCES()¶
About BatchEvaluateGeofences¶
Evaluates device positions against the geofence geometries from a given geofence collection.
This operation always returns an empty response because geofences are asynchronously evaluated. The evaluation determines if the device has entered or exited a geofenced area, and then publishes one of the following events to Amazon EventBridge:
-
ENTERif Amazon Location determines that the tracked device has entered a geofenced area. -
EXITif Amazon Location determines that the tracked device has exited a geofenced area.
The last geofence that a device was observed within is tracked for 30 days after the most recent device position update.
Geofence evaluation uses the given device position. It does not account for the optional Accuracy of a DevicePositionUpdate.
The DeviceID is used as a string to represent the device. You do not need to have a Tracker associated with the DeviceID.
Method Signature¶
METHODS /AWS1/IF_LOC~BATCHEVALUATEGEOFENCES
IMPORTING
!IV_COLLECTIONNAME TYPE /AWS1/LOCRESOURCENAME OPTIONAL
!IT_DEVICEPOSITIONUPDATES TYPE /AWS1/CL_LOCDEVPOSITIONUPDATE=>TT_DEVICEPOSITIONUPDATELIST OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_locbtcevaluategeofe01
RAISING
/AWS1/CX_LOCACCESSDENIEDEX
/AWS1/CX_LOCINTERNALSERVEREX
/AWS1/CX_LOCRESOURCENOTFOUNDEX
/AWS1/CX_LOCTHROTTLINGEX
/AWS1/CX_LOCVALIDATIONEX
/AWS1/CX_LOCCLIENTEXC
/AWS1/CX_LOCSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_collectionname TYPE /AWS1/LOCRESOURCENAME /AWS1/LOCRESOURCENAME¶
The geofence collection used in evaluating the position of devices against its geofences.
it_devicepositionupdates TYPE /AWS1/CL_LOCDEVPOSITIONUPDATE=>TT_DEVICEPOSITIONUPDATELIST TT_DEVICEPOSITIONUPDATELIST¶
Contains device details for each device to be evaluated against the given geofence collection.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_locbtcevaluategeofe01 /AWS1/CL_LOCBTCEVALUATEGEOFE01¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->batchevaluategeofences(
it_devicepositionupdates = VALUE /aws1/cl_locdevpositionupdate=>tt_devicepositionupdatelist(
(
new /aws1/cl_locdevpositionupdate(
io_accuracy = new /aws1/cl_locpositionalaccuracy( '0.1' )
it_position = VALUE /aws1/cl_locposition_w=>tt_position(
( new /aws1/cl_locposition_w( |0.1| ) )
)
it_positionproperties = VALUE /aws1/cl_locpositionprpmap_w=>tt_positionpropertymap(
(
VALUE /aws1/cl_locpositionprpmap_w=>ts_positionpropertymap_maprow(
key = |string|
value = new /aws1/cl_locpositionprpmap_w( |string| )
)
)
)
iv_deviceid = |string|
iv_sampletime = '20150101000000.0000000'
)
)
)
iv_collectionname = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
LOOP AT lo_result->get_errors( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_id = lo_row_1->get_deviceid( ).
lv_timestamp = lo_row_1->get_sampletime( ).
lo_batchitemerror = lo_row_1->get_error( ).
IF lo_batchitemerror IS NOT INITIAL.
lv_batchitemerrorcode = lo_batchitemerror->get_code( ).
lv_string = lo_batchitemerror->get_message( ).
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.