Fluent Commerce Logo
Docs

CreateRejectedFulfilment

Rule

Changed on:

29 Sept 2025

Overview

Create a System Rejected Fulfillment for Unfulfilled Items that can not be fulfilled.

Plugin NameOrder 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

Create a System Rejected Fulfillment for Items that can not be fulfilled. The specified {systemRejectedLocationRef} Location is used to "store" the System Rejected Items.

Accepts

  • ORDER
  • FULFILMENT_CHOICE

Actions

Rule parameters

Name

Type

Description

`systemRejectedLocationRef`

`String`

Reference to the Location where the System Rejected Fulfillment will be created.

Event attributes

This Rule does not expect any Event attributes.

Exceptions

  • This Rule throws a `PropertyNotFoundException` when the Rule parameter(s) is not provided.

Configuration example

1{
2  "name": "[[account.id]].order.CreateRejectedFulfilment",
3  "props": {
4    "systemRejectedLocationRef": "RJT_[[retailer.id]]"
5  }
6}

Detailed Technical Description

This Rule executes the following steps:

  • Validate the `systemRejectedLocationRef` parameter.
  • Load the Sourcing Context and identify Unfulfilled Items (`SourcingContextUtils.loadSourcingContext`).
  • Build the System Rejected Fulfillment (`SourcingUtils.buildRejectedFulfilment`), which performs the following actions:
    • Return `null` if there are no Unfulfilled Items
    • Collect all existing Fulfillments from the Sourcing Context
    • Load the System Rejected Location using the `systemRejectedLocationRef` parameter
    • Calculate the quantities of Unfulfilled Items
    • Build the System Rejected Fulfillment for all remaining Unfulfilled Items
  • Verify that the resulting System Rejected Fulfillment has been generated.
  • Set the fulfillment type for the System Rejected Fulfillment based on Fulfillment Choice and Location (`OrderUtils.fillFulfilmentType`).
  • Create the System Rejected Fulfillment (`SourcingUtils.createFulfilments`).

Version History

2025-09-29

v25.9.29

Initial release