Fluent Commerce Logo
Docs

Create Custom Sourcing Condition

How-to Guide

Authors:

Kirill Gaiduk, Alexey Kaminskiy

Changed on:

3 Mar 2026

Key Points

  • Outcome: After completing this guide, you will know how to extend the Responsive Sourcing Framework with a Custom Condition and apply it in real Strategies
  • Minimal essentials: The process has four parts - implement the Condition, register it, expose it in the Setting, and verify behavior
  • Application: You will be able to influence sourcing decisions with your own logic, tailored to specific business contexts

Steps

Step arrow right iconPreliminary Setup

Custom Sourcing Condition 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.

Step arrow right iconImplement a Custom Sourcing Condition Function

Create a Condition class that enforces your business logic:
  • Create your class, e.g., `MySourcingCondition`, implementing the `SourcingCondition` interface.
  • Add your evaluation logic in `evaluateWithContext` method.

Step arrow right iconIntroduce Custom Sourcing Rules

Introduce custom versions of the Sourcing Rules that will execute your sourcing logic inside your plugin.1. Copy the reference Sourcing Rule implementation:2. Rename the class3. Register your custom Sourcing Condition or Criterion inside the Rule class4. Replace the reference Rule in your Workflow configuration with your custom Rule

Step arrow right iconExpose the Condition Schema via Setting

Create (or update the existing) the Setting `fc.rubix.order.sourcing.conditions.custom` with your new Condition schema.

Step arrow right iconVerify the Condition Behavior

  • Use the Sourcing Profile GraphQL API to add the new Condition to a Sourcing Strategy. 
  • Test against different Sourcing Requests and confirm the expected outcomes.
Kirill Gaiduk

Kirill Gaiduk

Contributors:
Alexey Kaminskiy