Class BaseActivity<T extends ProcessContext<?>>
java.lang.Object
org.broadleafcommerce.core.workflow.BaseActivity<T>
- All Implemented Interfaces:
Activity<T>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.core.Ordered
- Direct Known Subclasses:
AbstractCheckAvailabilityActivity,AddFulfillmentGroupItemActivity,AddOrderItemActivity,AddWorkflowPriceOrderIfNecessaryActivity,AddWorkflowVerifyFulfillmentGroupItemsActivity,AdjustOrderPaymentsActivity,AutoBundleActivity,BaseExtensionActivity,CommitTaxActivity,CompleteOrderActivity,CompositeActivity,CompositeActivity,ConsolidateFulfillmentFeesActivity,CountTotalOffersActivity,DecrementInventoryActivity,DetermineOfferChangeActivity,FulfillmentGroupMerchandiseTotalActivity,FulfillmentGroupPricingActivity,FulfillmentItemPricingActivity,OfferActivity,PassThroughActivity,PricingServiceActivity,RecordOfferUsageActivity,RemoveFulfillmentGroupItemActivity,RemoveOrderItemActivity,RemoveOrderMultishipOptionActivity,RemoveWorkflowVerifyFulfillmentGroupItemsActivity,ShippingOfferActivity,TaxActivity,ThirdPartyInteractionLatencySimulationActivity,TotalActivity,UpdateFulfillmentGroupItemActivity,UpdateOrderItemActivity,UpdateOrderMultishipOptionActivity,UpdateProductOptionsOrderItemActivity,UpdateWorkflowVerifyFulfillmentGroupItemsActivity,ValidateAddRequestActivity,ValidateAndConfirmPaymentActivity,ValidateAvailabilityActivity,ValidateCheckoutActivity,ValidateProductOptionsActivity,ValidateRemoveRequestActivity,ValidateUpdateProductOptionsRequestActivity,ValidateUpdateRequestActivity,VerifyCustomerMaxOfferUsesActivity
public abstract class BaseActivity<T extends ProcessContext<?>>
extends Object
implements Activity<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Stringprotected ErrorHandlerprotected intprotected RollbackHandler<T>protected StringFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether or not this activity should automatically register a configured RollbackHandler with the ActivityStateManager.Get the fine-grained error handler wired up for this ActivityintgetOrder()Retrieve the RollbackHandler instance that should be called by the ActivityStateManager in the event of a workflow execution problem.Retrieve the optional region label for the RollbackHandler.Retrieve any user-defined state that should accompany the RollbackHandler.voidsetAutomaticallyRegisterRollbackHandler(boolean automaticallyRegisterRollbackHandler) Whether or not this activity should automatically register a configured RollbackHandler with the ActivityStateManager.voidsetBeanName(String beanName) voidsetErrorHandler(ErrorHandler errorHandler) voidsetOrder(int order) voidsetRollbackHandler(RollbackHandler<T> rollbackHandler) Set the RollbackHandler instance that should be called by the ActivityStateManager in the event of a workflow execution problem.voidsetRollbackRegion(String rollbackRegion) Set the optional region label for the RollbackHandler.voidsetStateConfiguration(Map<String, Object> stateConfiguration) Set any user-defined state that should accompany the RollbackHandler.booleanshouldExecute(T context) Determines if an activity should execute based on the current values in theProcessContext.
-
Field Details
-
errorHandler
-
beanName
-
rollbackHandler
-
rollbackRegion
-
stateConfiguration
-
automaticallyRegisterRollbackHandler
protected boolean automaticallyRegisterRollbackHandler -
order
protected int order
-
-
Constructor Details
-
BaseActivity
public BaseActivity()
-
-
Method Details
-
shouldExecute
Description copied from interface:ActivityDetermines if an activity should execute based on the current values in theProcessContext. For example, a context might have both anOrderas well as a String 'status' of what the order should be changed to. It is possible that an activity in a workflow could only deal with a particular status change, and thus could return false from this method.- Specified by:
shouldExecutein interfaceActivity<T extends ProcessContext<?>>- Returns:
-
getErrorHandler
Description copied from interface:ActivityGet the fine-grained error handler wired up for this Activity- Specified by:
getErrorHandlerin interfaceActivity<T extends ProcessContext<?>>- Returns:
-
setErrorHandler
- Specified by:
setErrorHandlerin interfaceActivity<T extends ProcessContext<?>>
-
getBeanName
- Specified by:
getBeanNamein interfaceActivity<T extends ProcessContext<?>>
-
setBeanName
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
getRollbackHandler
Description copied from interface:ActivityRetrieve the RollbackHandler instance that should be called by the ActivityStateManager in the event of a workflow execution problem. This RollbackHandler will presumably perform some compensating operation to revert state for the activity.- Specified by:
getRollbackHandlerin interfaceActivity<T extends ProcessContext<?>>- Returns:
- the handler responsible for reverting state for the activity
-
setRollbackHandler
Description copied from interface:ActivitySet the RollbackHandler instance that should be called by the ActivityStateManager in the event of a workflow execution problem. This RollbackHandler will presumably perform some compensating operation to revert state for the activity.- Specified by:
setRollbackHandlerin interfaceActivity<T extends ProcessContext<?>>- Parameters:
rollbackHandler- the handler responsible for reverting state for the activity
-
getRollbackRegion
Description copied from interface:ActivityRetrieve the optional region label for the RollbackHandler. Setting a region allows partitioning of groups of RollbackHandlers for more fine grained control of rollback behavior. Explicit calls to the ActivityStateManager API in an ErrorHandler instance allows explicit rollback of specific rollback handler regions. Note, to disable automatic rollback behavior and enable explicit rollbacks via the API, the workflow.auto.rollback.on.error property should be set to false in your implementation's runtime property configuration.- Specified by:
getRollbackRegionin interfaceActivity<T extends ProcessContext<?>>- Returns:
- the rollback region label for the RollbackHandler instance
-
setRollbackRegion
Description copied from interface:ActivitySet the optional region label for the RollbackHandler. Setting a region allows partitioning of groups of RollbackHandlers for more fine grained control of rollback behavior. Explicit calls to the ActivityStateManager API in an ErrorHandler instance allows explicit rollback of specific rollback handler regions. Note, to disable automatic rollback behavior and enable explicit rollbacks via the API, the workflow.auto.rollback.on.error property should be set to false in your implementation's runtime property configuration.- Specified by:
setRollbackRegionin interfaceActivity<T extends ProcessContext<?>>- Parameters:
rollbackRegion- the rollback region label for the RollbackHandler instance
-
getStateConfiguration
Description copied from interface:ActivityRetrieve any user-defined state that should accompany the RollbackHandler. This configuration will be passed to the RollbackHandler implementation at runtime.- Specified by:
getStateConfigurationin interfaceActivity<T extends ProcessContext<?>>- Returns:
- any user-defined state configuratio necessary for the execution of the RollbackHandler
-
setStateConfiguration
Description copied from interface:ActivitySet any user-defined state that should accompany the RollbackHandler. This configuration will be passed to the RollbackHandler implementation at runtime.- Specified by:
setStateConfigurationin interfaceActivity<T extends ProcessContext<?>>- Parameters:
stateConfiguration- any user-defined state configuration necessary for the execution of the RollbackHandler
-
getAutomaticallyRegisterRollbackHandler
public boolean getAutomaticallyRegisterRollbackHandler()Description copied from interface:ActivityWhether or not this activity should automatically register a configured RollbackHandler with the ActivityStateManager. It is useful to adjust this value if you plan on using the ActivityStateManager API to register RollbackHandlers explicitly in your code. The default value is false.- Specified by:
getAutomaticallyRegisterRollbackHandlerin interfaceActivity<T extends ProcessContext<?>>- Returns:
- Whether or not to automatically register a RollbackHandler with the ActivityStateManager
-
setAutomaticallyRegisterRollbackHandler
public void setAutomaticallyRegisterRollbackHandler(boolean automaticallyRegisterRollbackHandler) Description copied from interface:ActivityWhether or not this activity should automatically register a configured RollbackHandler with the ActivityStateManager. It is useful to adjust this value if you plan on using the ActivityStateManager API to register RollbackHandlers explicitly in your code. The default value is false.- Specified by:
setAutomaticallyRegisterRollbackHandlerin interfaceActivity<T extends ProcessContext<?>>- Parameters:
automaticallyRegisterRollbackHandler- Whether or not to automatically register a RollbackHandler with the ActivityStateManager
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
setOrder
public void setOrder(int order)
-