Read My Boarding Pass App

In the previous blog post I discussed the underlying standards of the BCBP (Bar Coded Boarding Pass) following IATA Reso 792. Today I will built an Android mobile app that scans the PDF417 barcode and shows the raw content as well the decoded fields.

The are 3 main challenges for building the app, scanning/reading the barcode and decoding the text to individual attributes and as last, not to use any internet connection (to assure the user the users privacy and avoid any potential identity theft discussions)

As we build a native Android app we can rely on third party libraries to scan and decode barcodes. There is a number of commercial libraries in the market, but as I build a free app I will use the zxing-android-embedded library, which is a port of the ZXing (“Zebra Crossing”) barcode scanning library for Android with added embedding features, ZXing only provides the decoding logic. Both are licensed under Apache 2.0, ZXing can decode all the common types, such as EAN-8, EAN-13, UPC, ITF, PDF417, QRCode, Aztec, Data Matrix and a few more.

Integration Barcode Library ZXing

With the library the integration becomes as simple as adding a few lines of code only.

Add the dependency to the build gradle file

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'

    compile 'com.journeyapps:zxing-android-embedded:3.5.0'
}

Trigger the scan and read the result

public void scanCode(View view){
        new IntentIntegrator(this).initiateScan();
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
        if(result != null) {
            if(result.getContents() == null) {
                System.out.println("Scan failed or cancelled.");
            } else {
                System.out.println(result.getContents());
            }
        } else {
            super.onActivityResult(requestCode, resultCode, data);
        }
    }

For now, the app (“ReadMyBoP – Read My Boarding Pass”) does nothing but scan the barcode, identify if it is a valid boarding pass barcode, display the raw content and makes the content more human-readable. You can download from Google Playstore. It works with Android 4.1 and above.
There is one extra feature for now, it decodes the IATA fare codes (First, business, economy classes and the various discounted codes, it follows IATA Reso 728 if you want to look for the complete codeset.

Decoding the Raw Text

Given the fact, this is a fixed-length field text, it is no big deal to split the relevant info by substring’ing it using the decoding table that we started in the previous post. As basic validation we can use the mandatory “M” on position 1 and a length of not less than 59 characters (mandatory fields).

# Element Mandatory Size Sample Remark
1 Format Code M 1 M Always “M”
2 Number of legs encoded M 1
3 Passenger Name M 20
4 Electronic Ticket Indicator M 2 E
5 Operating carrier PNR Code M 7
6 Origin IATA Code M 3 FRA Airport Code
7 Destination IATA Code M 3 SIN Airport Code
8 Operating carrier IATA Code M 3 LH Airline
9 Flight Number M 5 3456
10 Date of Flight M 3 280 Julian Date
11 Compartment Code M 1 B First, Business, Economy
12 Seat Number M 4 25A
13 Check-in Sequence Number M 5 0012
14 Passenger Status M 1 00
15 Size of optional Block M 2 5D hexadecimal
16 Start Version Number 1 > Always “>”
17 Version Number 1 5
18 Field Size of follow ing structured message 2
19 Passenger Description 1
20 Source of check-in 1
21 Source of Boarding Pass Issuance 1
22 Date of Issue of Boarding Pass (Julian Date) 4
23 Document Type 1
24 Airline Designator of boarding pass issuer 3
25 Baggage Tag Licence Plate Number 1 13
26 Baggage Tag Licence Plate Number 2 13
27 Baggage Tag Licence Plate Number 3 13
28 Field Size of follow ing structured message 2
29 Airline Numeric Code 3
30 Document Form/Serial Number 10

Is there a roadmap ? For sure, if I find the time I will add the optional fields, an airline and airport code dictionary (must check the size of a local sqllite db if we want to stay offline). Maybe add baggage tag reader feature and local barcode image storage for boarding. Stay tuned !

readmybop1.2

Application Disclaimer: The application is for educational and research purpose. It is provided as-is, no warranty included. It does not transmit data over the internet and does not store any data upon exiting the app.

Advertisements

What’s in my boarding pass barcode ?

Since more than 10 years passengers are used to the barcode imprinted on the traditional ticket boarding pass slip, the home printed boarding pass or the boarding pass displayed in the mobile app provided by the airline. To be more precise the 2004 IATA Passenger Service Conference approved Resolution 792 setting the BCBP (Bar Coded Boarding Pass) standard as part of the STB (Simplify The Business) program.

The barcode simplifies passenger handling as the barcode can be read automatically by barcode readers along the passenger journey for bag-drop, security check area access and boarding. It significantly reduces the error rate to the time before barcode and eventually saved millions of Euros/Dollars due to mishandling and delays. Today we see self-boarding gates that remove the need for an agent, though business and first class passenger are still welcomed by a human gate agent. Btw, the magnetic stripe on the back of the old tickets expired in 2010.

Old Passenger Ticket without barcode (Image Public Domain)

The BCBP standard defines PDF417 (public domain standard, no fees or licenses) as the barcode symbol format as well defines the encoded content. The content in the barcode contains the same information as printed on the standard boarding pass, though some airlines omit information on the self-printed version in favor of simplicity, some extra info is optionally encoded.

2017-10-07 06_47_41-Boarding-Pass Barcode Aztec QR Generator

Sample PDF 417 barcode

M1SMITH/JOHN          EHJK345 FRASINLH 3456 280C015A0001 100

The standard covers 3 additional barcodes that are not used for printing, but used for mobile apps, these are Aztec and QR Code.

The encoding is straight foward using fix-length fields and the code can carry up to 4 legs of a journey.

Element Size Sample Remark
Format Code 1 M Always “M”
Number of legs encoded 1 1
Passenger Name 20
Electronic Ticket Indicator 2 E
Operating carrier PNR Code 7
Origin IATA Code 3 FRA Airport Code
Destination IATA Code 3 SIN Airport Code
Operating carrier IATA Code 3 LH Airline
Flight Number 5 3456
Date of Flight 3 280 Julian Date
Compartment Code 1 B First, Business, Economy
Seat Number 4 25A
Check-in Sequence Number 5 0012
Passenger Status 1 00

These are the mandatory fields, there are additional optional fields and blocks for baggage info, document info, frequent flyer number or security data.

To be noted, the IATA PADIS XML message standard shall be used for the exchange of BCBP data between systems, defined in Resolution 783 – Passenger and Airport Data Interchange Standards.

I like to add also, the printed barcode is the current common nominator for international travel, but there are initiatives on the way to simplify the passenger journey even further with newer technology such as biometric ID’s and identity management, eg. IATA OneIdentity Initiative.

In the next post we will assemble a simple Android application to read the boarding pass barcode. Stay tuned.

Disclaimer: The information provided here might not be correct or complete. It is for educational purpose only. For reliable information please refer to the IATA manuals.

IATA Type B Bag Messages and Baggage Messaging Refresher

There is quite some movement in baggage handling and its associated messaging needs and requirements at the moment.  Though the IATA recommended practices RP 1745 and RP 1800 are around for quite a while, the IATA Resolution 753 (baggage tracking and custody) has to be implemented by June 2018 and the new BAG XML message standard is shaping up and will most likely released first time in 2017. Traditionally any handling of baggage requires a type-B message to be sent to the relevant parties. This is a push-based approach and due to the nature of type-B messages prone to errors (format) and accumulate costs by the distributing network operators and its transaction based charges. According to a IATA study/business case in the year 2012 26 million of bags have been mishandled, mostly for transfer bag handling and a good share of this is caused by missing or wrong messages.

This article is meant to provide an overview or general introduction, aka baggage messaging for starters. Baggage Handling is very complex process with dependencies and actors, including airlines, airport, handling agent and eventually the passenger and his baggage.

Main Systems involved in the process of baggage handling

DCS Departure Control System
BHS Baggage Handling System
BRS Baggage Reconciliation System

DCS
The Departure Control System is the operational backbone of every airline. It supports the check-in, baggage acceptance, boarding process and other related activities like load control, immigration.

BHS
The Baggage Handling System (usually owned by the airport) is a complex system of conveyor belts, chutes and bag drops that transports and buffers any checked-in luggage. It ensures that luggage that is checked-in, transferred or received from arriving flights is tracked, counted, scanned, screened and transported to the right bag chute or belt.

BRS
The Baggage Reconciliation System, usually used by the handling agent, helps to match passenger, bag, flight and container.

Traditional Type-B Messages for Baggage Handling (defined in IATA RP 1745)
RP 1745 defines the formats of the messages exchanged between the systems for automated baggage and passenger reconciliation, baggage sortation and other baggage services.

BTM Baggage Transfer Message
BSM Baggage Source Message
BPM Baggage Processed Message
BUM Baggage Unload Message
BNS Baggage Not Seen Message
BCM Baggage Control Message
BMM Baggage Manifest Message
BRQ Baggage Request

Baggage Tag Number or License Plate Code
A unique 10 digit number as reference for each piece of baggage, defined in IATA RP 740.
The bag tag number is part of the baggage messages.
According to resolution 751, effective June 1st 2013, the format contains only numbers.
Sample: 0220208212 (0-220-208212)

1 1 digit Leading digit 0
2 3 digit Airline code 220 Lufthansa
3 6 digit Bag number 208212

The printed barcode is a regular ITF-14 code, any smartphone can read the barcode. The number is also printed on the bag tag.

KLM is printing a “KL” in between but the barcode only contains numbers. “074” for KLM.

BTM
The Transfer Message contains bag information for the outbound carrier of incoming transfer passengers. Part of a through check-in transaction.

BSM
The Source Message is sent from the DCS to the baggage handling system upon checkin at the airport or bag drop.

BPM
The Processed Message is an status update sent locally, eg. baggage handling to carrier. BPM’s are often batched.

BUM
The Unload Message is the instruction to unload (or not to load) a specific bag, eg. no-show PAX at the gate.

BNS
The Not Seen Message contains bag info for baggage that could not been transported together with the passenger.

BCM
The Control Message serves secondary level information, such as
BAM Baggage Acknowledgement
FOM Flight Open
FMM Final Match
DBM Delete Baggage

BMM
The Baggage Manifest contains baggage details for down line stations.

BRQ
The Baggage Request asks for bag info from a baggage handling system.

Sample Message
A very simple sample of a transfer message

BTM
.V/1TOFRA
.I/LH123/14OCT/CPH
.F/LH234/14OCT/SIN
.N/0220588615021
.P/SMITH/JOHN   
.L/7FABC
ENDBTM
1 .V Version and suppl. data Transfer Station FRA (Frankfurt)
2 .I Inbound Flight Number and date CPH (Copenhagen)
3 .F Outbound Flight Number and date SIN (Singapore)
4 .N Baggage Details 10 digit bag tag id 0220588615021
5 .P Passenger Name John Smith
6 .L PNR Passenger Name Record 7FABC

Message Flow for interline flight

The below is rather simplistic view (sunshine scenario) of the messaging that happens around bag management for a 2 segment interline flight with through-check-in of bags.

Message Flow for interline flight
A passenger is flying on LH 401 from JFK to FRA and SQ 025 from FRA to SIN. An interline flight with baggage checked through Singapore.

Relevant Documentation or References

IATA RP 1745 Baggage Service Messages
IATA RP 1796
Baggage System Interface
IATA RP 1701f
Self Service Baggage Process
IATA RP 1800
Baggage Process Description for Self-Service Check-in
IATA RES 753
Baggage Tracking

Online References
Remark: Most of the IATA documents are not available freely and have to be purchased, here only links to public documents or pages.

IATA RES 753 https://www.iata.org/whatwedo/stb/Documents/baggage-tracking-res753.pdf
IATA BAG XML Initiative
http://www.iata.org/whatwedo/ops-infra/baggage/Pages/baggage-xml.aspx

Disclaimer: The information provided here might not be correct or complete. It is for educational purpose only. For reliable information please refer to the IATA manuals.

Airport AODB goes NoSQL (Part 1)

In previous blog posts I discussed ‘AODB and Big Data‘ and ‘AODB in the Cloud‘. As promised, in this third and largest part of the review, I will look at the NoSQL database approach, design a document datamodel, embed it into a MEAN stack and conclude in looking forward implementing an AODB in a Serverless Architecture using Microservices.

In this new series I will review the benefits and options of using a document-oriented database (NoSQL) and start a transition journey moving away from a relational database model to document database.

Robert Yarnall Richie, DeGolyer Library, Southern Methodist University

Lockheed 12A Electra Junior, Delta Air Lines at Dallas Airport in 1940 by Robert Yarnall Richie (DeGolyer Library, Southern Methodist University)

Before jumping into relational datamodel review and document design we shall have look at some industry initiatives and working groups that strive for standards with semantic models, business models,  information and data models and exchange formats and patterns. While a lot of airport systems have been developed years back in the absence of these models, but with best knowledge and common practice and experience in the field, we cannot ignore further the existence of emerging and established standards. For legacy systems is near to impossible to adopt the models at the core business implementation layer as products are usually designed around a datamodel which cannot be changed without a significant or even total redesign of the system. Here the approach is the adoption of the models at an integration and mapping layer. You can adopt eg. AIDX as messaging exchange format without having to use it as base of the product, though it creates additionally effort to create mappings. An additional challenge is certainly the number of models around because they were created by different organisations with different but often overlapping aviation domains in mind. I have to admit the organisations are cooperating and represented in the working groups to achieve a level of harmonization where possible. We look at IATA, ICAO, ACI, Eurocontrol, EUROCAE as lead organizations here.

Lets list the current models. This list is certainly not complete and only provides a brief overview. We can and should benefit from the availability of these models (most of them are freely accessible). A lot of standardization effort is going on at the moment, please note some models are to be considered as “work-in-progress”, some are quite advanced, major changes are not be expected and some are also due to submission to governing boards soon or in the process of it. Once the models, at least the exchange message formats, start materializing as official standard we will see them appearing in requirement and tender documents and soon to be out there to simplify system integration.

AIDX Aviation Information Data Exchange IATA XML Message Standard ***
AIDM Airline Industry Data Model IATA Model **
AIRM ATM Information Reference Model Eurocontrol Model ***
AIXM Aeronautical Information Exchange Model Eurocontrol Model ***
ACRIS Semantic Model ACI Model *
AMXM Aerodrome Mapping Exchange Model EUROCAE Model ***
FIXM Flight Information Exchange Model Model ***
WXXM Weather Information Exchange Model Eurocontrol Model ***
BAG XML
Baggage Message Exchange Eurocontrol XML Message Standard *

Status as of end 2016
*** official release available
* work in progress

In the context of AODB products I will look at the below models and message standards first, though all of them are important because there is no clear borderline in the heterogeneous IT landscape at airports, eg. it is a common request by users to see weather data being displayed in dashboards of an AODB despite weather is not a key entity. In the further blog entries, while establishing a new datamodel, we will also discuss the individual models. Some models focus more on ATM and less on airport related activities.

AIDX

Aviation Information Data Exchange is a XML messaging standard to allow information exchange between airlines, airports and other parties in the aviation community. It has been initially created in 2005 and was officially released in 2008, endorsed by IATA Recommended Practice 1797A. Being one of the old timer in this list it is already established and adopted by more than 100 entities. It comprises almost 100 distinct fields that cover most aspects of flight, aircraft and handling details, inclusive of A-CDM. The AIDX working group is governed by ASC (Airport Services Committee) and PADIS (Passenger and Airport Data Interchange Standards) board under the custody of PSC (Passenger Service Conference).

Please note that AIDX will be migrated into the AIDM (Airline Industry Data Model) which has a much broader scope than AIDX. We shall not ignore AIDX as it will be around for a long time in its raw format and we can expect the AIDM implementation would be quite close (to be discussed and confirmed).

The current release is 16.1. Please follow below links for schema and implementation guide.

 

AIDM and BAG XML

The Airline Industry Data Model (AIDM) has a very broad scope and encompass industry terminology, data definitions, relationships, business requirements.
Looking at an evolution from paper (eg. loadsheets ticket), teletype messages to EDIFACT, the emerging new standards as models and XML are the latest step in the evolution and promise to deliver a better consistency of definitions and data formats, as well an improved interoperability and faster system integration times.
AIDM is work-in-progress and give its nature and vast landscape it might be the continuous model for it, though confirmed standards will arise from it. One of the first implementations adopting the AIDM is the BAG XML initiative which improves bag handling related bag messaging, distribution and does away with the traditional type B messages (BTM, BSM, BPM, BUM, BNS, BCM, BMM, BRQ as per IATA RP 1745).
The documents are not public at this stage, only registered member can access the model which is build with Sparx Enterprise Architect.

In part 2 I will review a simplified relational database model for an AODB as starting point for our migration journey. Stay tuned.

Some reference websites and material you find below.

References Organizations

Eurocontrol https://www.eurocontrol.int
ACI Airports Council International http://www.aci.aero
IATA International Air Transport Association http://www.iata.org
ICAO International Civil Aviation Organization http://www.icao.int
EUROCAE European Organisation for Civil Aviation Equipment https://www.eurocae.net
RTCA Radio Technical Commission for Aeronautics http://www.rtca.org

References Standardization and models

ACRIS http://www.aci.aero/About-ACI/Priorities/Airport-IT/ACRIS
AIRM http://im.eurocontrol.int/wiki/index.php/ATM_Information_Reference_Model
https://www.eurocontrol.int/articles/airm-atm-information-reference-model
https://www.eurocontrol.int/sites/default/files/content/documents/sesar/8.1.3.d47-airm-primer-v4.1.0.pdf
AIDM http://www.iata.org/whatwedo/passenger/Pages/industry-data-model.aspx
AIDX http://www.iata.org/publications/Pages/info-data-exchange.aspx
BAG XML http://www.iata.org/whatwedo/ops-infra/baggage/Pages/baggage-xml.aspx
AIXM http://www.aixm.aero
https://ext.eurocontrol.int/aixmwiki_public/bin/view/Main/
WXXM http://www.wxxm.aero
FIXM https://www.fixm.aero
AMXM http://www.amxm.aero

( Model, implementation guidelines or schema available on website without registration.)

References Technology:

Disclaimer: This discussion, datamodel and application is for study purpose solely. It does not reflect or replicate any existing commercial product.

Online IATA Telex Processor

I launched a first version of a Telex processor with a web frontend. It is a beta version and currently only processes MVT standard messages.

Some words about the requirements for a flexible interface processor

  • Though IATA Telexes are defined by a standard, variations are common because some are produced automatically by other systems and some are created manually, which causes more errors. The processing of telexes, the pattern recognition, must be flexible enough to be able to handle extra inline whitespaces and dots, as well extra lines with free text or extra headers and trailer, eg. now it is more common to receive telexes via email and often some extra email information is added as header before it reaches your system. Customers also might create their own telex standards, meaning the whole message is transported as free text message, but inside the message the customer uses his own syntax for data transmission.
    This requires a message interpreter that can be configured for new or non-standard formats on the fly, without the need to change any sourcecode and to redeploy a system.
    (I saw a project at one airport where the change of LDM format interpretation would have cost the customer around 10.000 Euro because one of the cargo airlines send messages with an extra header line)
  • Other standard messages, such as AFTN, NOTAM or CFMU should be processed by the same engine using the same approach. One interface engine with the flexibility of the scripts covers the various aspects of the different types.

A few words about concept and architecture

  • ESB
    Certainly the word ESB sometimes might appear bloated like other IT buzzwords, but it hardly makes sense today to implement distinct own interface systems for every protocol or subsystem type you come across. In a heterogeneous IT landscape like an airport an ESB allows you to easily connect inbound and outbound to a number of other systems via TCPIP, Email, FTP,.. or even talk to other standard systems like SAP, Salesforce.com and so on. We use one connector to talk to the ESB, the rest we orchestrate in the ESB itself. With MULE ESB we have the freedom of an opensource product as well the power of enterprise support. The learning curve for MULE is not too steep.
    For the sample of telexes: Sometimes you ‘receive’ telexes by using the auto export function of the Sitatex application and retrieve the files with the messages via FTP, or you receive the messages as email or via a queuing server from a central corporate entrypoint. We can swing over to another source or run in parallel without touching the main system.
  • Script Engine
    Instead of hardcoding the various formats, we use a Java Script engine executing Groovy Scripts. These scripts, one for each message type, are stored in the DB and can be adjusted or customized easily. The scripts produce an internal XML formatted standard output which easily can be un-marshalled during the downstream processing using proper XSD.
  • Data Processing
    Whatever requirements you have how to handle the received data. In our sample system here, receive from the web frontend and make it human readable.

Please feel free to drop by http://tools.airtilus.net:8080/AirtilusTelexR and try by yourself. Please note: Do not process confidential as the data is transmitted unsecured and might be stored (to improve the quality). This is NOT a commercial offering but a technology showcase. There is no warranty that the server is available or the processor correct. You can use the example message and modify it, otherwise copy and paste your own message.

The service is currently running on a Amazon EC2 micro instance, performance might decrease with a lot of traffic.

Online Telex Processor

Outlook

  • Summary for errors and rejected messages.
  • For the next versions I will add some of the other available telex types will follow such as LDM and CPM.
  • Add AFTN message interpretation.
  • Email Reply (send an email to the service and the human readable version is emailed back to the user).

IATA Telex Types Definition

Updates about the online telex processor here

Working in the airport IT industry you are always challenged with integration tasks at each airport. Usually you face a heterogeneous landscape of home-brew or taylored solutions and standard software running on anything from mainframe to virtual instances in a private clouds. Using an ESB we can tackle a lot of interfacing work and focus on the data integration part. One interface that you will find on all airports that operate commercial flights, is a link to the SITA network to send and receive IATA Telexes.

It is hard to find any information online, so I summarised the available message types here. Btw, these telex types are often referred to as SITA Telex types, which is not correct, IATA (Air Transport Association) defines the available telex types and SITA is operating the network to distribute the messages between airlines, airports, ATC, groundhandling agents and other relevant members of the airport community.

This list should be almost complete, giving you the type, the description and the AHM (Airport Handling Manual) or RP (Recommended Practice) reference. The AHM that you can purchase from IATA gives you all the syntax and details for most of the available types.

Find more info about baggage messaging here: IATA Type B Bag Messages and Baggage Messaging Refresher

 MVT  AIRCRAFT MOVEMENT MESSAGE IATA AHM 780
 LDM  LOAD MESSAGE IATA AHM 583
 PTM  PASSENGER TRANSFER MESSAGE IATA RP 1718
 PSM  PASSENGER SERVICE MESSAGE IATA RP 1715
 DIV  AIRCRAFT DIVERSION MESSAGE IATA AHM 781
 BSM  BAGGAGE SERVICE MESSAGES IATA RP 1745
 CPM  CONTAINER/PALLET DISTRIBUTION MESSAGE IATA AHM 587
 UCM  ULD CONTROL MESSAGE IATA AHM 388
 SCM  ULD STOCK CHECK MESSAGE IATA AHM 385
 SLS  STATISTICAL LOAD SUMMARY IATA AHM 588
 ASM  ADHOC SCHEDULED MESSAGE IATA AHM 785
 PAL  PASSENGER ASSISTANCE LIST IATA RP1707b, 1708
 LPM  LOAD PLANNING MESSAGE IATA AHM 580
 ALI  ABBREVIATED LOAD INFORMATION MESSAGE IATA AHM 584
 SOM  SEATS OCCUPIED MESSAGE IATA RP 1712
 TPM  TELETYPE PASSENGER MANIFEST IATA RP 1717
 RQL  REQUEST LIST MESSAGE IATA RP 1709
 PNL  PASSENGER NAME LIST IATA RP 1708
 PFS  PASSENGER FINAL SALES MESSAGE IATA RP 1719
 IDM  INDUSTRY DISCOUNT MESSAGE IATA RP 1714
 ASL  ADDITIONS AND DELETIONS LIST IATA RP 1708
 SAL  SEATS AVAILABLE LIST IATA RP 1713
 RQM  REQUEST INFORMATION MESSAGE IATA AHM 783
 UWS  ULD/BULK LOAD WEIGHT SIGNAL IATA AHM 581
 FMM  FUEL MONITORING MESSAGE IATA AHM 782

Disclaimer: The list might not be correct or complete. It is for educational purpose only. For reliable information please refer to the IATA manuals.

MVT, LDM, PTM, TPM, CPM, PSM, UCM are among the most common telexes from my experience. If you implement a telex interpreter you definitely need to implement these types first.

I am working on an online telex processor, a demo version I will put online soon.