Class RecordOfferUsageActivity
java.lang.Object
org.broadleafcommerce.core.workflow.BaseActivity<ProcessContext<CheckoutSeed>>
org.broadleafcommerce.core.offer.service.workflow.RecordOfferUsageActivity
- All Implemented Interfaces:
Activity<ProcessContext<CheckoutSeed>>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.core.Ordered
@Component("blRecordOfferUsageActivity")
public class RecordOfferUsageActivity
extends BaseActivity<ProcessContext<CheckoutSeed>>
Saves an instance of OfferAudit for each offer in the passed in order.
- Author:
- Phillip Verheyden (phillipuniverse)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.apache.commons.logging.Logprotected OfferAuditServiceprotected OfferServicestatic final intstatic final StringKey to retrieve the audits that were persistedFields inherited from class org.broadleafcommerce.core.workflow.BaseActivity
automaticallyRegisterRollbackHandler, beanName, errorHandler, order, rollbackHandler, rollbackRegion, stateConfigurationFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(ProcessContext<CheckoutSeed> context) Called by the encompassing processor to activate the execution of the Activityprotected List<OfferAudit>Persists each of the offers to the database asOfferAudits.Methods inherited from class org.broadleafcommerce.core.workflow.BaseActivity
getAutomaticallyRegisterRollbackHandler, getBeanName, getErrorHandler, getOrder, getRollbackHandler, getRollbackRegion, getStateConfiguration, setAutomaticallyRegisterRollbackHandler, setBeanName, setErrorHandler, setOrder, setRollbackHandler, setRollbackRegion, setStateConfiguration, shouldExecute
-
Field Details
-
ORDER
public static final int ORDER- See Also:
-
SAVED_AUDITS
Key to retrieve the audits that were persisted- See Also:
-
LOG
protected static final org.apache.commons.logging.Log LOG -
offerAuditService
-
offerService
-
-
Constructor Details
-
RecordOfferUsageActivity
@Autowired public RecordOfferUsageActivity(@Qualifier("blRecordOfferUsageRollbackHandler") RecordOfferUsageRollbackHandler rollbackHandler)
-
-
Method Details
-
execute
Description copied from interface:ActivityCalled 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 asOfferAudits.- Returns:
- the
OfferAudits that were persisted
-