public abstract class BaseActivity<T extends ProcessContext<?>> extends Object implements Activity<T>
Modifier and Type | Field and Description |
---|---|
protected boolean |
automaticallyRegisterRollbackHandler |
protected String |
beanName |
protected ErrorHandler |
errorHandler |
protected int |
order |
protected RollbackHandler<T> |
rollbackHandler |
protected String |
rollbackRegion |
protected Map<String,Object> |
stateConfiguration |
Constructor and Description |
---|
BaseActivity() |
Modifier and Type | Method and Description |
---|---|
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
|
int |
getOrder() |
RollbackHandler<T> |
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 |
setBeanName(String beanName) |
void |
setErrorHandler(ErrorHandler errorHandler) |
void |
setOrder(int order) |
void |
setRollbackHandler(RollbackHandler<T> 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 . |
protected ErrorHandler errorHandler
protected String beanName
protected RollbackHandler<T extends ProcessContext<?>> rollbackHandler
protected String rollbackRegion
protected boolean automaticallyRegisterRollbackHandler
protected int order
public boolean shouldExecute(T context)
Activity
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.shouldExecute
in interface Activity<T extends ProcessContext<?>>
public ErrorHandler getErrorHandler()
Activity
getErrorHandler
in interface Activity<T extends ProcessContext<?>>
public void setBeanName(String beanName)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public void setErrorHandler(ErrorHandler errorHandler)
setErrorHandler
in interface Activity<T extends ProcessContext<?>>
public String getBeanName()
getBeanName
in interface Activity<T extends ProcessContext<?>>
public RollbackHandler<T> getRollbackHandler()
Activity
getRollbackHandler
in interface Activity<T extends ProcessContext<?>>
public void setRollbackHandler(RollbackHandler<T> rollbackHandler)
Activity
setRollbackHandler
in interface Activity<T extends ProcessContext<?>>
rollbackHandler
- the handler responsible for reverting state for the activitypublic String getRollbackRegion()
Activity
getRollbackRegion
in interface Activity<T extends ProcessContext<?>>
public void setRollbackRegion(String rollbackRegion)
Activity
setRollbackRegion
in interface Activity<T extends ProcessContext<?>>
rollbackRegion
- the rollback region label for the RollbackHandler instancepublic Map<String,Object> getStateConfiguration()
Activity
getStateConfiguration
in interface Activity<T extends ProcessContext<?>>
public void setStateConfiguration(Map<String,Object> stateConfiguration)
Activity
setStateConfiguration
in interface Activity<T extends ProcessContext<?>>
stateConfiguration
- any user-defined state configuration necessary for the execution of the RollbackHandlerpublic boolean getAutomaticallyRegisterRollbackHandler()
Activity
getAutomaticallyRegisterRollbackHandler
in interface Activity<T extends ProcessContext<?>>
public void setAutomaticallyRegisterRollbackHandler(boolean automaticallyRegisterRollbackHandler)
Activity
setAutomaticallyRegisterRollbackHandler
in interface Activity<T extends ProcessContext<?>>
automaticallyRegisterRollbackHandler
- Whether or not to automatically register a RollbackHandler with the ActivityStateManagerpublic int getOrder()
getOrder
in interface org.springframework.core.Ordered
public void setOrder(int order)
Copyright © 2017. All rights reserved.