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__cflag andServiceSort__cfield 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
- Navigate to Priority Schemes in Kaptio and click New
- Select the Defaulting record type
- Enter a descriptive Name (e.g., “Default to Preferred Hotels”)
- 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
- Navigate to Priority Schemes in Kaptio and click New
- Select the Filtering record type
- Enter a descriptive Name (e.g., “Filter out Sold-Out, Closed or NA”)
- 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:
| Property | Description |
|---|---|
| entity | The related object to evaluate (e.g., Inventory) |
| field | The field on that entity to check (e.g., Status) |
| operator | The comparison operator (!=, =) |
| value | The 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
- Navigate to Priority Schemes in Kaptio and click New
- Select the Sorting record type
- Enter a descriptive Name (e.g., “Distribute by Available Units”)
- 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:
| Field | API Name | Description |
|---|---|---|
| Component | Component__c | The component this default applies to (required) |
| Default Service | DefaultService__c | A specific service to use as default (optional — lookup to Item__c) |
| Service Level | ServiceLevel__c | Scope the default to a specific service level (optional) |
| Package Context | Context__c | Parent component option when the component is inside a bundle — defaults on the outer package override defaults on a bundle’s inner component (optional) |
| Filtering Scheme | FilteringScheme__c | The Filtering Scheme to apply (optional — lookup to Scheme__c) |
| Sorting Scheme | SortingScheme__c | The 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:
- Filter — If a Filtering Scheme is assigned, options that fail the filter conditions are removed from consideration
- Sort — If a Sorting Scheme is assigned, remaining eligible options are sorted by the scheme’s rules (e.g., by available units)
- Select — The top option in the sorted list is selected as the default
This sequence runs as part of the standard defaulting priority:
IsDefault__cflag on a component option- Lowest
ServiceSort__cvalue - Priority Scheme rules (filter → sort → select)
- 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__candChannel__c.SortingScheme__c). Channel-level schemes apply across all components unless overridden by a component-level scheme viaComponentDefault__c.
Related Schema
| Object | API Name | Purpose |
|---|---|---|
| Priority Scheme | KaptioTravel__Scheme__c | The scheme record containing Condition JSON and a record type (Defaulting, Filtering, or Sorting) |
| Component Default | KaptioTravel__ComponentDefault__c | Links a component to its Priority Schemes, default service, and service level scope |
| Component | KaptioTravel__Component__c | The package component that the scheme is applied to |
| Component Option | KaptioTravel__ComponentOption__c | The options evaluated by the scheme during selection |
See Also
- Package Configuration — Complete Guide — Full package setup reference including the Advanced Defaulting overview
- Package Configuration Fundamentals — Overview of sort order and defaulting logic
- Inventory Operations — Inventory status management and allotment configuration