Getting Started with Reference Sourcing Criteria
Author:
Kirill Gaiduk
Changed on:
26 Sept 2025
Key Points
- Understand the Ranking Mechanism: Sourcing Criteria score (or exclude) candidate Locations to drive ranking and tie-breaking
- Sequence Matters: Criteria are evaluated top-to-bottom; the first Criterion decides the primary order, the next acts as a tie-breaker
- Normalize Ratings: Most Criteria return raw numeric ratings that the framework normalizes across Locations to ensure consistent comparisons
- Use Exclusion Carefully: Some Criteria return a negative score (-1) to exclude Locations; apply these early in the stack for predictable outcomes
- Know When to Extend: The reference library covers common distance, inventory availability, and priority logic; develop a custom Criterion for domain-specific logic

Prerequisites
Steps
Core Concept
A Sourcing Criterion is a configurable function that evaluates a candidate Location in context of the Sourcing Request and returns a rating:
- A positive float (0…1) ranks how suitable a Location is
- -1 filters a Location out of consideration
- Criteria are applied in sequence to produce a final ranked list of eligible Locations
During Strategy evaluation, the framework instantiates the Criterion class defined by `type`
(for example, `fc.sourcing.criterion.locationDistance`
) and applies its `apply()`
method to every candidate Location.
Internal Mechanics
Reference Criteria share common behavior through `BaseSourcingCriterion`
and Criterion Utilities:
- Apply → Execute → Normalize:
`apply()`
calls pre-logic, executes business rules, and post-logic`normalize()`
adjusts raw scores to a [0–1] range where applicable
- Sequential Stack:
- Criteria are applied in order of appearance
- The first Criterion usually defines the main ranking dimension (e.g., distance or inventory availability)
- Later Criteria resolve ties
- Parameter Parsing:
`parseParams()`
reads JSON params defined in the`fc.rubix.order.sourcing.criteria`
Setting- Helper Utilities (
`getFloats`
,`getStrings`
,`getDistanceUnits`
) ensure correct types and default handling
Reference Sourcing Criterion Functions
Class (Criterion Utilities) | Type (Sourcing Criteria Schema) | Description (UI) | Notes |
|
| Prioritises locations that are geographically closer to the delivery address |
|
|
| Ranks locations by distance bands {{value}}, prioritising bands that are closer |
|
|
| Excludes locations that are farther than {{value}}{{value}} | Excludes (-1) Locations beyond a specified maximum distance threshold (in km or miles) |
|
| Prioritises locations with the highest available daily fulfillment capacity | Rates Locations based on their |
|
| Prioritises locations by the specified network ranking {{value}} |
Example:
|
|
| Prioritises locations based on total units of inventory requested in the order that can be fulfilled |
Example:
Note: A Location with surplus Inventory that does not fulfill the entire Sourcing Request may still receive a higher score than a Location that fully satisfies the Request. However, the framework prioritizes the Fulfillment Plan with the fewest Fulfillments overall |
|
| Ranks locations by fulfillment percentage bands {{value}}, prioritising bands with higher availability |
|
|
| Excludes locations where inventory availability for a given order, is less than {{value}}% | Excludes (-1) Locations that do not meet the configured minimum fulfillment threshold (in %) |
|
| Excludes locations of type {{value}} | Excludes (-1) Locations whose type matches a configured value(s) (e.g., store vs. warehouse) |
|
| Excludes locations that are members of one of the following networks {{value}} |
|
|
| Prioritises locations that fulfill a higher monetary portion of the order |
Example:
Note: Unlike |
Default Sourcing Criteria
Class | Type | Notes |
|
| Automatically excludes Locations that previously rejected Items in the same Sourcing Request (applied by default, not shown in UI) |
Parameter Definitions
Sourcing Criteria rely on parameters defined in the `fc.rubix.order.sourcing.criteria`
Setting to ensure valid configuration:
`value`
: Numeric thresholds or band breakpoints. An input like [10, 25, 50] defines 4 bands:- (–∞ … 10]
- (10 … 25]
- (25 … 50]
- (50 … +∞)
`valueUnit`
: Selects unit of measure where applicable (kilometres, miles)`component`
: UI input type such as`fc.field.multistring`
,`integer`
, or`select`
`mandatory`
/`exactSearch`
: Validation flags controlling whether the field must be provided and if exact match applies
Correct parameter definition guarantees consistent evaluation in both UI and runtime.
Configuration in the UI
The reference schema in `fc.rubix.order.sourcing.criteria`
Setting defines templates for all reference Sourcing Criteria. Each template specifies the required UI components and their validation rules to ensure that Criteria parameters are entered consistently and correctly.
For account/retailer-specific adjustments, override Criteria in `fc.rubix.order.sourcing.criteria.custom`
. When a Criterion with the same `name`
exists in both schemas, the custom schema takes precedence, allowing organizations to tailor global definitions to their own business needs without breaking the baseline.
Attaching Criteria to Strategies
Sourcing Criteria are added to Primary or Fallback Sourcing Strategies via the Sourcing Profile GraphQL API, similar to Conditions.
Best Practices
- Order Criteria deliberately: put Exclusion Criteria first, then your primary ranking Criterion, then tie-breakers
- Provide exact values and enforce strict types via schema-driven components (e.g., units in select, numeric bands)
- Test boundary and edge cases thoroughly
- Apply overrides in
`fc.rubix.order.sourcing.criteria.custom`
when tailoring Criteria for specific Accounts / Retailers