Order On Hold Service

Order On Hold Service is part of the warehousing extension. It offers functionality to put orders on hold, meaning no fulfillment actions can be performed on this order until the order is released.

Overview

The Order On Hold Service offers functionality to put orders on hold, meaning all existing consignments that are not shipped or picked up are cancelled. An order with an on hold status can only be released, resourcing is run again, or cancelled. No other fulfillment actions are allowed.

Order On Hold Service API

The service takes an OrderModel which contains a collection of consignments and will put the order in an ON_HOLD status while cancelling all existing consignments attached to the order.

OrderOnHoldService.java:
public interface OrderOnHoldService
{
  /**
   * Puts the provided {@link OrderModel} on hold. Meaning all of its consignments are cancelled as well as the associated
   * task assignment workflows.
   *
   * @param order
   *     the {@link OrderModel} to be put on hold
   */
  void processOrderOnHold(OrderModel order);
}

Items

The following item definitions are associated with the order on hold service:

warehousing-items.xml:
<enumtypes>
   <enumtype code="OrderStatus" generate="true" autocreate="false" dynamic="true">
      <value code="ON_HOLD" />
   </enumtype>
</enumtypes>

Spring Configuration

You can change the default implementation in the Spring configuration.

warehousing-spring.xml:
<!-- Order On Hold Service-->
<alias name="defaultOrderOnHoldService" alias="orderOnHoldService" />
<bean id="defaultOrderOnHoldService" class="de.hybris.platform.warehousing.onhold.service.impl.DefaultOrderOnHoldService">
    <property name="modelService" ref="modelService"/>
    <property name="warehousingNonCancellableConsignmentStatus" ref="warehousingNonCancellableConsignmentStatus"/>
    <property name="warehousingConsignmentWorkflowService" ref="warehousingConsignmentWorkflowService"/>
    <property name="consignmentBusinessProcessService" ref="consignmentBusinessProcessService"/>
    <property name="inventoryEventService" ref="inventoryEventService"/>
</bean>
 
<alias name="defaultInvalidOrderOnHoldStatusList" alias="invalidOrderOnHoldStatusList"/>
<util:list id="defaultInvalidOrderOnHoldStatusList" value-type="de.hybris.platform.core.enums.OrderStatus">
    <value>SUSPENDED</value>
    <value>CANCELLED</value>
    <value>COMPLETED</value>
    <value>ON_HOLD</value>
</util:list>