Fluent Commerce Logo
Docs

Create Custom Sourcing Condition

How-to Guide

Authors:

Kirill Gaiduk, Alexey Kaminskiy

Changed on:

16 Apr 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

Start with your own custom module setup.1. Create a custom module.2. Include Sourcing Utilities in your plugin dependencies.Your plugin must have access to its own copy of `util-sourcing` at runtime so it can initialize its own local sourcing registries.You can include it in your project by:
  • Adding it as a dependency in your `pom.xml`
3. Optionally, download the Sourcing Utilities Java source package to review reference implementations.

Step arrow right iconImplement a Custom Sourcing Condition Function

Create a class in your custom plugin that implements the `SourcingCondition` interface:1. Create your class, for example: `CustomSourcingCondition`.2. Implement the `SourcingCondition` interface.3. Add your business logic inside `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.