Priority Schemes

To be Reviewed

How to create and assign Defaulting, Filtering, and Sorting Schemes to Package Components — controlling option selection order, inventory filtering, and even booking distribution.

Version 8 min read | March 26, 2026 Gallery

Priority Schemes

Priority Schemes (Scheme__c) control how component options are selected, filtered, and sorted when a package is added to a booking. They provide advanced defaulting logic beyond the simple IsDefault__c checkbox and ServiceSort__c field on component options.

There are three types of Priority Scheme, each identified by its record type:

  • Defaulting Scheme — controls which component option is automatically selected
  • Filtering Scheme — removes options from consideration based on inventory status
  • Sorting Scheme — orders eligible options to distribute bookings evenly across available units

When to use Priority Schemes

For most packages, the IsDefault__c flag and ServiceSort__c field on component options are sufficient. Priority Schemes are intended for operators who need to dynamically filter out unavailable options or spread bookings evenly across multiple service providers — common in group touring where the same accommodation component has many interchangeable hotel options.


Defaulting Schemes

A Defaulting Scheme controls which component option is automatically selected when a package is added to a booking. It uses conditions defined in the ConditionJSON__c field to evaluate component options and determine the preferred selection order.

Creating a Defaulting Scheme

  1. Navigate to Priority Schemes in Kaptio and click New
  2. Select the Defaulting record type
  3. Enter a descriptive Name (e.g., “Default to Preferred Hotels”)
  4. Configure the Condition JSON field with your defaulting rules

The Condition JSON defines how options are evaluated and ranked. The structure follows the standard Priority Scheme JSON format with conditions that reference fields on the component option or its related service.

When to Use

Use a Defaulting Scheme when the standard defaulting priority (Default flag → Service Sort → undefined) is not sufficient — for example, when default selection should vary by date range, service level, or availability criteria that cannot be expressed through static field values alone.


Filtering Schemes

A Filtering Scheme removes component options from consideration before the system selects a default. This is used to ignore options that have certain inventory statuses — for example, skipping options that are Sold Out, Closed, or Not Available.

Creating a Filtering Scheme

  1. Navigate to Priority Schemes in Kaptio and click New
  2. Select the Filtering record type
  3. Enter a descriptive Name (e.g., “Filter out Sold-Out, Closed or NA”)
  4. Configure the Condition JSON field with your filter conditions

Example: Filter by Inventory Status

A common Filtering Scheme removes options with Sold Out, Closed, or Not Available inventory status:

{
  "filterConditions": [
    {
      "entity": "Inventory",
      "field": "Status",
      "operator": "!=",
      "value": "Sold Out"
    },
    {
      "entity": "Inventory",
      "field": "Status",
      "operator": "!=",
      "value": "Closed"
    },
    {
      "entity": "Inventory",
      "field": "Status",
      "operator": "!=",
      "value": "Not Available"
    }
  ]
}

Each condition specifies:

PropertyDescription
entityThe related object to evaluate (e.g., Inventory)
fieldThe field on that entity to check (e.g., Status)
operatorThe comparison operator (!=, =)
valueThe value to compare against (e.g., Sold Out, Closed, Not Available)

All conditions must be satisfied for an option to remain eligible — options that fail any condition are filtered out.

When to Use

Use a Filtering Scheme when you want the system to automatically skip options that are unavailable, rather than falling through to them during defaulting. Without a Filtering Scheme, the system may attempt to default to an option that has an undesirable inventory status.


Sorting Schemes

A Sorting Scheme controls the order in which eligible component options are considered for selection. The primary use case is distributing bookings evenly across available options based on remaining inventory units, so that one option does not fill up while others sit empty.

Creating a Sorting Scheme

  1. Navigate to Priority Schemes in Kaptio and click New
  2. Select the Sorting record type
  3. Enter a descriptive Name (e.g., “Distribute by Available Units”)
  4. Configure the Condition JSON field with your sorting rules

How Sorting Distributes Bookings

When a Sorting Scheme is assigned, the system evaluates remaining availability on each eligible option and selects the one with the most available units. Over time, this creates an even distribution of bookings across all options — preventing a single hotel or service from filling up while alternatives remain empty.

When to Use

This is particularly valuable for group tour operators who contract allotments at multiple hotels for the same destination. Without a Sorting Scheme, the system would consistently pick the same option (based on the Default flag or Service Sort), leading to uneven utilisation across contracted services.


Assigning Schemes to a Package Component

Priority Schemes are assigned to components through the ComponentDefault__c (Component Default) object. This object links a component to its Filtering and/or Sorting Scheme, and optionally specifies a default service and service level scope.

Creating a Component Default Record

Create a new Component Default record with the following fields:

FieldAPI NameDescription
ComponentComponent__cThe component this default applies to (required)
Default ServiceDefaultService__cA specific service to use as default (optional — lookup to Item__c)
Service LevelServiceLevel__cScope the default to a specific service level (optional)
Package ContextContext__cParent component option when the component is inside a bundle — defaults on the outer package override defaults on a bundle’s inner component (optional)
Filtering SchemeFilteringScheme__cThe Filtering Scheme to apply (optional — lookup to Scheme__c)
Sorting SchemeSortingScheme__cThe Sorting Scheme to apply (optional — lookup to Scheme__c)

How Schemes Work Together

When the system needs to select a default option for a component that has a Component Default record, it follows this sequence:

  1. Filter — If a Filtering Scheme is assigned, options that fail the filter conditions are removed from consideration
  2. Sort — If a Sorting Scheme is assigned, remaining eligible options are sorted by the scheme’s rules (e.g., by available units)
  3. Select — The top option in the sorted list is selected as the default

This sequence runs as part of the standard defaulting priority:

  1. IsDefault__c flag on a component option
  2. Lowest ServiceSort__c value
  3. Priority Scheme rules (filter → sort → select)
  4. Undefined — if none of the above apply

Channel-Level Schemes

Filtering and Sorting Schemes can also be assigned at the Channel level (Channel__c.FilteringScheme__c and Channel__c.SortingScheme__c). Channel-level schemes apply across all components unless overridden by a component-level scheme via ComponentDefault__c.


ObjectAPI NamePurpose
Priority SchemeKaptioTravel__Scheme__cThe scheme record containing Condition JSON and a record type (Defaulting, Filtering, or Sorting)
Component DefaultKaptioTravel__ComponentDefault__cLinks a component to its Priority Schemes, default service, and service level scope
ComponentKaptioTravel__Component__cThe package component that the scheme is applied to
Component OptionKaptioTravel__ComponentOption__cThe options evaluated by the scheme during selection

See Also

Back to Gallery