CalculateLocationsDistances
Changed on:
8 Aug 2025
Overview
The rule calculates distances, in meters, from each location to the order delivery address based on the incoming longitude/latitude. Sends event with attributes containing calculated distances.| Plugin Name | Order Reference Module |
|---|---|
| Namespace | [[account.id]].order |
UI Description
Calculates the distances from each location to the order delivery address. Sends event with attributes containing calculated distances.
Accepts
- ORDER
- FULFILMENT_OPTIONS
Actions
- This rule forwards the input event with name eventName containing attributes with calculated distances.
Rule parameters
| Parameter | Description |
| eventName | The event name triggered by this rule |
Event attributes
| Parameter | Description | Data Type | Required? |
| locations | The map of locations objects with longitude and latitude properties. | Map | Required |
| longitude | The longitude in the request compared to the longitude in the location property for calculate the distances of each location. | Double | Required |
| latitude | The latitude in the request compared to the latitude in the location property for calculate the distances of each location. | Double | Required |
Exceptions
Configuration example
1{
2 "name":"<ACCOUNTID>.order.CalculateLocationsDistances",
3 "props": {
4 "eventName":"UPDATE_ORDER"
5 }
6}