P&D Stop Lifecycle and Return Events

Stages of the Stop

Drivers spend the majority of their day in the Maven Driver app completing stops. The Maven Driver app records in detail all the events, times, and locations as a driver completes each stop. Maven then offers this data through integration events and user interfaces so that the entire fleet can be up-to-date about drivers' activities in real time.

This document lays out the stages of completing a stop, the data that is stored at each stop, and the integration events that trigger at each transition.

General Notes

Stops are not guaranteed to generate all events. If a stop is ended prematurely for any reason, and the driver does not go through the entire stop, no additional events will be triggered. If a driver completes a stop not within the geofence of the said, no geofenceStopDeparture will be sent.

Driving To Stop Phase

Before a driver ever begins their stop, they must first drive to the stop. This is recorded in the Driving To Stop phase.

During this phase, the Maven Driver app shows a map with the stop location and offers a button to Mark As Arrived.

An administrator looking at the Dispatch board sees “Driving to [Name of Stop]” as the manifest’s status.

Arriving At The Stop Transition

As the driver arrives at the stop, they will mark themselves as arrived. This indicates the beginning of the stop.

A stop can be arrived in one of two ways:

  • The driver manually presses the “Mark as Arrived” button.
  • The driver crosses the stop’s geofence and is automatically arrived.

Manually arriving and automatically arriving are functionally identical.

Once a stop has been arrived, a stopArrival Return Event will be added to the fleet’s integration event queue when a driver arrives at a stop.

This event (and all subsequent events) will have the following information about the stop arrival:

The time and place of the stop arrival will be recorded under the driverStartTime, driverStartLat, and driverStartLng:

  "driverStartTime":"15:59:39",  
  "driverStartLat":40.13978,  
  "driverStartLng":-79.7864037,

Recording When Driver Breaks Geofence

If the driver has crossed the stop’s geofence, Maven will also report the precise time the geofence was crossed. This data will usually align closely with the driverStartTimes, but in cases where two stops are near each other, or in cases where there is no geofence, this data will differ.

  // On a completed stop, these may be null.  
  "geofenceStartTime":"15:53:39",  
  "geofenceStartLat":40.13971,  
  "geofenceStartLng":-79.7864043,

There is no associated Return Event when breaking the stop's geofence. All subsequent return events will include geofenceStart information.

Waiting in Detention Phase

Once arrived, the detention timer screen will appear, and the timer will begin counting up.

Beginning Loading/Unloading Transition

When the driver manually presses Begin Loading/Unloading, Maven will trigger a stopBegin Return Event.

This event (and all subsequent events) will have the following information about the stopBegin:

The time of the stop begin will be recorded under the driverBeginExchange:

"driverBeginExchange":"15:58:19",  
"driverBeginExchangeLat":40.13971,  
"driverBeginExchangeLng":-79.786404,

Drivers now record the shipments they picked up or delivered.

Finishing Stop Transition

Once the driver has completed loading and unloading, they will mark the stop as complete.

Once the driver marks the stop as complete, Maven will add a stopComplete Return Event to the integration queue.

This event (and all subsequent events) will have the following information about the stopComplete:

The time of the stop complete will be recorded under the driverEndTime:

 "driverEndTime":"15:58:19",  
 "driverEndLat":40.13971,  
 "driverEndLng":-79.786404,

Departing Stop Transition

Finally, the driver departs the stop.

A stop can be departed in one of two ways:

  • The driver manually presses the “Begin Next Stop” button.
  • The driver crosses the stop’s geofence and/or goes above a speed threshold and is automatically departed.

Manually departing and automatically departing are functionally identical.

Once a stop has been departed, a stopDeparture Return Event will be added to the fleet’s integration event queue.

This event (and all subsequent events) will have the following information about the stop departure:

The time and place of the stop departure will be recorded under the driverDepartureTime, driverDepartureLat, and driverDepartureLng:

"driverDepartureTime":"16:03:39",  
"driverDepartureLat":40.13988,  
"driverDepartureLng":-79.7864012,

Breaking the Stop’s Geofence During Exit

After the driver has completed the stop, Maven will add a final event to the queue, geofenceStopDeparture, once the driver physically breaks the stop's geofence.

The geofenceStopDeparture Return Event will only trigger when the driver crosses that stop’s geofence:

If there are multiple stops with overlapping geofences, the geofenceStopDepartures may overlap time-wise with other events for the subsequent stop. This is the only event that behaves in this manner.

If the driver begins their stop outside the stop’s geofence, this event will never fire. If geofenceStopDeparture does not fire, the fleet should expect stopDeparture as the final event.

This event does not trigger on any driver interaction. It will only trigger when Maven detects that the driver has left the stop’s geofence. But it does require the driver to have completed the stop. That is pressed the “Mark Stop As Complete” button.

This event (and all subsequent events) will have the following information about the stop’s geofence departure:

The time and place of the stop arrival will be recorded under the geofenceEndTime, geofenceEndLat, and geofenceEndLng:

 // On a completed stop, these may be null.  
  "geofenceEndTime":"16:06:39",  
  "geofenceEndLat":40.13918,  
  "geofenceEndLng":-79.7864085,