T - public interface Activity<T extends ProcessContext>
extends org.springframework.beans.factory.BeanNameAware, org.springframework.core.Ordered
Interface to be used for workflows in Broadleaf. Usually implementations will subclass BaseActivity.
ModuleActivity interface as well. This ensures that there is proper logging
for users that are using your module so that they know exactly what their final workflow configuration looks like.BaseActivity},
ModuleActivity},
BaseProcessor},
SequenceProcessor}| Modifier and Type | Method and Description |
|---|---|
T |
execute(T context)
Called by the encompassing processor to activate
the execution of the Activity
|
boolean |
getAutomaticallyRegisterRollbackHandler()
Whether or not this activity should automatically register a configured RollbackHandler with the ActivityStateManager.
|
String |
getBeanName() |
ErrorHandler |
getErrorHandler()
Get the fine-grained error handler wired up for this Activity
|
RollbackHandler |
getRollbackHandler()
Retrieve the RollbackHandler instance that should be called by the ActivityStateManager in the
event of a workflow execution problem.
|
String |
getRollbackRegion()
Retrieve the optional region label for the RollbackHandler.
|
Map<String,Object> |
getStateConfiguration()
Retrieve any user-defined state that should accompany the RollbackHandler.
|
void |
setAutomaticallyRegisterRollbackHandler(boolean automaticallyRegisterRollbackHandler)
Whether or not this activity should automatically register a configured RollbackHandler with the ActivityStateManager.
|
void |
setErrorHandler(ErrorHandler errorHandler) |
void |
setRollbackHandler(RollbackHandler rollbackHandler)
Set the RollbackHandler instance that should be called by the ActivityStateManager in the
event of a workflow execution problem.
|
void |
setRollbackRegion(String rollbackRegion)
Set the optional region label for the RollbackHandler.
|
void |
setStateConfiguration(Map<String,Object> stateConfiguration)
Set any user-defined state that should accompany the RollbackHandler.
|
boolean |
shouldExecute(T context)
Determines if an activity should execute based on the current values in the
ProcessContext. |
T execute(T context) throws Exception
context - - process context for this workflowExceptionboolean shouldExecute(T context)
ProcessContext. For example, a
context might have both an Order as 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.context - ErrorHandler getErrorHandler()
void setErrorHandler(ErrorHandler errorHandler)
String getBeanName()
RollbackHandler getRollbackHandler()
void setRollbackHandler(RollbackHandler rollbackHandler)
rollbackHandler - the handler responsible for reverting state for the activityString getRollbackRegion()
void setRollbackRegion(String rollbackRegion)
rollbackRegion - the rollback region label for the RollbackHandler instanceMap<String,Object> getStateConfiguration()
void setStateConfiguration(Map<String,Object> stateConfiguration)
stateConfiguration - any user-defined state configuration necessary for the execution of the RollbackHandlerboolean getAutomaticallyRegisterRollbackHandler()
void setAutomaticallyRegisterRollbackHandler(boolean automaticallyRegisterRollbackHandler)
automaticallyRegisterRollbackHandler - Whether or not to automatically register a RollbackHandler with the ActivityStateManagerCopyright © 2014. All Rights Reserved.