Ordering Workers by Travel Time
A Worker Lookup can sort out the workers it returns so it contacts the one who can reach the equipment soonest. By default, it measures straight-line distance between the worker and the alarm, which needs nothing beyond the two positions. To sort by driving distance or driving time along a real route, and optionally to take current traffic into account, the lookup calls Azure Maps.
Before you begin, make sure workers are reporting their positions. A worker's location comes from the MobileHMI app on their device, so each worker needs a Security Name and worker access granted in the app. Workers with no reported position are still returned, but are placed last, after the farthest known worker. Learn more
To order workers by travel time:
-
Create an Azure Maps account and obtain its key. Learn more
-
Log in to Windows as the account that the Connected Field Service services run as. The key is stored as a user environment variable, so it has to be set under the identity that reads it.
-
Open Windows Settings, search for Environment Variables, and select Edit environment variables for your account.
-
Add a new user variable named Ico_Cfs_AzureMapsKey, enter the Azure Maps key as its value, and then click OK twice.
-
Restart the GENESIS Connected Field Service Workers Point Manager service.
-
Open Workbench. In Project Explorer, expand your project > Alarms and Notifications > Connected Field Service > Templates and double-click your template to open the template designer.
-
Select the Worker Lookup activity, and then select Sort workers by location.
-
In Location data, enter the location of the alarm. Click (Edit Expression) to build it from the alarm fields—commonly the related values that carry the equipment coordinates, which is what the supplied expression does:
x=tostring({{triggerVariable:RELATED_VALUE_01}}) + ";" + tostring({{triggerVariable:RELATED_VALUE_02}})The distance comparison will expect the location to be received in latitude;longitude format, such as
42.029902;-71.249357 -
In Measure travel by, select how the ordering is calculated, and then select Apply traffic calculation if current traffic conditions should be included in the travel time:
-
Radius—Straight-line distance. Azure Maps is not used, and Apply traffic calculation is unavailable.
-
Distance—Driving distance along the best route.
-
Time—Driving time along the best route.
-
-
Click Apply, close the template designer, and trigger a matching alarm. The workers should be contacted nearest first.
What's Next?