1. Home
  2. Sample Projects
  3. Flight Reschedule

Flight Reschedule

◷ Reading Time: 4 minutes

In this 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.

2. Click on Logic Run Template.

3. Click on one of the given templates.

4. Click Debug.

5. Click Next Step to go step by step.

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

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

Boxed Expression

  • BoxedExpressions.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.

The expressions in the boxed expression file were used in DRD nodes,

  • Canceled Flights –> Get canceled Flights
  • Determine Passenger Queue –> Get Passenger Queue

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

Download the project

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

Updated on November 26, 2021

Article Attachments

Was this article helpful?

Related Articles