Scripting for POIs to add extra functionality

This guide shows how you can write an inside POI rule that using a script rather than the POI expression. The advantage of using a script is that it is easy to extend the functionality.

Create Event Rule

Create an Event Rule with a Script Expression like the one below:

// Replace MyCategory with a POI category you have created in your test application.
var pois = poi.find(trackPoint.position.longitude, trackPoint.position.latitude, 500, 'MyCategory')

if(pois.length > 0)
  context.setVariable('POI_NAME', pois[0].name);
else
  context.setVariable('POI_NAME', '-');

// Return true if inside POI.
return pois.length != 0;

 

Notifiers

Use the function context.setVariable() to create variables you can use in the Notifiers. For example, a Report Argument if you want to create a column in the EV1000 report. Another possibility is using an "Argument" notifier if you want to create one column in the Event window in the Workspace.

In the example above, the named POI will be in the variable [POI_NAME].