After the quote request has been sent to the quoting system, the quoting system sends back updated quote information. The /atg/commerce/order/processor/CompleteQuoteRequest
pipeline, which uses the ProcCompleteQuoteRequest
process, contains the runProcess
method.
By default, the runProcess
method only sets the status of the order to QUOTED. It is here that you will need to add further logic to process and save new quote updates in the repository. This method requires that the orderId
is supplied in the HashMap
. You can use the PipelineConstants
class static members to key the objects in the HashMap
. You must provide a PipelineResult
object that stores any information that must be returned from this method. Quote details can be passed to the pipeline processor via the map parameter.
Note that orders that have the status of QUOTED or PENDING_QUOTE cannot be modified. The OrderHolder.validActiveShoppingCart
method verifies that the state of the order is not INCOMPLETE. You cannot modify orders that are going through the quote process since they are in the INCOMPLETE state.
The completeQuote
helper method in the OrderManager
provides support for invoking the PipelineResult
completeQuote
pipeline.
Note: It is assumed that the information returned from the quoting system will have price adjustment properties that are correctly updated, and that the order totals are correctly calculated.
As outlined in the Request a Quote section, you can add the ProcClearQuotePricingInformation
processor to clear previous discounts.
Once the new quote information is added to the repository, the customer can be informed that their quote is available, and can review the quoted order. At this point, the order is in the payment state of the checkout process, with the payment method, item quantities, billing information and quote information displayed as read-only. The customer can accept, resubmit a request or reject the quote.
For detailed information on the quote pipelines, refer to the Appendix E: Pipeline Chains section.
Submitting a Quote Using REST
A REST MVC actor can be used to complete a quote. Before you can use the /atg/commerce/order/purchase/QuoteActor
, you must register it in the ActorChainRestRegistry
. When registering the actor, make sure that you register all of its actor-chains:
registeredUrls+=\ /atg/commerce/order/purchase/QuoteActor/completeQuote, \ /atg/commerce/order/purchase/QuoteActor/completeQuote-success, \ /atg/commerce/order/purchase/QuoteActor/completeQuote-error, \ /atg/commerce/order/purchase/QuoteActor/error, \
For details on registering actors, refer to the Web Services Guide.
The QuoteActor
must pass the map of String keys to String values as defined in the completeQuoteParameters
HashMap
. When creating the processor that integrates into a third-party quoting system, these strings can be converted into data types required by the quoting system. For example, a Date type can be converted into a String using the QuoteActor
call, and then the string can be converted back to a Date in your customized pipeline processor.
A QuoteActor
REST call may be similar to the following:
curl –L -v -b agent_cookies.txt -H "Content-Type: application/json" –d "{"orderId":"o10005", "completeQuoteParameters":{"atg-rest-class-type":"atg-rest-values":{"agentId":\"agent007\", "providerNote":\"Quote good until 11/11/14\", "externalId":\"external001\", "expirationDate":\"2014-11-11 11:00\", "orderAdjustment":\"5.0\"}}}" "http://localhost:8180/rest/model/atg/commerce/ order/purchase/QuoteActor/completeQuote"
The output from this call may be similar to the following JSON example:
{ "atg-rest-class-type":\"java.util.HashMap\", "atg-rest-values":{ "agentId": \"agent007\", "providerNote": \"Quote good until 11/11/14\", "externalId": \"external001\", "expirationDate": \"2014-11-11 11:00\", "orderAdjustment": \"5.0\", } }
For detailed information on working with REST calls, refer to the Web Services Guide.