Create DVA From Assets
Using the processCreateDVAfromAssets API, you can automatically create new daily Domicile Vehicle Availability (DVA) records on a scheduled frequency based on the mapped Asset’s business hours. The number of days must be supplied as an input to the API.
This API can be used in API Jobs and scheduled at regular intervals to create DVAs. A Sample Job Template (CREATEDVA) is also provided in the Transportation Smarbench, which can be readily used to schedule DVA creation. See Sample job definitions with ESC and API templates
When the API is run, the system looks for the Domicile Vehicle records where:
- Domicile and Equipment Types, if provided in the API match. If not provided in the API, then Domicile and Equipment Types will be ignored.
- Asset mapping exists for the Asset Codes provided in the API with Create DVA From Assets selected.
- DVAs will be created for the derived Domicile-Equipment-Vehicle ID combinations based on the business hours of the Asset.
- If UpdateExistingDVAs is false, then if DVAs already exist within the LookAheadDays, they will neither be updated, nor new ones will be created for those days for which DVAs exist. If the flag is true, then the existing ones will be removed and new ones will be created for those days.
- Expiry date of the Asset will be considered while creating DVAs. If LookAheadDays provided is such that, at the time of API transaction, a few days are after the expiry date, then DVAs will get created only for the days where the asset has not expired. Anything after the expiry date will not get created.
- The API will get executed in the best effort mode, that is API transactions will be stored for the successful entities even if creation of one or more other DVAs fail.
Below example describes the details of the DVA creation based on Business Hours.
Note: Business Hours support two ranges (From – To) for availability for each day of week and also for exceptions/holidays.
Suppose, an Asset has Business Hours definition as:
Business Hour set up
• Monday : 8:00 to 12:00 and 14:00 to 18:00
• Thursday: 20:00 to 23:59
• Friday: 00:00 to 04:00
Holiday/Exception set up
• Holiday on 1st Monday (say 4 Oct) of the next Month (not set - no holiday)
• Holiday on 2nd Monday (say 11 Oct) of the next Month (not available entire Day i.e. set as 00:00 – 00:00)
• Exception on 3rd Monday (say 18 Oct) of the next Month (available 11:00 to 15:00)
• Holiday on 4th Monday (say 25 Oct) of the next Month (not set - no holiday)
Assuming that the API is executed on the last day of every month and number of days provided as input to the API is 30 days.
Then DVAs will be as follows:
Domicile ID | Equipment Type | Vehicle ID | Availability Start Date/Time | Must End By Date/Time |
---|---|---|---|---|
From DV association | From DV association | From DV association | 4-Oct (Mon); 08:00 | 4-Oct (Mon); 12:00 |
From DV association | From DV association | From DV association | 4-Oct (Mon); 14:00 | 4-Oct (Mon); 18:00 |
From DV association | From DV association | From DV association | 18-Oct (Mon); 11:00 | 18-Oct (Mon); 15:00 |
From DV association | From DV association | From DV association | 25-Oct (Mon); 08:00 | 25-Oct (Mon); 12:00 |
From DV association | From DV association | From DV association | 25-Oct (Mon); 14:00 | 25-Oct (Mon); 18:00 |
From DV association | From DV association | From DV association | 7-Oct (Thurs); 20:00 | 8-Oct (Fri); 04:00 |
From DV association | From DV association | From DV association | 14-Oct (Thurs); 20:00 | 15-Oct (Fri); 04:00 |
From DV association | From DV association | From DV association | 21-Oct (Thurs); 20:00 | 22-Oct (Fri); 04:00 |
From DV association | From DV association | From DV association | 28-Oct (Thurs); 20:00 | 29-Oct (Fri); 04:00 |
Notes
- DVAs will be created for both available slots on the 1st and 4th Mondays based on the regular business hours.
- DVAs will not be created for 2nd Monday because it is not available the entire day.
- DVAs will be created for the exception defined for the 3rd Monday instead of the regular business hours.
- Special consideration will be given when the Business Hours end at 23:59 on a day and begin at 00:00 the next which implies that there is a continuation of business hours. In the above examples some DVAs will be created which start on Thursdays and end on Fridays.
- Times Zone offsets of Assets will not be considered while creating DVA records. Assumption is that DVA records are created in local time.
- DVAs will not be created for any day of week for which duration is not set i.e. all ranges are set as 00:00.
See Also