N4 3.4 Gate - Api.specification
N4 3.4 Gate - Api.specification
Confidential -- Proprietary
1
Gate API Specification
Description
1 Levels of Gate Automation
1.1 Total Automation
1.2 Semi-automation
1.3 Data Entry Assist
2 General Process Flow
2.1 Automated Gates
2.2 Self-help Gates
3 General API Structure
3.1 Common Webservice API
3.2 Accessing the Common Webservice API
3.3 XML Payload Formats
3.4 XML Request Format
3.5 XML Response Payload Format
3.6 XML Response Format Configuration
3.6.1 Response Format Configuration Settings
3.6.1.2 Element <truck-visit>
3.6.2 Response Format Parameters
4 Process API's Provided by Sparcs N4
4.1 read-preadvise
4.2 record-scan
4.3 process-truck
4.4 create-truck-visit
4.5 notify-arrival
4.6 request-pickup-appointments
4.7 submit-transaction
4.8 submit-multiple-transactions
4.9 stage-done
4.10 cancel-transaction
4.11 cancel-truck-visit
4.12 need-assistance
4.13 create-appointment
4.14 update-appointment
4.15 cancel-appointment
5 Process API's Provided by Other Systems
5.1 notify-resume
5.2 open-gate-arm
5.3 print-ticket
5.4 truck-arrival
5.5 truck-departure
6 Driver Interaction
6.1 Pickup Selection
6.2 Dropoff Details
7 Process Truck API Workflow
7.1 Basic Scan Validation
7.2 Process Pre-lodged Dropoffs
7.3 Fail Unexpected Container
7.4 Solicit Further Details
7.5 Process Pre-lodged Pickups
7.6 Solicit Appointment Selection
7.7 Solicit Pickup Selection
Description
This document describes the implementation details for how various technologies can be leveraged to automate gate processing and
the formal API's defined in N4 to interact with the gate operating system (GOS) that is physically controlling these devices.
1.2 Semi-automation
Even with this technology, if pre-advised dropoffs or appointments and pickup appointments are not consistently provided, it is not
possible to entirely automate the in-gate. Some intervention may be required, by either the driver or a clerk to provide any missing
information.
<record-scan scan-status="0">
<gate-id>MAIN</gate-id>
<stage-id>SECURITY</stage-id>
<truck id="A56874" trucking-co-id="TC1"/>
<truck-visit gos-tv-key="624093573762"/>
<timestamp>2007-07-28T13:45:12</timestamp>
</record-scan>
</gate>
An alternative format for <truck-visit> has been introduced whereby the <truck-transactions> element is contained within the
<truck-visit> element so the response indicates the relationship between truck-visit and transactions.
TRUCK_TRANSACTION_RESPONSE_ATTACHMENT_RESPONSE
The <truck-visit> and <truck-transactions> elements are at the same level in the response. This is the default setting and is
compatible with pre-2.0 releases.
Example:
TRUCK_TRANSACTION_RESPONSE_ATTACHMENT_TRUCK_VISIT
Notes:
1. The configuration setting applies to all API's that return a <truck-visit> and transactions. This enables the customer to use the
same interpretation for all <truck-visit> responses.
2. The attribute tv-key has also been added to the <truck-transactions> element. This allows a programmatic association between
truck-visits and transactions if the pre-2.0 format is used.
4.1 read-preadvise
Using this API for a self-help gate, the GOS container read the possible existing details for a drop that is either pre-advised or has an
existing appointment.
Context Attributes: gate Id, stage id, lane id
Data Attributes: container id
Response: a detailed payload is returned containing the container type, export booking, gross weight, seal numbers, etc.
4.2 record-scan
Using this API information detected at the gate can be passed to Sparcs N4. Each piece of information can be passed individually,
thus resulting in several API calls as information becomes available, or the information can be bundled together into one single API
call. Sparcs N4 will persist this information for later use when the truck is processed. Typically this API is used for a gate where a
clerk will do the actual processing and the scanned data will only be used to assist the data entry, so it is beneficial to make the
information available to Sparcs N4 as soon as it is known. scan-set-id must be unique for all requests, except in cases where the
intent is to update the existing scan information that was previously sent with a scan-set-id.
Context Attributes: gate Id, stage id, lane id, scan-set-id
4.3 process-truck
Using this API the processing of a truck can be initiated in Sparcs N4. This API can include all the information scanned in the lane.
So calling the "Record Scan" API prior to this call is not necessary. However the information from prior calls of "Record Scan" will be
used to supplement the information sent in the "process truck" call.
Normally for a highly automated gate with appointments, the entire processing of the truck at the in-gate can be performed with this
one call. Without appointment/pre-advise information, some further interaction with the driver or the assistance of a clerk may be
required. This situation is discussed separately in a later section.
For other gate stages, such as the out-gate, or a straddle exchange lane, the entire processing can almost always be performed
entirely from this one API call.
Context Attributes: gate Id, stage id, lane id
Data Attributes: Truck details, Chassis Profile details, Driver information details, Images, Scale weight information, Truck visit
appointment number or Gate transaction appointment numbers, Equipment Scan information consisting of container scan,
Accessory scan and Chassis scan, Image Details and scan set related details. Container scan has container accessory details,
container damages details, container placard details, container VGM details (VGM weight, VGM weight unit and VGM entity) and
container bundle(payload) details. Accessory scan has accessory damage details in addition to basic accessory info. Chassis
scan has chassis accessory details, chassis damages details, chassis placard details and chassis bundle(payload) details.
Sample request and response message formats for process-truck gate api are shown below.
Request:
Response: for completely automated gates the ticket information is returned from a successful call. For less automated
gates, information describing what additional data is required from the driver is returned.
4.4 create-truck-visit
This API can be called to create the truck visit only. In an environment where pickups are configured to be automatically assigned, a
call to process-truck with no drop-off data would create the truck visit but would also continue to assign the pickups.
Context Attributes: gate Id, stage id, lane id
Data Attributes: truck license nbr, truck id, bat nbr
Response: no specific response
4.5 notify-arrival
This API is called to notify N4 that a truck has arrived at a certain stage and that N4 should initiate processing of that stage. Typically
this is used to notify arrival at an exchange area. N4 activates the work instructions and the stage will be completed once the moves
have occurred.
Context Attributes: gate Id, stage id, exchange area id, lane id
Data Attributes: truck license nbr, truck id, bat nbr
Response: no specific response
4.6 request-pickup-appointments
The GOS can call this API to initiate the automatic processing of a truck's pickup appointments. If the work flow is so configured, N4
will automatically process the truck's appointments if they do not exceed the maximum TEU's configured. Otherwise, if there are two
many appointments, this API will just return a list of outstanding appointments.
Context Attributes: truck visit identifier
Data Attributes: none
Response: list of containers for pickup
4.7 submit-transaction
For semi-automated gates, information may be required from the truck driver to proceed. Typically for pickups this is often required
where the driver must specify something to determine what pickup should be performed.
Context Attributes: gate Id, stage id, lane id
Data Attributes: truck visit identifier, transaction type, optional truck transaction identifier along with either an appointment id,
container id, pin number, container VGM details (VGM weight, VGM weight unit and VGM entity), order number (if selecting empty by
booking/EDO) or equipment order item (previous call was select empty by booking/EDO and a list of order items was returned for
driver selection).
Response: Normally the standard response with no payload. If an appointment number was submitted, a list of possible
remaining appointments will be returned.
4.8 submit-multiple-transactions
For truck visits with multiple transactions a new API is required to submit multiple transactions from a given gate stage, gate stage
permitting. This new API will submit multiple transactions for the truck visit after the the truck visit is created using create-truck-visit
API in the first gate stage and before the stage-done API for all remaining stages
Context Attributes: gate Id, stage id, lane id
Data Attributes: truck visit identifier, and multiple transactions element truck-transactions consisting of individual
truck-transaction elements.
Response: Response for submit-multiple-transactions API consist of truck visit element followed by truck-transactions
elements which contains individual truck-transaction response from each individual submit-transaction API.
4.10 cancel-transaction
GOS will call this API to request N4 cancel a gate transaction. Typically this is used for a failing pickup transaction that the driver has
decided to forego. User can specify either the transaction gkey directly or the container number in which case the latest transaction
associated with this container-nbr will be cancelled.
Context Attributes: gate Id, stage id, lane id
Data Attributes: transaction key (returned in submit-transaction API response) or container number
Response: other than the common response no payload is returned.
4.11 cancel-truck-visit
GOS will call this API to request N4 cancel a gate truck visit. This is a new API required to cancel a bare truck visit with no
transactions or all canceled transactions.
Context Attributes: gate Id, stage id, lane id
Data Attributes: truck visit key or gos truck visit key(returned in create-truck-visit API response)
Response: For bare truck visits or truck visits with canceled transactions response consists of truck-visit element
containing truck visit gkey, gos truck visit gkey and truck visit status. For truck visits with active transactions, response consists of
truck-visit element followed by truck-transactions element containing individual active truck-transaction elements.
4.12 need-assistance
GOS will call this API to request N4 to mark this lane as requiring assistance.
Context Attributes: gate Id, stage id, lane id
Data Attributes: none
Response: other than the common response no payload is returned.
4.13 create-appointment
A third party system can call this API to create a container appointment in N4.
Data Attributes: appointment-date, appointment-time, truck trucking-co-id, tran-type, container, pin-nbr, Driver and Truck
information, Booking information, Container information, appointment validation-only attribute, etc.
Response: Includes appointment number, that was generated by N4, along with appointment details.
Variation: The <appointment> element of the create-appointment API has a Boolean attribute, validation-only, that specifies
whether the appointment request is for validation purpose only or for creating and saving an appointment. When a third party system
uses the Boolean attribute to indicate that the appointment request is for validation purposes only, N4 does not save any appointment
data; however, N4 does process the appointment stage workflow and if any errors are generated, N4 returns the same in the
response.
For backward compatibility, the default value for the validation-only attribute is false. This means that if the validation-only attribute
is missing OR the whole <appointment> element is missing then the appointment is always created (if no rules fail), as before.
4.14 update-appointment
A third party system can call this API to update an existing container appointment in N4.
Data Attributes: appointment-date, appointment-time, truck trucking-co-id, tran-type, container, pin-nbr, Driver and Truck
information, Booking information, Container information etc.
4.15 cancel-appointment
A third party system can call this API to cancel one or more existing container appointments in N4.
Response: Returns the same list of appointment-nbr and/or external-ref-nbr for each appointment along with the appointment state
(Cancel).
5.1 notify-resume
Sparcs N4 can call this API to indicate that a manual step has been completed the GOS can continue. This can be used to pass
control back to the GOS after a clerk has intervened. For example a truck arrives and goes into trouble status because of some error.
The response to the GOS indicates trouble but the GOS cannot continue as the truck is waiting for a trouble clerk to intervene. Once
the trouble clerk has fixed the issue or has done all that he intends with it then control can be passed back to the GOS. The call will
either be as a result of the stage being submitted successfully or the clerk selecting via a button on the gate screen.
Context Attributes: gate Id, stage Id, lane Id
Data Attributes: truck visit identifier, truck transactions, appointments
Response: status code and optionally error messages
5.2 open-gate-arm
Sparcs N4 will call this API to request that the GOS open the gate arm. If the clerk has to manually process a gate stage in N4, then
N4 needs to call out to open the gate arm when it detects that the clerk has finished.
5.3 print-ticket
Sparcs N4 will call this API to request that the GOS print the specified ticket. Normally, the GOS can produce the ticket directly from
the response to the process-truck API call. However, in some environments a clerk always intercedes and manually processes the
truck entirely using the SPARCS N4 Gate User Interface. Also, in some more automated environments, the clerk will sometimes
intercede and manually process a truck with serious problems. In both these cases, the intercession can occur several minutes after
the process-truck API call. The trigger for printing the ticket is the successful completion of a transaction and this event is in this case
caused by an action in N4.
Context Attributes: gate Id, stage id, printer id
Data Attributes: ticket type, document data XML
Response: status code and optionally error messages
5.4 truck-arrival
This API is used to notify tracking systems of a truck arrival into the scope of coverage of the tracking system.
Context Attributes: gate Id, stage id, lane id
Data Attributes: container ids, container types, accessory ids, chassis Id, truck license nbr, truck id, tracking tag identifier
Response: status code and optionally error messages
5.5 truck-departure
This API is used to notify tracking systems of a truck departure from the scope of coverage of the tracking system.
Context Attributes: gate Id, stage id, lane id
Data Attributes: truck license nbr, truck id, tracking tag identifier
Response: status code and optionally error messages
6 Driver Interaction
6.1 Pickup Selection
Even in a highly automated gate, some interaction with the driver may be required. Typically this is needed to specify pickups. There
are several variations for this interaction with the driver. The actual container id could be provided or a pin number might be used as
an alias. Or, the driver could provide a group, bill of lading number, or even an export booking number for dray-offs. These entries
would indicate any container within that group/BL/Booking is acceptable.
For picking up empties, a specific container could be entered, but it is more common to provide a booking or EDO number. If the
booking/EDO has multiple types of equipment, just the number is not sufficient and Sparcs N4 must respond with a list of order items
for the driver to select from.
Since the interaction for empty pickups is somewhat different involving several different combinations of fields it may be necessary to
initiate the entire interaction by first asking the driver the basic transaction type (pickup up an empty, bare chassis or full container).
Where the term "full container" is sort of a misnomer here because the container could be a revenue empty container (empty import,
empty export or transship drayoff). Once this determination is made the driver enters
- Pickup Full - appointment number or (container and/or pin) or (group or BL or booking)
- Pickup Empty - appointment number or container or order number
For the pickup Empty, if an order number is entered, when it is submitted N4 will return a list of order items from which the driver must
select.
Introduction
1. Time Slot in Create Appointment Webservice Request
Success Scenario
Failure Scenario
2. Cancel Gate Appointment Webservice Request
2.1 Cancel Appointment By Appointment Number
2.2 Cancel Appointment By Reference Number
2.3 Canceling Multiple Appointments(Using Both Appointment and External Reference Number)
2.4 Cancel Appointment Associated to TruckVisit Appointment
3. Update Gate Appointment Webservice Request
3.1 Update Appointment Not Associated To A Truck Visit Appointment
3.2 Update Appointment Associated To A Truck Visit Appointment
Introduction
This enhancement involves enhancing the existing create-appointment api to request appointment for a specific time via a web
service call. Existing behavior was that SPARCS N4 would respond with the next availabe timeslot appointment for the requested
date. Also ability to update an existing appointment and cancelling appointments are dealt as a part of this enhancement. The
requirements for this enhancements is tracked using NFRM-485.
<create-appointment> webservice request is enhanced to accept time for an appointment (this element is an optional element). User
can request appointment for a particular time of day. appointment-time should be strictly in the format "HH:mm:ss". If slots are
available then an appointment will be created in the requested slot. Please refer the schema definition for request format.
Success Scenario
A gate appointment is requested for a specific time of a day, if all conditions are met SPARCSN4 creates an appointment for the
requested time.
Sample Request
Sample Response
Gate appointment will be created for the requested date and the appropriate time slot.
If time slot is not available for the requested time or all available quota is completely full, the error message would be sent in the
response and in addition a list of available slots for that day will be sent in the response. User can choose to make the appointment
for the available time slots.
Sample Request
Sample Response
The response will contain the error message and a list of available slots for the respective date.
A new webservice request <cancel-appointment> is introduced to cancel one or more gate appointments. An appointment can be
canceled only when its present state is CREATED. An appointment can be canceled by using either the appointment number or by
the external reference number.
A gate appointment cannot be canceled if it is associated to a truck visit, any attempts to cancel will throw error.
A gate appointment can be canceled by specifying the appointment number in the request.
Sample Response
Similarly an appointment can be canceled by specifying a reference number instead of the appointment number. While canceling an
appointment using reference number, system tries to find appointments only in CREATED state. If no appointments are found, sytem
Sample Request
Sample Response
2.3 Canceling Multiple Appointments(Using Both Appointment and External Reference Number)
In the below figure 2 Appointments are in CREATED state and one is in CANCELED state, user can close multiple appointments
using cancel-appointment api. If error is encountered while canceling any one of the appointment, system adds the error in the
response and cancels the other appointments sucessfully.
Sample Request
Sample Request
Sample Response
A new webservice request <update-appointment> is introduced to update gate appointments. An appointment can be updated only
when its present state is CREATED.
When a gate appointment is not associated to a truck visit all fields of an appointment can be updated. Any attempts to cancel date
and time of an appointment will cancel the current appointment and will create a new appointment with the available data.
Update to other fields except date and time of a gate appointment when it is not associated to a truck visit can be updated using the
<update-appointment> api. User can specify appointment-nbr or the external-ref-nbr to identify the appointment( priority would be
given to the appointment number and then the external reference number). System updates all the values changed to the
appointment.
Existing appointment
Sample Response
When a gate appointment is not associated to any truck visit appointment and any attempt to update the date and time of the
appointment will cancel the current appointment and creates a new appointment with the available data.
The below gate appointment is requested for 2010-03-12 and for the time 10:00 to 10:30 AM, and the gate appointment is not
associated to a truck visit appointment.
Sample Response
The behaviour would same as explained in section 3.1.1 Update All Fields Except Date And Time.
When we try to update the date or time of an appointment which is already associated to a truck visit,system will throw the error
"Cannot update appointment 2,699 date and time,it is already associated to a truck visit appointment."
Sample Request
Sample Response
1. Introduction
2. Truck Visit Appointment API
2.1 Create Truck Visit Appointment
2.2 Update Truck Visit Appointment
2.3 Cancel Truck Visit Appointment
1. Introduction
NFRM-485 also deals with creation of new webservice APIs to handle i.e Create, Update and Cancel truck visit appointments. This
document explains about the APIs which is introduced as a part of NFRM - 485.
<create-truck-visit-appointment> API can be used by the third party systems to create a Truck Visit Appointment in SparcsN4. Please
refer the schema document for the request format. Explained below the usage for create-truck-visit-appointment request.
2.1.1 Create Truck Visit Appointment With Date And Time Element
A truck visit appointment can be requested for a specific time of day by specifying the appointment time in the request and if
requested the truck visit appointment will be created for that particular time, provided slots are available. Also a truck visit
appointment can be created with gate appointments associated to it, by specifying a list of appointments. All the gate appointments
should be in CREATED state, and these gate appointments if already associated to a truck visit appointment will be be disassociated.
Then they would be associated to the created truck visit appointment. System would throw error if all the appointments are not for the
same gate.
In the below figure there are 2 gate appointments, one associated to truck visit appointment and the other not associated to any truck
visit appointment. User can associate the appointment by specifying either the appointment number or the external reference number.
Sample Request
A truck visit appointment is created for the specific time of the day and the two gate appointments are associated to this truck visit
appointment
Failure Scenario
If the user requests for a time for which either there are no available quota or if the time slots are not available, system returns in
response the list of available slots, user can select a different time of the day.
Sample Request
Sample Response
When create-truck-visit-appointment request is sent without appointment-time element system creates appointment for the next
available time slot.
Sample Request
Sample Response
<update-truck-visit-appointment> API can be used by the third party systems to update a Truck Visit Appointment in SparcsN4.
Please refer the schema document for the request format. Explained below the usage for update-truck-visit-appointment request.
Only Truck Visit Appointments in created state can be updated.
Truck visit appointment can be updated using the appointment number, system updates the appointment only when the appointment
is in CREATED state, throws error when appointment is not found or if the appointment is in a state other than CREATED. System
while updating checks the list of gate appointments as a part of current API, associates new gate appointments and disassociates the
gate appointment which are not part of the current API. While associating if the gate appointments are associated to a different truck
visit, system disassociates and associates the gate appointment with this truck visit appointment.
The following scenario demonstrates updating the attributes of a truck visit appointment. A truck visit appointment is created with
transaction appointments 4741, 4742 and 4743 (external reference number 18862).
Sample Request
Sample Request
When date and time of a truck visit appointment is updated, system cancels this appointment and creates a new truck visit
appointment. All the transaction appointments will be associated to the new truck visit appointment. Please note the truck visit
appointment is updated by specifying the external reference number.
Sample Request
Sample Request
The truck visit appointment is canceled and a new truck visit appointment is created and the gate appointments are associated to the
newly created truck visit appointment.
In case when we update a truck visit appointment by specifying external reference number or appointment number for which no truck
visit appointment exists, system rejects the request by sending the error message. In the following case user tries to update a truck
visit appointment using external-reference-number for which no truck visit appointments exists in the system.
Sample Request
Sample Response
<cancel-truck-visit-appointment> API can be used by third party systems to cancel a Truck Visit Appointment in SparcsN4. Please
refer the schema document for the request format. Truck Visit Appointment can be canceled only when its present state is
CREATED. Canceling truck visit appointment will disassociate all gate appointments before canceling.
An appointment can be canceled by specifying the appointment number in the request.In the following figure, the truckvisit
appointment has one gate appointment associated to it, upon canceling the truck visit appointment, the gate appointment will be
dissociated from the truck visit before cancelation and the truck visit state will be marked as CANCELED.
Sample Response
The gate appointment is disassociated and the truck visit appointment state is updated to CANCEL
Sample Request
Sample Response
In the below figure one Appointment is in CREATED state, one is in CANCELED state and the other is in USED state. User can close
multiple appointments using cancel-truck-visit-appointment api. If error is encountered while canceling any one of the appointment,
system adds the error in the response and cancels the other appointments sucessfully.
Sample Request
Sample Response
1. Introduction
2. Processing of Truck Visit Appointments
2.1 Gate Configuration Changes
2.1.1 Steps to create a filter and configure it against the gate stage.
2.2 Manual Processing of Trucks with Truck Visit Appointments
2.2.1 User enters Truck Visit Appointment Number / Truck Visit Appointment Reference Number.
2.2.2 User Enters Truck id, Truck License, Driver card id
2.2.3 Entering Truck Visit Appointment Reference Number
2.3. Processing Using the Gate API's
2.3.1 System Finds Truck Visit Appointment
2.3.1.1 Appointment with Earliest Start Time
2.3.1.2 Appointment with Lowest Run Number
2.3.1.3 Multiple Appointments with Same or No Run Number
2.3.2. GOS Sends in Truck Visit Appointment Number/Reference Number
2.3.2.1 Truck Visit Appointment Does Not Exist
2.3.2.2 Truck Visit Appointment Exists and Gate Appointments Are Associated
Debug Info
1. Introduction
This page describes the features implemented for NFRM-485 for processing the trucks with truck visit appointments. Both manual
processing and processing the trucks using web service API is described in this document.
This section describes the changes made for NFRM-485, to process the truck with truck visit appointments using gate screens.
Earlier when the appointments tab was introduced for gate screens, users were able to filter the appointments only based on the
transaction types and the appointments tab was populated only based on the entered driver card id. Now users can create a simple
parameterized filter in the Gate Appointments Table View and set it against the particular stage. This enables users to configure how
appointments tab of a gate stage should be populated. For example in a gate stage if the appointments tab is to be populated based
on the entered driver card id and pickup transaction types, a filter can be created in the Appointments table view and that filter can be
set against this stage.
Driver Card Id, Truck Id, Truck License Number, Trucking Company and Truck Visit Appointment Number.
2.1.1 Steps to create a filter and configure it against the gate stage.
The requirement is to populate only appointment associated to the entered truck visit appointment number and only pick ups.
Apply the criteria, system would prompt a value for the truck visit appointment number, enter a value and save the table view
as a filter.
So whenever user enters the truck visit appointment number at the respective stage, where the filter is configured, the entered
appointment number would be used for the parameter set in the filter and system populates all gate appointments which are within
the late tolerance and associated to the truck visit appointment.
Please note it is not required to set the field Gate id, Appointment state in the filter as the stage will always populate appointments
matching the gate stage and appointments in CREATED state only.
There may be cases where the filter for the appointments tab is not set or the set filter was deleted, in both these cases system would
populate all appointments within the late tolerance for the entered trucking company. Also when a filter is parameterized and if the
value for the parameter is not entered in the gate screen system would not populate the appointments tab.
Truck Visit Appointment Number and Truck Visit Appointment Reference number is now available for configuration at truck visit level.
2.2.1 User enters Truck Visit Appointment Number / Truck Visit Appointment Reference Number.
When the truck arrives at the gate, user can enter the truck visit appointment number or the reference number. System finds a valid
truck visit appointment for the entered number and if found system populates all relevant details on the screen, and also populates
the appointment tab based on the filter criteria set.
In this case the truck visit appointment 6708 has one gate appointment 6707 associated to it, and when user enters the truck visit
appointment number, system fills in all the details, creates the truck visit and transactions based on the data from the associated
Appointment tab populated with gate appointment associated with the truck visit appointment.
All transactions tab populated with the transaction created with the details from the gate appointment.
When the truck arrives at the gate, user can enter the truck id, truck license, and driver card id and only if truck visit appointment
number widget is available on the screen, system finds the earliest truck visit appointment for the entered details. If found system
populates all relevant details on the screen, and also populates the appointment tab based on the filter criteria set. In case if multiple
truck visit appointments are found for the entered details with the same start time, system selects the appointment based on the run
number field. Selection of truck visit appointment based on run number is described in the later part of this document. When system
There are 2 truck visit appointments for Truck License 18816 and Trucking Company 18816 i.e. 6710 for 19-04-2010 and 6711 for
20-04-2010. When truck license 18816 is entered system finds the earliest appointment 6710 and populates the data on the screen.
In case if more than one truck visit appointment matches the given criteria, system would neither fetch the truck visit
appointment on the screen nor would show the error. User would be required to enter the right truck visit appointment
number to proceed.
The behaviour would be same if user enters truck visit appointment reference number in place of truck visit appointment number.
System finds matching truck visit appointment in created state and if found populates all relevant details on the screen.
Entering truck visit appointment reference number instead of truck visit appointment number.
Process truck API can be used to process a truck with truck visit appointments. <process-truck> API is modified to accept both truck
visit appointment number and external reference number.
When GOS sends in atleast one of the following Truck ID, Truck License, Driver Card in the <process-truck> API, system finds all
appointments matching the data submitted and chooses the most valid truck visit appointment based on the appointment time.
Truck visit appointment is valid if its state is CREATED, current time is after the early tolerance and appointment late tolerance has
not passed. If multiple appointments are found, appointment with the earliest start time is selected. If multiple appointments exist for
the same start time, system will select the appointment with the lowest run number. Run Number 0 or blank will be considered after
any other values.
Lets assume we have two truck visit appointments for the Driver Card Id18816, Appointment 6891 for 2010-04-21 10:00 and
Appointment 6895 for 2010-04-21 14:00, when truck arrives at the gate GOS sends in the Driver Card Id in the <process-truck> API.
System selects the earliest truck visit appointment i.e 6891and creates truck visit and transactions based on the data from truck visit
appointment and gate appointments respectively.
Response
In case if there are multiple appointments with same earliest start time, system selects the appointment with lowest run number.
Appointments with 0 run number will be considered after any valid run numbers and appointments with blank run number will be
considered after appointments with 0 run number.
Lets assume there are 2 appointments for Driver Card Id 18818 and same start time 2010-04-20 09:00:00, Appointment 6896 with run
number 10 and 6897 with run number 1252. When truck arrives at the gate, GOS sends in the Driver Card Id in the <process-truck>
API. System selects the earliest truck visit appointment, and as there are multiple appointments with same earliest start time, system
selects the appointment 6896 which has the lowest run number and creates truck visit and transactions based on the data from truck
visit appointment and gate appointments respectively.
Two truck visit appointment for the driver card id 18818 for the same start time 2010-04-20 09:00:00
Take the case where there are 2 appointments for Driver Card Id 18819 and same start time 2010-04-20 10:00:00, Appointment 6900
with run number 0 and 6901 with run number 777. When truck arrives at the gate, GOS sends in the Driver Card Id in the
<process-truck> API. System selects the earliest truck visit appointment, and as there are multiple appointments with same earliest
start time, system selects the appointment 6901 which has 777 as run number and creates truck visit and transactions based on the
data from truck visit appointment and gate appointments respectively.
Two truck visit appointment for the driver card id 18819 for the same start time 2010-04-20 10:00:00
Response
Two truck visit appointment for the driver card id 18820 for the same start time 2010-04-20 10:00:00
Response
Take the case where there are 2 appointments for Driver Card Id 18821 with same start time 2010-04-20 10:00:00, Appointment 6904
Two truck visit appointment for the driver card id 18821 for the same start time 2010-04-20 10:00:00
Response
In case if multiple appointments exists with same run number (valid run number or zero or null) system throws the error and sends all
the truck visit appointments in the response. In the following case there are 2 appointments for Driver Card Id 18822 with same start
time 2010-04-20 10:00:00, Appointment 6912 and 6913 with same run number 14875. When truck arrives at the gate, GOS sends in
the Driver Card Id in the <process-truck> API. As there multiple appointments with the same start time and same run number, system
throws an error message and sends back the truck visit appointment in the repsonse.
Two truck visit appointment for the driver card id 18822 for the same start time 2010-04-20 10:00:00 and same run number 14875
Response
GOS can send in the truck visit appointment number or the external reference number in the process truck request in the <truck-visit>
element.
Sample Request
System can send both gate appointment numbers and truck visit appointment number in the process truck API, in which case system
In all these cases described let us assume that we have gate appointments created and associated to the truck visit appointments.
When user sends in a truck visit appointment number or reference number in the <process-truck> API which is not available in the
system, SPARCSN4 throws an error only if the stage is configured with the task RejectTVAppointmentUnknown and creates the truck
visit in trouble status, else system would create a normal truck visit with the values from the process-truck API.
As the task RejectTVAppointmentUnknown was included, system rejects the truck visit, creates the truck visit in trouble.
2.3.2.2 Truck Visit Appointment Exists and Gate Appointments Are Associated
When truck visit appointment exists and have gate appointments associated to it, system creates the truck visit and transaction for the
associated gate appointments. The truck visit appointment 6666 us created with one gate appointment 6665.
Truck visit is created with the data from truck visit appointment and transaction created from the data from gate appointments.
Debug Info
In case if the appointments tab is not populated with data, please enable logging by navigating to Administration -- Settings -- Logging
and add the com.navis.road.business.appointment.model in the Package field and set the Log Level to Debug. This will print the
predicate which can be used to find what the predicate was for the appointments tab.
Support for general cargo fields for the GATE API requests
N4 supports the general cargo fields for the Gate API requests: