CreatePartialFulfilmentWithSourcingProfile
Changed on:
29 Sept 2025
Overview
Create Partial Fulfillment(s) using the specified Sourcing Profile.
Plugin Name | Order Reference Module |
---|---|
Namespace | [[account.id]].order |
The Order Reference Module is the foundation for order-related implementations. It provides reference workflows for click & collect, home delivery and mixed baskets and those needed to build your own. Extensible by design, use this Module as a base to build a solution to your customers' needs.
UI Description
Apply the Sourcing Profile identified by {sourcingProfileRef} to a Sourcing Request (Order, Fulfillment Option, etc.) and produce Partial Fulfillment(s).
Accepts
- ORDER
- FULFILMENT_CHOICE
Actions
- This Rule produces a MutateAction
Rule parameters
Name | Type | Description |
|
| Reference to the Sourcing Profile to apply. |
Event attributes
This Rule does not expect any Event attributes.
Exceptions
- This Rule throws a
`PropertyNotFoundException`
when the Rule parameter(s) is not provided.
- This Rule throws an
`IllegalArgumentException`
if Sourcing Conditions or Criteria are improperly configured
Configuration example
1{
2 "name": "[[account.id]].order.CreatePartialFulfilmentWithSourcingProfile",
3 "props": {
4 "sourcingProfileRef": "GLOBAL_DEFAULT"
5 }
6}
Detailed Technical Description
This Rule executes the following steps:
- Validate the
`sourcingProfileRef`
parameter. - Load the Sourcing Profile using the provided reference (
`SourcingUtils.loadSourcingProfile`
). - Verify that the Sourcing Profile contains at least one Fallback Sourcing Strategy.
- Load the Sourcing Context and identify Unfulfilled Items (
`SourcingContextUtils.loadSourcingContext`
). - Execute the first applicable Fallback Sourcing Strategy in
`priority`
order: (`SourcingUtils.findPlanBasedOnFallbackStrategies`
):- Confirm that the Strategy
`status`
is`ACTIVE`
- Evaluate the Sourcing Conditions against the current Sourcing Request (skip the Strategy if its Conditions are not met)
- Load the relevant Locations and Positions (
`SourcingUtils.loadPositions`
) - Attempt to find possible Fulfillment(s) using the loaded Locations, sorted by the Sourcing Criteria ratings (
`SourcingUtils.findHighestValuePartialFulfilment`
), while:- Unfulfilled Items remain
- The Maximum Split has not been reached
- Confirm that the Strategy
- Set the fulfillment type for each Fulfillment based on Fulfillment Choice and Location (
`OrderUtils.fillFulfilmentType`
). - Create the Fulfillment(s) (
`SourcingUtils.createFulfilments`
).