1. Home
  2. Sample Projects
  3. Flight Reschedule

Flight Reschedule

◷ Reading Time: 4 minutes

In this Flight Reschedule tutorial, we are going to demonstrate the behavior of a Decision Requirement Diagram using an example of a flight rescheduling scenario.

There will be two lists as the input for this scenario:

  • Flights
  • Passengers

These are the main decisions we will be making when reassigning the flights for the passengers who got the flights canceled:

  • Determine passenger queue
  • Reassign the passengers

Furthermore, as business knowledge, we will also filter out:

  • Canceled Flights

Running the Sample

1. Open the file, Flight Reschedule.xml.

Project explorer view showing the logic documents in the project and Flight reschedule.xml selected

2. Click on Logic Run Template.

Detail view of the Logic Run Template menu item

3. Click on one of the given templates.

Logic Run Template view showing the available test templates

4. Click Debug.

Detail view of the Debug menu item

5. Click Next Step to go step by step.

Detail view of the Debug Next Step menu item

6. Once the execution completes successfully, you will see the output under the Parameters window.

Parameters view showing the output of the test run

Flight Reschedule process steps

The process contains a set of main steps:

  1. Get canceled flights
  2. Determine passenger queue
  3. Reassign passengers
    1. Pick the first passenger in the queue
    2. Identify the best Active alternative flight
    3. Assign the alternative flight to the passenger
    4. Keep reassigning passengers until all the passengers in canceled flights are reassigned to active flights

Project Description

The project contains the following files:

DRD (Decision Requirement Diagram)

  • Flight Reschedule.xml: Shows the data flow

Natural Language

  • Reassign Passengers.xml: Reassigns the passengers

Business Formula

  • BusinessFormula.xml: Define expressions used in the DRD

The Model Design

We have used a DRD to define the decision hierarchy. The flight list and the passenger list are the inputs for this diagram.

  1. First, retrieve the canceled flights which are business knowledge.
  2. Then using the canceled flights, get the passenger list in the canceled flights.
  3. Finally, reassign those passengers to active flights.
Flow diagram for the Flight Reschedule decision

The expressions in the business formula file were used in DRD nodes,

  • Canceled Flights –> Get canceled Flights
  • Determine Passenger Queue –> Get Passenger Queue
Business formula view showing the parameters and associated expression

Natural language file contains separate functions for each step of making the decision “Reassign Passengers”.

For filtering the passengers and assignments in each logic in the natural language file, we used FlexRule built-in functions.
For example, in the image below, you can see that we have used the filter function in Pick the first passenger in the queue, to filter out the passengers

Example of the Natural language logic document

Download the project

Use the attachment at the end of the page to download the sample project.

Updated on January 18, 2024

Article Attachments

Was this article helpful?

Related Articles