Author:
Kirill Gaiduk
Changed on:
25 Sept 2025
This article introduces Sourcing Criteria as the ranking (and exclusion) functions that score candidate Locations during Strategy evaluation. You’ll learn how Criteria order affects final rankings, which reference Criteria are available, and how to extend the library with custom implementations.
Author:
Kirill Gaiduk
Changed on:
2 Oct 2025
Sourcing Criteria determine which eligible Locations are best once a Strategy applies. You’ll learn how to configure, sequence, and extend Criteria so your prioritization is predictable and explainable across business scenarios.
A Sourcing Criterion is a function that returns a numeric rating for a Location (or excludes it by returning -1). Criteria are evaluated only after a Strategy passes its Conditions. Typical examples:
`locationDistance`
, `locationDistanceBanded`
, `locationDistanceExclusion`
`inventoryAvailability`
, `inventoryAvailabilityBanded`
, `inventoryAvailabilityExclusion`
`networkPriority`
, `locationTypeExclusion`
, `locationNetworkExclusion`
`locationDailyCapacity`
Sourcing Criteria are part of the Responsive Sourcing Framework within the Fluent platform. They sit in several places within the platform, each serving a distinct role:
Sourcing Criterion Entity is represented by the `SourcingCriterion`
GraphQL type.
It refers to an individual, concrete instance of a Sourcing Criterion that is configured as part of a Sourcing Strategy.
Field | Type | Description | Notes |
|
| Name of the Sourcing Criterion | The Reference Sourcing Criteria schema (specified in the |
|
| Type of the Sourcing Criterion | The |
|
| Parameters of the Sourcing Criterion | The Parameters configure Sourcing Criteria to support specific customer sourcing logic Available configuration options are defined with the |
The Sourcing Criteria schema is located in the dedicated Setting(s):
`fc.rubix.order.sourcing.criteria`
stores reference (`GLOBAL`
) Sourcing Criteria schema`fc.rubix.order.sourcing.criteria.custom`
can be created for customer-specific (`ACCOUNT`
/ `RETAILER`
) Sourcing Criteria schemaIt defines the structure of a Criterion and specifies which parameters it can include. In practice, it acts as the template for a Sourcing Criterion that is added to the Criteria library, making it available for configuration and use by end users.
Criterion Utilities are an integral part of the Sourcing Utilities bundle.
They include:
`BaseSourcingCriterion`
`LocationDistanceCriterion`
– calculates distance between destination and Location`InventoryAvailabilityCriterion`
– evaluates available stock coverage`NetworkPriorityCriterion`
– prioritizes Locations based on Network membership`normalize()`
to adjust rating scales (e.g., smaller distance = higher score)`@SourcingCriterionInfo`
- defines metadata such as `name`
, `type`
, `tags`
, and `label`
`@SourcingCriterionParam`
- specifies configurable parameters, UI component type, and options`SourcingCriteriaUtils`
)`CriteriaArray`
- stacks multiple Criteria for sequential evaluation and tie-breaking`normalize()`
- scales ratings across all candidate Locations into a [0..1] range`getFloats`
, `getStrings`
, `getDistanceUnits`
) - parse parameter values from JSON configs`getCriteria(...)`
- merges default and Strategy-specific Criteria into a single evaluation stack`SourcingCriteriaTypeRegistry`
)Within the Responsive Sourcing Framework, Sourcing Criteria provide the ability to:
Author:
Kirill Gaiduk
Changed on:
26 Sept 2025
A Sourcing Criterion is a configurable function that evaluates a candidate Location in context of the Sourcing Request and returns a rating:
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.
Reference Criteria share common behavior through `BaseSourcingCriterion`
and Criterion Utilities:
`apply()`
calls pre-logic, executes business rules, and post-logic`normalize()`
adjusts raw scores to a [0–1] range where applicable`parseParams()`
reads JSON params defined in the `fc.rubix.order.sourcing.criteria`
Setting`getFloats`
, `getStrings`
, `getDistanceUnits`
) ensure correct types and default handlingClass (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 |
Class | Type | Notes |
|
| Automatically excludes Locations that previously rejected Items in the same Sourcing Request (applied by default, not shown in UI) |
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:`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 appliesCorrect parameter definition guarantees consistent evaluation in both UI and runtime.
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.
Sourcing Criteria are added to Primary or Fallback Sourcing Strategies via the Sourcing Profile GraphQL API, similar to Conditions.
`fc.rubix.order.sourcing.criteria.custom`
when tailoring Criteria for specific Accounts / RetailersAuthor:
Kirill Gaiduk
Changed on:
26 Sept 2025
Custom Sourcing Criterion creation requires modifying the Sourcing Utilities bundle:
1. Prepare your module that contains Order Reference Module assets.
2. Download the Sourcing Utilities Package (Java source code).
3. Add Sourcing Utilities as a dependency in your project's ``pom.xml``
file.
Create a class that enforces your ranking (exclusion) logic:
`SourcingCriterion`
(or extend `BaseSourcingCriterion`
)`execute(CriterionContext ctx)`
(when extending `BaseSourcingCriterion`
)`parseParams(JsonNode params)`
if needed`normalize(min, max, rating)`
when your metric’s “lower is better” (e.g., distance)1@SourcingCriterionInfo(
2 name = "mySourcingCriterion",
3 type = "company.sourcing.criterion.my",
4 tags = { "ATS-agnostic" } // or "ATS-dependent", "Exclusion"
5)
6public class MySourcingCriterion extends BaseSourcingCriterion {
7
8 @SourcingCriterionParam(name = "value", component = "integer")
9 private Integer threshold;
10
11 @Override
12 public void parseParams(final JsonNode params) {
13 // parse threshold, lists, units, etc.
14 }
15
16 @Override
17 protected float execute(final SourcingCriteriaUtils.CriterionContext ctx) {
18 // Return:
19 // -1f to exclude a location,
20 // 0..1f (or any float) to score/rank a location.
21 return 0.75f;
22 }
23
24 // Override normalize(...) only if the default doesn’t fit your scale
25}
Register a unique `type`
with `SourcingCriteriaTypeRegistry`
.
1static { SourcingCriteriaTypeRegistry.register("company.sourcing.criterion.my", new MySourcingCriterion());}
Create (or update the existing) the Setting `fc.rubix.order.sourcing.criteria.custom`
with your new Criterion schema, similar to Conditions.
Sourcing Criteria support annotation-driven generation of the Setting JSON.
`SourcingCriteriaTypeRegistry`
.`@SourcingCriterionInfo`
+ `@SourcingCriterionParam`
annotations`java -jar <path>util-sourcing-<version>-sources.jar`
`fc.rubix.order.sourcing.criteria.custom`
Setting`params`
- regenerate to keep UI configs in sync