Warehousing Shipping Service
The following describes the Warehousing Shipping Service in Order Management.
Warehousing Shipping Service is part of the warehousing extension. It offers functionality to perform the confirmation of consignment shipment or pickup.
Overview
The Warehousing Shipping Service calls the Warehousing Consignment Workflow Service to orchestrate the lifecycle of consignments. It is also now a common entry point for web calls done through the REST layer of Order Management as well as performing actions within the Backoffice application.
The warehousing shipping service creates consignment entry events indicating that some quantities have been shipped. It can also verify whether a shipment or a pickup is possible for the given consignment. The service can use the business process to attempt to actually perform the shipping/pickup confirmation. If the process is not in a state that is ready to accept the confirmation, then the shipping/pickup confirmation will fail, otherwise it will be successful.
Example - Fully Allocated Order
Consider a customer has placed the following order.
| Order Entry Number | Product | Quantity Allocated | Quantity Cancelled | Quantity Shipped |
|---|---|---|---|---|
| 1 | Wireless Mouse | 1 | 0 | 0 |
| 2 | Rechargeable Batteries | 3 | 0 | 0 |
| 3 | Battery Charger | 5 | 0 | 0 |
The consignment after allocation and before cancellation and/or decline.
| Consignment Entry Number | Product | Quantity Pending | Quantity Declined | Quantity Shipped |
|---|---|---|---|---|
| 1 | Wireless Mouse | 1 | 0 | 0 |
| 2 | Rechargeable Batteries | 3 | 0 | 0 |
| 3 | Battery Charger | 5 | 0 | 0 |
Then, the consumer decides to cancel 1 Rechargeable Battery.
Also, some items became out-of-stock and the warehousing worker decides to decline 1 Rechargeable Battery and 2 Battery Charger. After this point there will be a new consignment created with the newly declined entries
The original consignment after cancellation and/or decline.
| Consignment Entry Number | Product | Quantity Pending | Quantity Declined | Quantity Shipped |
|---|---|---|---|---|
| 1 | Wireless Mouse | 1 | 0 | 0 |
| 2 | Rechargeable Batteries | 1 | 1 | 0 |
| 3 | Battery Charger | 3 | 2 | 0 |
The new consignment after decline.
| Consignment Entry Number | Product | Quantity Pending | Quantity Declined | Quantity Shipped |
|---|---|---|---|---|
| 1 | Wireless Mouse | 1 | 0 | 0 |
| 2 | Rechargeable Batteries | 2 | 0 | 0 |
The original consignment after shipping confirmation.
| Consignment Entry Number | Product | Quantity Pending | Quantity Cancelled | Quantity Shipped |
|---|---|---|---|---|
| 1 | Wireless Mouse | 0 | 0 | 1 |
| 2 | Rechargeable Batteries | 0 | 1 | 1 |
| 3 | Battery Charger | 0 | 2 | 3 |
The order after shipping confirmation.
| Order Entry Number | Product | Quantity Allocated | Quantity Cancelled | Quantity Shipped |
|---|---|---|---|---|
| 1 | Wireless Mouse | 1 | 0 | 1 |
| 2 | Rechargeable Batteries | 3 | 1 | 1 |
| 3 | Battery Charger | 5 | 0 | 3 |
Warehousing Shipping Service API
The service will take a ConsignmentModel which contains a collection of consignment entries and attempt to confirm the shipment or pickup for the items requested.
WarehousingShippingService.java:
public interface WarehousingShippingService
{
/**
* Checks if the confirm ship/pickup is possible for the given {@link ConsignmentModel}
* @param consignment
* the {@link ConsignmentModel} to be confirmed
* @return boolean to indicate if confirmation of the given consignment is possible
*/
boolean isConsignmentConfirmable(ConsignmentModel consignment);
/**
* Confirms the shipping of {@link ConsignmentModel}
* @param consignment
* the {@link ConsignmentModel} to be confirmed
* @throws BusinessProcessException
* when associated process cannot move to the confirmation state
*/
void confirmShipConsignment(ConsignmentModel consignment) throws BusinessProcessException;
/**
* Confirms the pickup of {@link ConsignmentModel}
* @param consignment
* the {@link ConsignmentModel} to be confirmed
* @throws BusinessProcessException
* when associated process cannot move to the confirmation state
*/
void confirmPickupConsignment(ConsignmentModel consignment) throws BusinessProcessException;
}
Items
The following item definitions are associated with the shipping service:
warehousing-items.xml:
<itemtypes>
<itemtype code="ConsignmentEntry" autocreate="false" generate="false">
<description>Extending ConsignmentEntry type with additional attributes.</description>
<attributes>
<attribute type="java.lang.Long" qualifier="quantityDeclined">
<modifiers read="true" write="false" />
<persistence type="dynamic" attributeHandler="consignmentEntryDeclinedQuantityHandler"/>
</attribute>
<attribute type="java.lang.Long" qualifier="quantityPending">
<modifiers read="true" write="false" />
<persistence type="dynamic" attributeHandler="consignmentEntryPendingQuantityHandler"/>
</attribute>
<attribute type="java.lang.Long" qualifier="quantityShipped">
<modifiers read="true" write="false" />
<persistence type="dynamic" attributeHandler="consignmentEntryShippedQuantityHandler"/>
</attribute>
</attributes>
</itemtype>
<itemtype code="OrderEntry" autocreate="false" generate="false">
<description>Extending OrderEntry type with additional attributes.</description>
<attributes>
<attribute type="java.lang.Long" qualifier="quantityAllocated">
<persistence type="dynamic" attributeHandler="orderEntryAllocatedQuantityHandler" />
<modifiers read="true" write="false" />
</attribute>
<attribute type="java.lang.Long" qualifier="quantityUnallocated">
<persistence type="dynamic" attributeHandler="orderEntryUnallocatedQuantityHandler" />
<modifiers read="true" write="false" />
</attribute>
<attribute type="java.lang.Long" qualifier="quantityCancelled">
<modifiers read="true" write="false" />
<persistence type="dynamic" attributeHandler="orderEntryCancelledQuantityHandler"/>
</attribute>
<attribute type="java.lang.Long" qualifier="quantityPending">
<modifiers read="true" write="false" />
<persistence type="dynamic" attributeHandler="orderEntryPendingQuantityHandler"/>
</attribute>
<attribute type="java.lang.Long" qualifier="quantityShipped">
<modifiers read="true" write="false" />
<persistence type="dynamic" attributeHandler="orderEntryShippedQuantityHandler" />
</attribute>
<attribute type="java.lang.Long" qualifier="quantityReturned">
<modifiers read="true" write="false" />
<persistence type="dynamic" attributeHandler="orderEntryReturnedQuantityHandler"/>
</attribute>
</attributes>
</itemtype>
</itemtypes>
Spring Configuration
You can change the default implementation in the Spring configuration.
warehousing-spring.xml:
<alias alias="warehousingShippingService" name="defaultWarehousingShippingService"/>
<bean id="defaultWarehousingShippingService" class="de.hybris.platform.warehousing.shipping.service.impl.DefaultWarehousingShippingService">
<property name="validConsConfirmConsignmentStatusList" ref="validConsConfirmConsignmentStatusList"/>
<property name="validConsConfirmOrderStatusList" ref="validConsConfirmOrderStatusList"/>
<property name="modelService" ref="modelService"/>
<property name="warehousingConsignmentWorkflowService" ref="warehousingConsignmentWorkflowService"/>
</bean>