Train Cancellation: Difference between revisions

From Open Rail Data Wiki
Document train cancellation messages
Rework cancellation details
Line 1: Line 1:
== Overview ==
== Overview ==


The Train Cancellation message is used to indicate a train that has been cancelled.
When trains are cancelled, a cancellation message is sent.  This contains details of the cancellation - the location to which it applies, the type of cancellation, and the reason code.


== Example ==
As with all other messages, cancellation messages will only be received for train schedules which have already been activated.


<pre>
== Data structure ==
{
    "header": {
        "msg_type": "0002",
        "source_dev_id": "L0BL",
        "user_id": "#QDP1120",
        "original_data_source": "TRUST DA",
        "msg_queue_timestamp": "1359167584000",
        "source_system_id": "TRUST"
    },
    "body": {
        "train_file_address": null,
        "train_service_code": "25437000",
        "orig_loc_stanox": "",
        "toc_id": "71",
        "dep_timestamp": "1359153300000",
        "division_code": "71",
        "loc_stanox": "80419",
        "canx_timestamp": "1359167580000",
        "canx_reason_code": "X2",
        "train_id": "802E51M725",
        "orig_loc_timestamp": "",
        "canx_type": "EN ROUTE"
    }
}
</pre>


== Data structure ==
=== Header ===
=== Important Header fields ===


{| class='wikitable'
{| class='wikitable'
Line 41: Line 15:
|msg_type
|msg_type
|Set to '0002' for a cancellation message
|Set to '0002' for a cancellation message
|-
|source_dev_id
|Set to the device ID of the terminal that issued the request
|-
|-
|source_system_id
|source_system_id
|Set to "TRUST" for cancellation messages
|Set to "TRUST" for a cancellation message
|-
|-
|original_data_source
|original_data_source
|Blank (for automatic cancellations on call), "SDR" (Simplified Direct Reporting) or "TRUST DA" (TRUST Delay Attribution)
|Set to "TOPS" or "SDR" for a reactionary cancellation, or "" for a planned cancellation (STP 'C')
|-
|user_id
|The identity of the user who made the cancellation
|}
|}


=== Body ===
=== Body ===
It is important to note that TRUST is not able to cancel a train unless it has already reported at a location.


{| class='wikitable'
{| class='wikitable'
Line 60: Line 32:
!Description
!Description
|-
|-
|train_file_address
|train_id
|The TOPS train file address, if applicable
|The 10-character unique identity for this train at TRUST activation time
|-
|-
|train_service_code
|orig_loc_stanox
|Train service code as per schedule
|For an an "OUT OF PLAN" cancellation, set to the location in the schedule that the train should have been at
|-
|-
|orig_loc_stanox
|orig_loc_timestamp
|Only populated in cancellation type "OUT OF PLAN", and references the identity of the location that the schedule should have been at.
|For an "OUT OF PLAN" cancellation, the departure time of the location in the schedule that the train should have been at
|-
|-
|toc_id
|toc_id
|Operating company ID as per [[TOC_Codes]]
|Operating company ID as per [TOC Codes]
|-
|-
|dep_timestamp
|dep_timestamp
|Timestamp representing the departure time of the train at the location that the train is cancelled from
|The departure time at the location that the train is cancelled from
|-
|-
|division_code
|division_code
|As toc_id
|Operating company ID as per [TOC Codes]
|-
|-
|loc_stanox
|loc_stanox
|The location that the schedule is being cancelled from. In "OUT OF PLAN" cancellations, this will not be in the schedule but a 0003 Train Movement message will have been sent.
|The STANOX of the location in the schedule that the train is being cancelled from. For an "OUT OF PLAN" cancellation, this STANOX will not be in the schedule, but a [Train Movement] message will have already been sent for
|-
|-
|canx_timestamp
|canx_timestamp
|The time at which the cancellation is made in TRUST.
|The time at which the cancellation was input to TRUST
|-
|-
|canx_reason_code
|canx_reason_code
|Reason code for cancellation, as per the Delay Attribution Guide
|The reason code for the cancellation, taken from the [Delay Attribution Guide]
|-
|-
|train_id
|canx_type
|Set to the 10-character unique identity for this train, as appearing in other TRUST message types
|Either "ON CALL" for a planned cancellation, "AT ORIGIN", "EN ROUTE" or "OUT OF PLAN"
|-
|-
|orig_loc_timestamp
|train_service_code
|Only populated in cancellation type "OUT OF PLAN", and references the departure time of the location that the schedule should have been at.
|Train service code as per schedule
|-
|-
|canx_type
|train_file_address
|Populated with "ON CALL", "AT ORIGIN", "EN ROUTE" or "OUT OF PLAN".
|The TOPS train file address, if applicable
|-
|-
|}
|}

Revision as of 14:56, 14 February 2013

Overview

When trains are cancelled, a cancellation message is sent. This contains details of the cancellation - the location to which it applies, the type of cancellation, and the reason code.

As with all other messages, cancellation messages will only be received for train schedules which have already been activated.

Data structure

Header

Field Description
msg_type Set to '0002' for a cancellation message
source_dev_id Set to the device ID of the terminal that issued the request
source_system_id Set to "TRUST" for a cancellation message
original_data_source Set to "TOPS" or "SDR" for a reactionary cancellation, or "" for a planned cancellation (STP 'C')

Body

Field Description
train_id The 10-character unique identity for this train at TRUST activation time
orig_loc_stanox For an an "OUT OF PLAN" cancellation, set to the location in the schedule that the train should have been at
orig_loc_timestamp For an "OUT OF PLAN" cancellation, the departure time of the location in the schedule that the train should have been at
toc_id Operating company ID as per [TOC Codes]
dep_timestamp The departure time at the location that the train is cancelled from
division_code Operating company ID as per [TOC Codes]
loc_stanox The STANOX of the location in the schedule that the train is being cancelled from. For an "OUT OF PLAN" cancellation, this STANOX will not be in the schedule, but a [Train Movement] message will have already been sent for
canx_timestamp The time at which the cancellation was input to TRUST
canx_reason_code The reason code for the cancellation, taken from the [Delay Attribution Guide]
canx_type Either "ON CALL" for a planned cancellation, "AT ORIGIN", "EN ROUTE" or "OUT OF PLAN"
train_service_code Train service code as per schedule
train_file_address The TOPS train file address, if applicable