Guide - 7.9 Order Creation

1 Introduction

Order creation has been reworked completely in ICM 7.9. New order creation functionality has been built side by side with the old one to allow customers a soft migration and to support customers that want to continue using the old functionality for any reason.

2 Artifacts

2.1 Legacy Pipeline-based Order Creation Functionality (deprecated)

Legacy pipeline-based order creation functionality includes the pipelines and Java classes listed in the following sub-chapters.

2.1.1 Java

Following Manager classes are called by pipelets.

CartridgeClassNote
bts

com.intershop.beehive.bts.capi.orderprocess.basket.BasketMgr

com.intershop.beehive.bts.internal.orderprocess.basket.BasketMgrImpl
  •  Marked as deprecated since ICM 7.9 .
bts

com.intershop.beehive.bts.capi.orderprocess.OrderProcessMgrImpl
com.intershop.beehive.bts.internal.orderprocess.OrderProcessMgrImpl

  •  Marked as deprecated since ICM 7.9 .
bc_order_ormcom.intershop.beehive.bts.capi.orderprocess.fulfillment.FulfillmentMgr
com.intershop.component.order_orm.internal.orderprocess.FulfillmentMgrImpl
  •  Marked as deprecated since ICM 7.9 .

2.1.2 Pipelines

Following application-dependent pipelines trigger the order creation for UI and REST storefront.

Note

These pipelines are only called partly by the new order creation functionality!


CartridgeUI/RESTSubmit Order Pipeline
(Application-dependent)
OverloadsCalls Order Creation Pipeline
(Application-independent)
Calls After Checkout Processing Pipeline (Application-independent)
app_sf_responsiveUIViewCheckoutReview-SubmitOrder-bc_orderprocess/ProcessOrderCreation-CreateOrder bc_orderprocess/ProcessOrders-AfterCheckoutProcessing
app_sf_responsive_b2bUIViewCheckoutReview-SubmitOrder

app_sf_responsive/ViewCheckoutReview-SubmitOrder

bc_orderprocess/ProcessOrderCreation-CreateOrder app_sf_responsive_b2b /ProcessOrders-AfterCheckoutProcessing
app_sf_responsive_costcenterUIViewCheckoutReview-SubmitOrder app_sf_responsive_b2b/ViewCheckoutReview-SubmitOrder bc_orderprocess/ProcessOrderCreation-CreateOrder app_sf_responsive_b2b /ProcessOrders-AfterCheckoutProcessing
app_sf_restRESTProcessOrderREST-SubmitOrder-app_sf_rest/ProcessOrderREST-CreateOrder bc_orderprocess/ProcessOrders-AfterCheckoutProcessing
app_sf_rest_b2bRESTProcessOrderREST-SubmitOrder app_sf_rest/ProcessOrderREST-SubmitOrderapp_sf_rest/ ProcessOrderREST-CreateOrder bc_orderprocess/ProcessOrders-AfterCheckoutProcessing

Following process pipelines create the order.

Note

These pipelines are not called by the new order creation functionality any longer!

CartridgeOrder Creation PipelineNote
bc_requisitionProcessOrder-CreateOrders
  • Used by bc_requisition and c_xml punchout only
  • Outdated functionality
bc_orderprocessProcessOrders-CreateOrder
  • For creation of DBInit orders only
  • Marked as deprecated since ICM 7.8
bc_orderprocessProcessOrderCreation-CreateOrder
  • Used by UI pipelines
  • Marked as deprecated since ICM 7.9

Following Process Pipelines process after-checkout tasks.

Note

These pipelines are not called by the new order creation functionality any longer!

CartridgeAfter Checkout Processing PipelineNote
bc_orderprocessProcessOrders-AfterCheckoutHandling
  • Replaced by ProcessOrders-AfterCheckoutProcessing
  • Marked as deprecated since IS 7.3.1
bc_orderprocessProcessOrders-AfterCheckoutProcessing
  • Replacement for ProcessOrders-AfterCheckoutHandling
  • Marked as deprecated since IS 7.3.1
bc_orderprocessProcessOrderCreation-AfterCheckoutProcessing
  • Only called by app_sf_responsive/ViewCheckoutConfirmation
  • Calls ProcessOrderCreation-AfterCheckoutProcessingSuccess
  • Calls ProcessOrderCreation-AfterCheckoutProcessingPromotions
  • Marked as deprecated since ICM 7.9
bc_orderprocessProcessOrderCreation-AfterCheckoutPromotions
  • Marked as deprecated since ICM 7.9
bc_orderprocessProcessOrderCreation-AfterCheckoutProcessingSuccess
  • Marked as deprecated since ICM 7.9
app_sf_responsive_b2bProcessOrders-AfterCheckoutProcessing
  • Calls bc_orderprocess/ProcessOrders-AfterCheckoutProcessing
  • Marked as deprecated since IS 7.3.1

2.1.3 Pipeline Extension Points

Legacy order creation functionality defines following pipeline extension points.

Note

These pipeline extension points are not called by the new order creation functionality any longer!

CartridgePipelineName
app_sf_restProcessOrderREST-CreateOrderCreateOrder
app_sf_restProcessOrderREST-CreateOrderOrderCreated
bc_orderprocessProcessOrderCreation-CreateOrder CreateOrder
bc_orderprocessProcessOrderCreation-CreateOrder OrderCreated

2.2 Handler Chain-based Order Creation Functionality

2.2.1 Java

The Handler Chain interfaces and implementation classes are located in the bc_handler_chain cartridge. However, Handler Chain is a common concept and implementation, that is not limited to order creation. The order creation is just one use case for this pattern.

Order creation functionality defines following derived interfaces and classes:

com.intershop.component.order.capi.handlerchain.OrderCreationContext
com.intershop.component.order.capi.handlerchain.OrderCreationResult

An order creation handler that should be included in the order creation chain has to be implemented like following:

MyOrderCreationHandler
public class MyOrderCreationHandler implements Handler<OrderCreationContext>
{
    @Override
    public HandlerResult invoke(OrderCreationContext context)
    {
        ... // Do your own things!
	}
}

Order creation chains are defined by component files:

Order Creation Chains
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<components xmlns="http://www.intershop.de/component/2010">

    <instance name="OrderCreationResultFactory" with="OrderCreationResultFactory" />
    <instance name="OrderCreationResultMergeStrategy" with="OrderCreationResultMergeStrategy" />

    <fulfill requirement="chainDefinition" of="ChainRegistry">
        <instance name="OrderCreationChainDefinition" with="ChainDefinition" scope="app">
            <fulfill requirement="name" value="OrderCreationChain" />
            <fulfill requirement="contextType" value="com.intershop.component.order.capi.handlerchain.OrderCreationContext" />
            <fulfill requirement="resultType" value="com.intershop.component.order.capi.handlerchain.OrderCreationResult" />
            <fulfill requirement="resultMergeStrategy" with="OrderCreationResultMergeStrategy" />
            <fulfill requirement="chain">
                <!-- Sub-chain for preparing the order creation. That includes the validation of the
                basket, performing approval workflow (if needed) and handling of recurring orders. -->
                <instance name="PreOrderCreationChain" with="Chain" scope="app">>
                    <fulfill requirement="name" value="PreOrderCreationChain" />
                    <fulfill requirement="behaviorOnFailure" value="ROLLBACK" />
                    <fulfill requirement="transactional" value="false" />
                    <fulfill requirement="resultFactory" with="OrderCreationResultFactory" />
                </instance>
                
                <!-- Core order creation and enrichment functionality -->
                <instance name="OrderCreationChain" with="Chain" scope="app">>
                    <fulfill requirement="name" value="OrderCreationChain" />
                    <fulfill requirement="behaviorOnFailure" value="ROLLBACK" />
                    <fulfill requirement="transactional" value="true" />
                    <fulfill requirement="resultFactory" with="OrderCreationResultFactory" />
                </instance>
                
                <!-- 
                Sub-chain for performing payment authorizations (incl. redirect after checkout).
                 -->
                <instance name="PaymentAuthorizationOrderCreationChain" with="Chain" scope="app">>
                    <fulfill requirement="name" value="PaymentAuthorizationOrderCreationChain" />
                    <fulfill requirement="behaviorOnFailure" value="ROLLBACK" />
                    <fulfill requirement="transactional" value="false" />
                    <fulfill requirement="resultFactory" with="OrderCreationResultFactory" />
                </instance>
                
                <!-- 
                Sub-chain for processing all actions that do not need to wait for a successful completion of the payment
                 (e.g. send order confirmation mail).
                 -->
                <instance name="PendingPaymentOrderCreationChain" with="Chain" scope="app">>
                    <fulfill requirement="name" value="PendingPaymentOrderCreationChain" />
                    <fulfill requirement="behaviorOnFailure" value="CONTINUE" />
                    <fulfill requirement="transactional" value="false" />
                    <fulfill requirement="resultFactory" with="OrderCreationResultFactory" />
                </instance>            
                
                <!-- 
                Sub-chain for processing asynchronous payment notifications. Waits for all pending payments
                and continues if all payments were authorized or rolls back if a payment failed.
                 -->
                <instance name="PaymentSynchronizationOrderCreationChain" with="Chain" scope="app">>
                    <fulfill requirement="name" value="PaymentSynchronizationOrderCreationChain" />
                    <fulfill requirement="behaviorOnFailure" value="ROLLBACK" />
                    <fulfill requirement="transactional" value="false" />
                    <fulfill requirement="resultFactory" with="OrderCreationResultFactory" />
                </instance>

                <!-- 
                All handlers to be processed after the payment was completed successful have to go 
                in this sub-chain. (e.g. booking affiliate provisions) 
                -->
                <instance name="PostPaymentOrderCreationChain" with="Chain" scope="app">>
                    <fulfill requirement="name" value="PostPaymentOrderCreationChain" />
                    <fulfill requirement="behaviorOnFailure" value="CONTINUE" />
                    <fulfill requirement="transactional" value="false" />
                    <fulfill requirement="resultFactory" with="OrderCreationResultFactory" />
                </instance>
            </fulfill>
        </instance>
    </fulfill>

</components>

Order creation handlers are wired to the related chains by component framework:

    <implementation name ="BasicOrderCreationHandler"
                    class="com.intershop.component.order_orm.internal.handlerchain.BasicOrderCreationHandler"
                    implements="Handler" />

    ...

    <fulfill requirement="handler" of="OrderCreationChain">
        <instance with="HandlerDefinition" name="BasicOrderCreationHandler">
            <fulfill requirement="name" value="BasicOrderCreationHandler"/>
            <fulfill requirement="position" value="10"/>
            <fulfill requirement="handler">
                <instance with="BasicOrderCreationHandler"/>
            </fulfill>
        </instance>
    </fulfill>

The Handler Chain that processes the order creation is triggered by the following method:

OrderBORepository
com.intershop.component.order.capi.OrderBORepository::createOrderBO(OrderCreationContext context) : OrderCreationResult

2.2.2 Pipelines

Following application-dependent pipelines contain the switch to trigger the order creation via Handler Chains.

CartridgeUI/RESTSubmit Order Pipeline
(Application-dependent)
Overloads
app_sf_responsiveUIViewCheckoutReview-SubmitOrder-
app_sf_responsive_b2bUIViewCheckoutReview-SubmitOrder

app_sf_responsive/ViewCheckoutReview-SubmitOrder

app_sf_responsive_costcenterUIViewCheckoutReview-SubmitOrder app_sf_responsive_b2b/ViewCheckoutReview-SubmitOrder
app_sf_restRESTProcessOrderREST-SubmitOrder-
app_sf_rest_b2bRESTProcessOrderREST-SubmitOrder app_sf_rest/ProcessOrderREST-SubmitOrder

3 The Switch

Use the HandlerChain-based order creation functionality (The new implementation is active by default in ICM 7.9):

intershop.order.creationchain.enable=true

Use the legacy order creation functionality:

intershop.order.creationchain.enable=false

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Support Tickets