org.broadleafcommerce.core.offer.service.workflow
Class RecordOfferUsageActivity

java.lang.Object
  extended by org.broadleafcommerce.core.workflow.BaseActivity<CheckoutContext>
      extended by org.broadleafcommerce.core.offer.service.workflow.RecordOfferUsageActivity
All Implemented Interfaces:
Activity<CheckoutContext>, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.core.Ordered

public class RecordOfferUsageActivity
extends BaseActivity<CheckoutContext>

Saves an instance of OfferAudit for each offer in the passed in order.

Author:
Phillip Verheyden (phillipuniverse)
See Also:
RecordOfferUsageRollbackHandler}

Field Summary
protected static org.apache.commons.logging.Log LOG
           
protected  OfferAuditService offerAuditService
           
protected  OfferService offerService
           
static String SAVED_AUDITS
          Key to retrieve the audits that were persisted
 
Fields inherited from class org.broadleafcommerce.core.workflow.BaseActivity
automaticallyRegisterRollbackHandler, beanName, errorHandler, order, rollbackHandler, rollbackRegion, stateConfiguration
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
RecordOfferUsageActivity()
           
 
Method Summary
 CheckoutContext execute(CheckoutContext context)
          Called by the encompassing processor to activate the execution of the Activity
protected  List<OfferAudit> saveOfferIds(Set<Offer> offers, Map<Offer,OfferCode> offerToCodeMapping, Order order)
          Persists each of the offers to the database as OfferAudits.
 
Methods inherited from class org.broadleafcommerce.core.workflow.BaseActivity
getAutomaticallyRegisterRollbackHandler, getBeanName, getErrorHandler, getOrder, getRollbackHandler, getRollbackRegion, getStateConfiguration, setAutomaticallyRegisterRollbackHandler, setBeanName, setErrorHandler, setOrder, setRollbackHandler, setRollbackRegion, setStateConfiguration, shouldExecute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAVED_AUDITS

public static final String SAVED_AUDITS
Key to retrieve the audits that were persisted

See Also:
Constant Field Values

LOG

protected static final org.apache.commons.logging.Log LOG

offerAuditService

protected OfferAuditService offerAuditService

offerService

protected OfferService offerService
Constructor Detail

RecordOfferUsageActivity

public RecordOfferUsageActivity()
Method Detail

execute

public CheckoutContext execute(CheckoutContext context)
                        throws Exception
Description copied from interface: Activity
Called by the encompassing processor to activate the execution of the Activity

Parameters:
context - - process context for this workflow
Returns:
resulting process context
Throws:
Exception

saveOfferIds

protected List<OfferAudit> saveOfferIds(Set<Offer> offers,
                                        Map<Offer,OfferCode> offerToCodeMapping,
                                        Order order)
Persists each of the offers to the database as OfferAudits.

Returns:
the OfferAudits that were persisted


Copyright © 2013. All Rights Reserved.