Fluent Commerce Logo
Docs
Sign In

Order Reference Module

Package

Changed on:

3 Oct 2024

Publisher:Fluent Commerce
Website:Fluent Commerce

Download reference module

Interface contracts

Version History

2024-10-08

Enhancements:

The Order Reference Module has been upgraded with new rules:

  • CreateParcelsForFulfilment: The rule is executed to create articles based on the items packed into parcels.
  • SetFulfilmentItemRejections: The rule is executed to update item quantities and record rejection reasons when items are rejected.
  • SendEventForFulfilmentChoiceOnVerifyingRejections: The rule triggers an event to the fulfillment choice if no items were rejected during the Pack step.
  • SendEventOnVerifyingNoParcels: The rule is executed when no items are packed into parcels and all items are rejected.
  • SendEventOnVerifyingParcelsPartiallyComplete: The rule is executed when both packed items and rejections are present.
  • SendEventOnVerifyingParcelsComplete: The rule triggers an event when items are packed into parcels without rejection.
  • SendEventForOrderOnVerifyingRejections: The rule triggers an event for the order when no items were rejected during the packing process.

The Reference Workflows have been enhanced to support the new "Assigning Items to Parcels" capability.


2024-04-10

1.2.8

  • Fix to address an issue with
    `class java.lang.NoClassDefFoundError:javax/net/SocketFactory`
    when using the rule ResolveOrderCoordinates. The processing would stop with the order stuck at RECEIVED status. OSGI package declarations changed to include
    `javax.net.*,`
    . A similar fix was made to the
    `gson`
    library changing its scope from
    `provided`
    to
    `runtime`
    .
  • Fixed an unexpected behaviour with the Multi and CC workflow. Previously when an order is placed with a
    `pickupLocationRef`
    that is not part of the existing locations or eligible the network, the system would assign the fulfilment to the location regardless. Now, instead no Fulfilment will be created and the Order will be placed in an
    `ESCALATED`
    status. This was achieved by introducing a new ruleset
    `ValidatePickupLocation`
    with two new rules:
    `ForwardIfPickupLocationValid`
    and
    `ForwardIfPickupLocationNotValid`
    to validate whether the
    `pickupLocationRef`
    requested is valid before proceeding to the usual
    `ProcessOrder`
    ruleset. When the pickup location is invalid the order will move to an
    `ESCALATED`
    status.
2023-12-14
  • The rule
    `ForwardIfUnfulfilledItemsExistInFulfilmentChoice`
    is updated. Before, reference workflows could oversell for Mixed Basket orders at a specific location that lacked inventory without utilizing inventory across all eligible locations. Now, all locations with inventory are considered for fulfilling mixed-basket orders. 
  • `SelectProposedFulfilment`
    and
    `SelectProposedFulfilmentForFulfilmentChoice`
    have been updated. These rules now account for unfulfilled items when creating proposed fulfillments. Previously, unfulfilled items would create an empty fulfillment; now, a rejected fulfillment is created instead. This change affects HD and Mixed Basket orders.
  •  Order workflows can now be uploaded without errors even if their description exceeds 300 characters, which was impossible before. 
  • The rule
    `CreateFulfilmentForFulfilmentChoiceForUnfulfillableItems`
    now includes SCHEDULED status in its "acceptedStatus" list in workflow, which previously omitted items already fulfilled.
  • `FulfilmentAwaitingCourierCollection`
    and
    `FulfilmentAwaitingCollection`
    now consider COMPLETE status in the workflow when sending out events.
  • Before, the rule
    `CreateArticlesForFulfilment`
    would limit the number of articles to the number of items in the multi-pack screen. Now, it creates a number of articles that match the quantity sent in the event attribute, supporting the ability to pack as many articles as the picked quantity for a given fulfilment.
  • The article attribute type has been changed from 'java.lang.String' to 'String'.
  • The rule
    `CreateReturnOrderFromOrder`
    has been fixed to avoid hindering workflow updates. Previously, using this rule in a workflow would cause the upload to fail.
  • A new ruleset,
    `ScheduleDemoConsignment`
    has been introduced to schedule the
    `CreateConsignment`
    event after a second has elapsed. Earlier, orders with multiple fulfillments across different locations sometimes did not update the status for articles associated with a consignment. The new rule simulates the creation of the consignment in an external system prior to its arrival in fluent, ensuring the article status is updated.
2023-05-10

v1.1.3

Bug fixes:

  • The workflow description issue is fixed.
  • Error messages for rules 
    `CreateFulfilment`
    `CreateFulfilmentForUnfulfilableItems`
    `CreateFulfilmentForFulfilmentChooice`
     and 
    `CreateFulfilmentForFulfilmentChoiceForUnfulfilableItems`
     are updated.
2023-04-19

Enhancements:

Bug fixes:

2023-03-16

The Order Reference Module extension:

  • Mixed Baskets reference workflow is extended with Multiple Delivery Dates functionality;
  • Mixed Baskets specific methods are added to the Order Module utils;
  • `CreateRevisedOrder`
     issue is fixed.
2023-02-23

The Order Reference Module is extended with Mixed Baskets functionality.

Overview

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.

Detailed Technical Description

Rules

Name

Description

AddFulfilmentTypeAttributeToFulfilment

The rule adds an attribute with name 'FULFILMENTTYPE' to incoming fulfilment with value based on the fulfilment type.

AddFulfilmentTypeAttributeToFulfilmentByFulfilmentChoice

The rule adds an attribute with name 'FulfilmentType' to incoming fulfilment with value based on the fulfilment type.

CalculateLocationsDistances

The rule calculates distances from each location to the order delivery address based on the incoming longitude/latitude.

CancelAllFulfilmentsForOrder

Cancels all related fulfilments that belong to cancel order.

CancelFulfilment

The rule changes the status of the incoming fulfilment to 'CANCELLED' and updates fulfilment item's filled and rejected quantities.

ChangeOrderDeliveryAddress

The rule changes the order delivery address and creates a comment for the order.

ChangeStateForUnfulfilableFulfilment

The rule matches the incoming fulfilment's from address location ref to the system rejected location ref provided in the input parameter.

ChangeStateGQL

The rule changes the state of the incoming entity to the status provided in the input parameter using the generic update status mutation in GraphQL.

ConfirmFulfilmentItems

The rule updates the fulfilment items with the quantity details using the quantity details from the items received in the event attribute.

CopyAttributesFromFulfilmentToArticle

The rule copies all the attributes from the parent fulfilment onto the article entity in the incoming event.

CreateArticlesForFulfilment

The rule creates one or more articles for the fulfilment in the incoming event.

CreateBillingAccount

The rule creates customer’s Billing Account with billing account reference.

CreateCreditMemoForRevisedOrder

The rule creates a CreditMemo for the BillingAccount using the supplied revised order details and the old order as well.

CreateCreditMemoFromAppeasement

The rule creates a CreditMemo for the BillingAccount using the supplied Order details.

CreateDemoConsignment

The rule creates a demo consignment.

CreateFinancialTransaction

The rule processes a payment event and creates a financial transaction.

CreateFulfilment

The rule creates fulfilment based on the incoming proposed fulfilment, excluding fulfilments in specified statuses. If the 

`fulfilmentType`
 parameter is not empty then a fulfilment with this type will be created.

CreateFulfilmentForFulfilmentChoice

The rule creates a fulfilment based on the incoming proposed fulfilment, excluding fulfilments in specified statuses. If the 

`fulfilmentType`
 parameter is not empty then a fulfilment with this type will be created.

CreateFulfilmentForFulfilmentChoiceForUnfulfillableItems

The rule creates a rejected fulfilment for order items that could not be fulfilled (no inventory) based on location. The rule processes only fulfilments which are in accepted statuses and not in rejected statuses. If the 

`fulfilmentType`
 parameter is not empty then a fulfilment with this type will be created.

CreateFulfilmentForUnfulfillableItems

The rule creates a rejected fulfilment for order items that could not be fulfilled. If the 

`fulfilmentType`
 parameter is not empty then a fulfilment with this type will be created.

CreateInvoiceForOrder

The rule creates an Invoice for the order.

CreateParcelsForFulfilment

The rule is executed to create articles based on the items packed into parcels.

CreateReturnOrderFromOrder

This Rule creates a return entity. The return entity is then used to initiate the process of returning order items.

CreateRevisedOrder

The rule creates a revised order based on the revised order attributes passed in the event.

EvaluateFulfilmentsForAddressChange

The rule defines whether the address change is major based on the address fields that have been modified.

FilterLocationsByRadius

The rule finds locations which are outside the radius provided in the event attribute.

ForwardEventByFulfilmentChoiceType

The rule sends event with proper name if fulfilment choice has a definite type.

ForwardEventsWithFulfilmentChoiceReference

The rule sends event to all fulfilment choices with definite reference.

ForwardEventWithDeliveryAddressCoordinates

The rule forwards the input event with coordinates of the order delivery address.

ForwardEventWithDeliveryAddressCoordinatesByType

The rule forwards the event containing the longitude & latitude of the delivery address if fulfilment choice has definite delivery type.

ForwardEventWithPickupLocationCoordinates

The rule forwards the input event with coordinates of the pickup location.

ForwardEventWithPickupLocationCoordinatesByType

The rule forwards the event containing the longitude & latitude of the pickup location if the fulfilment choice has definite delivery type.

ForwardIfDeliveryAddressNotPresent

The rule forwards the input event if the order’s delivery address is not present.

ForwardIfDeliveryAddressPresent

The rule forwards the input event if the order’s delivery address is present.

ForwardIfFulfilmentChoiceCoordinatesNotPresent

The rule forwards the input event if the fulfilment choice delivery address longitude and latitude are invalid.

ForwardIfFulfilmentChoiceCoordinatesPresent

The rule forwards the input event if the fulfilment choice delivery address longitude and latitude are valid.

ForwardIfFulfilmentChoiceDeliveryAddressNotPresent

The rule forwards the input event if the fulfilment choice delivery address is invalid.

ForwardIfFulfilmentChoiceDeliveryAddressPresent

The rule forwards the input event if the fulfilment choice delivery address is present.

ForwardIfMaxSplitLimitNotReached

The rule forwards the input event if the split limit is not reached for the order.

ForwardIfMaxSplitLimitReached

The rule forwards the input event if the split limit is reached for the order, excluding fulfilment with one of the given statuses.

ForwardIfOrderCoordinatesNotPresent

The rule forwards the input event if a proposed fulfilment is not present.

ForwardIfOrderCoordinatesPresent

The rule forwards the input event if a proposed fulfilment is present.

ForwardIfPickupLocationNotValid

The rule sends an event if the pickup location is not part of the network specified or doesn’t match the specified location status. 

ForwardIfPickupLocationValid

The rule sends an event if the pickup location is part of the network specified and matches the specified location status. 

ForwardIfProposedFulfilmentNotPresent

The rule forwards the input event if unfulfilled items exist in the order.

ForwardIfProposedFulfilmentPresent

The rule finds the locations with a required status in network and sends event.

ForwardIfUnfulfilledItemsExist

The rule rejects a fulfilment by updating the rejected quantities of all fulfilment items to the requested quantities.

ForwardIfUnfulfilledItemsExistInFulfilmentChoice

Forwards the event with proper event name if fulfilment statuses are not from the provided list and there are unfulfilled items in the fulfilment choice.

GetLocationsForNetwork

The rule finds the locations with a required status in network and sends event.

RejectFulfilment

The rule rejects a fulfilment by updating the rejected quantities of all fulfilment items to the requested quantities.

ResolveFulfilmentChoiceCoordinates

The rule resolves the longitude and latitude of the fulfilment choice delivery address. It sends specific event depending on whether the coordinates could be resolved or not.

ResolveOrderCoordinates

The rule determines the longitude and latitude of an order based on the delivery address.

ScheduleFulfilmentCreationForDeliverAfter

The rule schedules an event based on the Shipment’s Delivery From date (fulfilment choice’s 

`deliverAfter`
 date).

ScheduleFulfilmentExpiry

This rule sets an expiry time for the incoming fulfilment and schedules a "FulfilmentExpiry" event.

ScheduleFulfilmentExpiryNow

The rule sets an expiry time for the incoming fulfilment based on the location’s Pick&PackTimeLimit and schedules a "FulfilmentExpiry" event.

ScheduleFulfilmentReleaseForDeliverAfter

The rule schedules an event based on the Shipment’s Delivery From date (fulfilment choice’s 

`deliverAfter`
 date).

SearchInventoryAtLocations

his Rule searches inventory based on the incoming event information using virtual catalogue

SearchInventoryAtLocationsForFulfilmentChoice

The rule searches inventory based on the incoming event information using virtual catalogue with virtual catalogue ref, and sends event.

SelectProposedFulfilment

The rule selects a proposed fulfilments based on the inventory found in the incoming event.

SelectProposedFulfilmentForFulfilmentChoice

The rule selects a proposed fulfilment based on the inventory found in the incoming event excluding fulfilments in the specified excluded fulfilments statuses.

SendEventForAllFulfilmentChoices

The rule sends event to all fulfilment choices.

SendEventForAllFulfilments

The rule sends an event for all fulfilments.

SendEventForAppeasementToBillingAccount

This rule sends an event to the billing workflow from an order workflow with a customer's billing account and refund information.

SendEventForArticles

This rule sends an event for the related article.

SendEventForFulfilment

This rule sends an event for the related fulfilment.

SendEventForFulfilmentChoice

The rule sends event to the associated fulfilment choice.

SendEventForFulfilmentChoiceOnVerifyingRejections

This rule triggers an event to the fulfillment choice if no items were rejected during the Pack step.

SendEventForOrder

This rule sends an event for the associated Order.

SendEventForOrderOnVerifyingRejections

The rule triggers an event for the order when no items were rejected during the packing process.

SendEventForRevisedOrderToBillingAccount

This rule sends an event to the billing workflow with billing account and entity information.

SendEventOnVerifyingAllArticleStates

This rule sends a given event to a source entity type on verifying if all articles of it are in correct status.

SendEventOnVerifyingAllArticleStatesByFulfilmentChoice

The rule sends event to the entity from the incoming event if all the articles of the incoming entity are in one of the given statuses.

SendEventOnVerifyingAllFulfilmentChoiceStates

The rule sends event if all fulfilment choices of entityType have statuses from the specified list.

SendEventOnVerifyingAllFulfilmentStates

The rule verifies if all fulfilments for order are in given status.

SendEventOnVerifyingAllFulfilmentStatesByFulfilmentChoice

The rule verifies if all fulfilments for fulfilment choice are in given status. If yes, then it sends an event to the fulfilment choice, else no processing.

SendEventOnVerifyingAllOrderItemsProcessed

This rule sends an event 

`PROP_EVENT_NAME`
 to an Order when for all items in the Order

SendEventOnVerifyingAnyFulfilmentStates

This rule verifies if any fulfilment in the incoming order is in one of the given statuses.

SendEventOnVerifyingAttributeValue

The rule sends an event and verifies if the given attribute value and name of the incoming entity matches the given attribute value and name.

SendEventOnVerifyingConsignment

The rule verifies if the incoming consignment entity has the label URL and the status from input is a success or failure.

SendEventToFulfilmentOnVerifyingFulfilmentChoiceStatus

The rule sends an event to the incoming fulfilment entity if the fulfilment choice is in any of the statuses provided in input parameter.

SendEventOnVerifyingNoParcels

The rule is executed when no items are packed into parcels, and all items are rejected.

SendEventToFulfilmentOnVerifyingOrderStatus

The rule sends an event to the fulfilment if the parent order is in any of the statuses provided by the input data.

SendEventOnVerifyingParcelsComplete

The rule triggers an event when items are packed into parcels without rejection.

SendEventOnVerifyingParcelsPartiallyComplete

The rule is executed when both packed items and rejections are present.

SendEventToUpdateInventoryQuantity

The rule triggers inventory re-calculation event.

SetFulfilmentItemRejections

The rule is executed to update item quantities and record rejection reasons when items are rejected.

UpdateFulfilmentChoiceCoordinates

The rule updates longitude and latitude of the fulfilment choice delivery address based on the incoming event information.

UpdateFulfilmentType

The rule updates fulfilment type field.

UpdateOrderCoordinates

The rule updates the longitude and latitude of the order based on the incoming event information.

UpdateOrderItemAttribute

The rule provides the foundation to update the order Item attribute with the previously identified returnable quantity amount.

UpdateRevisedOrderAttribute

The rule updates original order attribute with link to new revised order ref.

ValidateAppeasementAmount

The rule validates that appeasement amount does not exceed the original total order price.

ValidateOrderDeliveryAddress

The rule verifies the delivery address of the order, sets the address coordinates accordingly and sends out an event.

ValidateReturnQty

The rule provides the foundation to validate that the return request is valid.

ValidateRevisedOrder

The rule validates the revised order request before canceling the existing order.

VerifyBillingAccount

The rule verifies billing account existence, sends event to the billing account workflow, or creates billing account if none found, before the return is initiated.

VerifyingFulfilmentItems

The rule verifies the quantity of items fulfilled in the incoming fulfilment entity and sends the corresponding event when it matches the quantity from the input parameter.

Settings
Workflows

Name

Primary Entity

Description

Click and Collect

Order

This reference workflow supports order orchestration using the Click&Collect delivery method.

Home Delivery

Order

This is reference workflow supports order orchestration using the Home Delivery delivery method.

Mixed Baskets

Order

This is reference workflow supports order orchestration using delivery and pickup delivery methods.

Entities & Statuses

Workflow (Root Entity | Type)

Domain Entity

Category

Status name

ORDER | all (HD, CC, MULTI)

ORDER

BOOKING

CREATED

ORDER | all (HD, CC, MULTI)

ORDER

BOOKING

RECEIVED

ORDER | all (HD, CC, MULTI)

ORDER

BOOKING

BOOKED

ORDER | HD, CC

ORDER

FULFILMENT

PICK_PACK

ORDER | HD

ORDER

DELIVERY

AWAITING_COURIER_COLLECTION

ORDER | all (HD, CC, MULTI)

ORDER

DONE

COMPLETE

ORDER | all (HD, CC, MULTI)

ORDER

DONE

CANCELLED

ORDER | HD, MULTI

ORDER

DONE

ESCALATED

ORDER | all (HD, CC, MULTI)

FULFILMENT

BOOKING

CREATED

ORDER | all (HD, CC, MULTI)

FULFILMENT

BOOKING

PROCESSING

ORDER | all (HD, CC, MULTI)

FULFILMENT

BOOKING

AWAITING_WAVE

ORDER | all (HD, CC, MULTI)

FULFILMENT

FULFILMENT

ASSIGNED

ORDER | all (HD, CC, MULTI)

FULFILMENT

FULFILMENT

READY_FOR_PACK

ORDER | HD, CC

FULFILMENT

FULFILMENT

PICK_PACK

ORDER | all (HD, CC, MULTI)

FULFILMENT

FULFILMENT

FULFILLED

ORDER | all (HD, CC, MULTI)

FULFILMENT

FULFILMENT

PARTIALLY_FULFILLED

ORDER | all (HD, CC, MULTI)

FULFILMENT

DONE

REJECTED

ORDER | HD, MULTI

FULFILMENT

DELIVERY

AWAITING_COURIER_COLLECTION

ORDER | all (HD, CC, MULTI)

FULFILMENT

DONE

ESCALATED

ORDER | all (HD, CC, MULTI)

FULFILMENT

DONE

EXPIRED

ORDER | all (HD, CC, MULTI)

FULFILMENT

DONE

CANCELLED

ORDER | all (HD, CC, MULTI)

FULFILMENT

DONE

COMPLETE

ORDER | all (HD, CC, MULTI)

ARTICLE

FULFILMENT

CREATED

ORDER | all (HD, CC, MULTI)

ARTICLE

DELIVERY

PENDING_CONSIGNMENT

ORDER | all (HD, CC, MULTI)

ARTICLE

DELIVERY

COURIER_COLLECTION

ORDER | all (HD, CC, MULTI)

ARTICLE

DONE

COLLECTED

ORDER | all (HD, CC, MULTI)

ARTICLE

DONE

CANCELLED

ORDER | all (HD, CC, MULTI)

CONSIGNMENT

DELIVERY

CREATED

ORDER | all (HD, CC, MULTI)

CONSIGNMENT

DELIVERY

PROCESSING

ORDER | all (HD, CC, MULTI)

CONSIGNMENT

DELIVERY

ACTIVE_LODGED

ORDER | all (HD, CC, MULTI)

CONSIGNMENT

DONE

DELIVERED

ORDER | all (HD, CC, MULTI)

ORDER

RETURN

RETURN_CREATED

ORDER | all (HD, CC, MULTI)

ORDER

RETURN

RETURN_COMPLETE

ORDER | CC

ORDER

DELIVERY

AWAITING_CUSTOMER_COLLECTION

ORDER | CC, MULTI

FULFILMENT

DELIVERY

AWAITING_CUSTOMER_COLLECTION

ORDER | CC, MULTI

ARTICLE

DELIVERY

AWAITING_ARRIVAL

ORDER | CC, MULTI

ARTICLE

DELIVERY

AWAITING_COLLECTION

ORDER | CC

ARTICLE

DONE

UNCOLLECTED

ORDER | MULTI

ORDER

FULFILMENT

PROCESSING

ORDER | MULTI

FULFILMENT_CHOICE

BOOKING

CREATED

ORDER | MULTI

FULFILMENT_CHOICE

BOOKING

RECEIVED

ORDER | MULTI

FULFILMENT_CHOICE

BOOKING

BOOKED

ORDER | MULTI

FULFILMENT_CHOICE

FULFILMENT

PICK_PACK

ORDER | MULTI

FULFILMENT_CHOICE

DELIVERY

AWAITING_COURIER_COLLECTION

ORDER | MULTI

FULFILMENT_CHOICE

DELIVERY

AWAITING_CUSTOMER_COLLECTION

ORDER | MULTI

FULFILMENT_CHOICE

DONE

CANCELLED

ORDER | MULTI

FULFILMENT_CHOICE

DONE

ESCALATED

ORDER | MULTI

FULFILMENT_CHOICE

DONE

COMPLETE

ORDER | MULTI

FULFILMENT

BOOKING

SCHEDULED

BILLING_ACCOUNT | DEFAULT

BILLING_ACCOUNT

BOOKING

CREATED

BILLING_ACCOUNT | DEFAULT

BILLING_ACCOUNT

BOOKING

ACTIVE

BILLING_ACCOUNT | DEFAULT

CREDIT_MEMO

BOOKING

CREATED

BILLING_ACCOUNT | DEFAULT

CREDIT_MEMO

BOOKING

PENDING_REFUND

BILLING_ACCOUNT | DEFAULT

CREDIT_MEMO

BOOKING

REFUND_COMPLETE

BILLING_ACCOUNT | DEFAULT

CREDIT_MEMO

BOOKING

REFUND_FAILED

No alt text provided
Capability type:Module