Overview
Fleet Management Job 2
The Fleet Management Job 2 is a series of batch jobs that sends requests to and receives information from Catena, an ELD aggregator. This job runs continuously every 15 minutes from beginning of Pass 1. It is a 9-pass batch process that performs the following tasks.
Both Fleet Management 1 and Fleet Management 2 jobs may NOT be enabled at the same time. Before running Fleet Management Job 2, confirm that the Samsara integration is not Enabled. Navigate to TMS Admin → Credentials and find the Samsara card. Uncheck the Enabled field and click Save.
Pass Overview
Pass 1 | Get Authentication Token | |
↓ | ||
Pass 2 | Set Timezone for all Shipping Locations | |
↓ | ||
Pass 3 | Sync Fleet Asset Records | |
↓ | ||
Pass 4 | Update Fleet Asset Locations | |
↓ | ||
Pass 5 | Sync Driver Records | |
↓ | ||
Pass 6 | Get Latest Driver HOS Clocks | |
↓ | ||
Pass 7 | Get Latest Driver HOS Logs & Log Entries | |
↓ | ||
Pass 8 | Delete Obsolete Driver Log Entry Records | |
↓ | ||
Pass 9 | Update Load Locations |
PASS 1: Calls the Catena API to generate an authentication token to allow for additional calls to Catena. Executes each time the job runs.
PASS 2: Set Timezone for all shipping locations (1000 max per pass). Executes each time the job runs.
Pass 2 only runs if the Timezone Update Disabled field in TMS Admin → Configuration is Unchecked.
All shipping locations without a time zone but have the Shipping Postal Code and Shipping Latitude fields populated are eligible to update.
The Addrexx integration is called to match Account addresses. Addrexx requires addresses have a Country value paired with either a City or Postal Code. Addresses without a Country value generate an error message that is sent via email.
Addresses returned from Addrexx are matched to Account locations. Addresses must match on City, State, and the Time Zone must match the Salesforce Time Zone picklist value. If no match is found, the Timezone is set to Unknown.
When a match is made, the Account timezone is set to the time zone returned from Addrexx.
PASS 3: Sync Fleet Assets with Catena Vehicles. Executes each time the job runs.
Fleet Assets are NOT created in the TMS first and sent to Catena.
The Account SFID is matched to the Catena fleet_id record to populate the Fleet Asset Company/Division field in the TMS.
If the Account SFID does not exist in the TMS, the Fleet Management Default Carrier populates the Company/Division field. The Fleet Management Default Carrier is set under TMS Admin → Configuration, Fleet Management.
Catena Vehicles are sorted for creating or updating records in the TMS. The VIN and ELD Id fields in Catena and the TMS are compared to determine if the record exists in the TMS.
ELD ID values cannot begin with a 0.
If an Catena vehicle does not exist in the TMS, a Fleet Asset record is created.
The following Catena fields populate the TMS Fleet Asset record.
Name
Company/Division
ELD Brand
ELD Model Number
ELD Serial Number
ELD ID
License Plate Number
VIN
Year
The TMS sets the following fields.
The Type field is set to Tractor.
The Status field is set to Available.
The Vehicle Make and Vehicle Model fields are set to Other if a specific picklist option is not available.
If a Fleet Asset record matches an Catena record by VIN, no new record is created.
When the VIN matches, but the ELD Id does not, the following TMS Fleet Asset fields are updated with Catena values.
ELD ID
ELD Serial Number
ELD Brand
If a single TMS Fleet Asset record matches two separate Catena vehicles by VIN and ELD Id, the following occurs.
The ELD Serial Number is compared between Catena and the TMS.
If the ELD Serial Number does not match, the TMS record is updated with the Catena value.
The record Name and License Plate fields are compared between Catena and the TMS.
If either field does not match, the TMS sends the information to update the Catena record.
No TMS records are sent to create records in Catena. Only the Name and License Plate fields are sent to update Catena records in this scenario.
If 2 or more TMS Fleet Asset records match an Catena record by VIN and ELD Id, the following occurs.
The TMS record that matches the Catena VIN has the following fields updated with the Catena value.
ELD ID
ELD Serial Number
ELD Brand
The TMS record that matches the Catena ELD Id has the following fields update and are set to no value.
ELD ID
ELD Serial Number
ELD Brand
Each Telematics Service Provider (TSP) has unique record requirements and restrictions. Use caution with Fleet Asset Name or License Plate fields that may be sent to Catena to update records. For example, some TSP services limit Name fields to a specific number of characters. TMS Fleet Asset record Name and License Plate fields may allow for more characters.
PASS 4: Get and Save the latest Vehicle Locations. Executes each time the job runs.
Vehicles are matched by the Catena vehicle_id field to the ELD ID field on the Fleet Asset record.
PASS 5: Sync TMS Drivers with Catena Drivers. Executes each time the job runs.
Drivers are returned from Catena and matched to existing TMS Driver records.
Account SFIDs are matched to Catena fleet_id fields. to The Account record value populates the Driver and Contact record Company/Division fields in the TMS.
If the Account SFID does not exist in the TMS, the Fleet Management Default Carrier populates the Company/Division field. The Fleet Management Default Carrier is set under TMS Admin → Configuration, Fleet Management.
Catena Drivers are sorted for record syncing. Catena and TMS Driver records are matched based on 3 separate criteria: ELD ID, 3 License fields, or Username and ELD Brand.
The Catena ELD Id matches the TMS Driver ELD ID field.
The following Driver fields are compared. Any mismatches are sent sent from the TMS to update the Driver record in Catena.
CDL #
CDL State/Province
Cycle Override
Rest Break Override
Restart Override
Timezone
The Catena License Number, License State, and License Country fields all match to the corresponding TMS Driver fields.
Catena Field
TMS Field
License Number
↔
CDL #
License State
↔
CDL State/Province
License Country
↔
CDL Country
The TMS Driver ELD ID and ELD Brand fields are updated to match the Catena values.
The following Driver fields are compared. Any mismatches are sent sent from the TMS to update the Driver record in Catena.
Cycle Override
Driver Name
Rest Break Override
Restart Override
Timezone
The Catena username field matches the TMS Driver Username and ELD Brand fields.
The TMS Driver ELD ID field is updated to the Catena value.
The following Driver fields are compared. Any mismatches are sent sent from the TMS to update the Driver record in Catena.
CDL #
CDL State/Province
Cycle Override
Driver Name
Rest Break Override
Restart Override
Timezone
Drivers that only exist in the TMS (no matches) and have the ELD Enabled field Checked are sent to Catena.
Drivers that only exist in Catena (no matches) are created in the TMS.
TMS Contact records are searched for any Driver names that only exist in Catena. If no record exists, a new Contact is created.
The Contact Name field is the Driver Name.
The Contact Account Name field is set to the Account associated with the Fleet. If the Account does not exist in the TMS, the Fleet Management Default Carrier populates the field. The Fleet Management Default Carrier is set under TMS Admin → Configuration, Fleet Management.
The Contact Transportation Role is set to Driver.
If a TMS Contact record exists, the new Driver record Email and Phone fields are populated from the Contact record.
The Driver Type field is set to Employee when the following occurs.
When the Driver Type field does not have a value AND;
The Contact Account Name field is associated with the Fleet or the Fleet Management Default Carrier. The Fleet Management Default Carrier is set under TMS Admin → Configuration, Fleet Management.
The Driver Type field is set to Independent Contractor when the following occurs.
When the Driver Type field does not have a value AND;
The Contact Account Name field is NOT associated with the Fleet or the Fleet Management Default Carrier. The Fleet Management Default Carrier is set under TMS Admin → Configuration, Fleet Management.
The Driver Phone updates the corresponding Contact record Phone.
The Driver First and Last Name fields must be unique for some ELD Providers. Creating a duplicate Driver (same First and Last Name) for a Driver record that already exists in Catena causes an error.
Use caution when creating Driver records in the TMS. Driver records cannot be deleted once sent to Catena. Driver Name (First and Last Name) fields cannot be changed in Catena. Changing a Driver Name in the TMS does not update the Catena record for that Driver.
Cycle Override Value Mapping
Catena Value
TMS Cycle Override Picklist Option
USA 70 hour / 8 day
USA Property (8/70)
USA 60 hour / 7 day
USA Property (7/60)
70-hour/8-day
USA Property (8/70)
60-hour/7-day
USA Property (7/60)
Any other value
Unrecognized Value from API
PASS 6: Retrieves the Driver Hours of Service Clocks. Executes each time the job runs.
Catena Drivers are matched to TMS Drivers. The following TMS Driver fields are updated with Catena values.
Cycle Time Remaining
Drive Time Remaining
Shift Time Remaining
Time Until Break
The TMS does no calculations to determine these values.
PASS 7: Retrieves the latest Driver Hours of Service (HOS) Driver Log and Driver Log Entry records. Executes once per day. The period when Driver Long Entry records may be updated is defined by the Driver Log Grace Period (Days) field. By default, Driver Log Entry records for 2 days prior to the current day. Driver Log records are only created once the day is ended. This field may be changed under TMS Admin → Configuration, Fleet Management.
Driver Log and Driver Log Entries are returned from Catena. Drivers are matched to Log and Log Entry records by the driver_id field returned from Catena and stored in the Driver ELD ID field.
Driver Log and Driver Log Entry records are matched to existing records or new records are created in the TMS.
When Driver Log or Driver Log Entry records exist in the TMS and match records from Catena, the records are updated with values received from Catena.
The Catena values are not added to existing fields or rolled-up when updating TMS records. The values received from Catena overwrite the existing values.
When Driver Log or Driver Log Entry records do not match any existing TMS records, new records are created in the TMS.
One Driver Log record is created for each day and named the “Driver Name - Date.” For Example: “Joe Driver - 2024-09-30.”
Time fields for a Driver Log record start at 00:00:00 and end at 23:59:59.
Catena can populate multiple Driver Log Entry records to a single Driver Log record.
A driver may create additional Log Entries on a date for a Driver Log record that already exists.
These additional log entries are passed from Catena to the TMS and added to the existing Driver Log Record as an additional Driver Log Entry.
When a Driver Log Entry is added or updated, any obsolete Driver Log Entry records are deleted in Pass 8. Driver Log Entry records can only be updated during the Driver Log Grace Period.
Catena sends an “Event” and each event corresponds to a single Driver Log Entry record. This event is stored in the Status field. Refer to the Catena documentation for more information regarding fields populated in this pass.
Catena Event Type
TMS Driver Log Entry Status
driving
Driving
onDuty
On Duty Not Driving
offDuty
Off Duty
personalConveyance
Personal Conveyance
sleeperBed
Sleeper Berth
yardMove
Yard Move
Any other value
No Status
Driver Log records are never created for the current day.
PASS 8: Deletes obsolete Driver Log Entry records from the TMS. Executes each time the job runs. Any Log Entry records within the Driver Log Grace Period and do not match to the Driver Log records received during Pass 7 are deleted. Driver Log Entries outside of the Driver Log Grace Period are not deleted. This pass does not delete Driver Log records.
Record Delete example: While in the Driver Log Grade Period, a driver updates a log entry from 2 days prior. The driver updates the off duty time from 7:00 pm to 6:15 pm. The next time Pass 7 runs, the updated entry is received by the TMS. A new Driver Log Entry record is created for the appropriate Driver Log. Pass 8 then runs and deletes the original 7:00 pm record entry as it does not match the Log or Entry received in Pass 7.
Pass 9: Updates the current location of a Load based on the Fleet Asset Geolocation. Executes each time the job runs.
Geolocations are requested for each Fleet Asset. If the Geolocation field changes from the previous time the job ran, then the ELD Last Update field also updates.
When performing only 1 pass the Fleet Management 2 Job does not reschedule itself. Run a single Pass for testing or troubleshooting ONLY.