Class ClassDelegate
- java.lang.Object
-
- org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior
-
- org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior
-
- org.activiti.engine.impl.bpmn.helper.ClassDelegate
-
- All Implemented Interfaces:
java.io.Serializable,BaseExecutionListener,BaseTaskListener,CustomPropertiesResolver,ExecutionListener,TaskListener,TransactionDependentExecutionListener,TransactionDependentTaskListener,ActivityBehavior,SubProcessActivityBehavior,TriggerableActivityBehavior
public class ClassDelegate extends AbstractBpmnActivityBehavior implements TaskListener, ExecutionListener, TransactionDependentExecutionListener, TransactionDependentTaskListener, SubProcessActivityBehavior, CustomPropertiesResolver
Helper class for bpmn constructs that allow class delegation. This class will lazily instantiate the referenced classes when needed at runtime.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ActivityBehavioractivityBehaviorInstanceprotected java.lang.StringclassNameprotected CustomPropertiesResolvercustomPropertiesResolverInstanceprotected ExecutionListenerexecutionListenerInstanceprotected java.util.List<FieldDeclaration>fieldDeclarationsprotected java.util.List<org.activiti.bpmn.model.MapExceptionEntry>mapExceptionsprotected java.lang.StringserviceTaskIdprotected ExpressionskipExpressionprotected TaskListenertaskListenerInstanceprotected TransactionDependentExecutionListenertransactionDependentExecutionListenerInstanceprotected TransactionDependentTaskListenertransactionDependentTaskListenerInstance-
Fields inherited from class org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior
multiInstanceActivityBehavior
-
Fields inherited from class org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior
bpmnActivityBehavior
-
Fields inherited from interface org.activiti.engine.delegate.BaseExecutionListener
EVENTNAME_END, EVENTNAME_START, EVENTNAME_TAKE
-
Fields inherited from interface org.activiti.engine.delegate.BaseTaskListener
EVENTNAME_ALL_EVENTS, EVENTNAME_ASSIGNMENT, EVENTNAME_COMPLETE, EVENTNAME_CREATE, EVENTNAME_DELETE
-
Fields inherited from interface org.activiti.engine.delegate.TransactionDependentExecutionListener
ON_TRANSACTION_BEFORE_COMMIT, ON_TRANSACTION_COMMITTED, ON_TRANSACTION_ROLLED_BACK
-
Fields inherited from interface org.activiti.engine.delegate.TransactionDependentTaskListener
ON_TRANSACTION_COMMITTED, ON_TRANSACTION_COMMITTING, ON_TRANSACTION_ROLLED_BACK
-
-
Constructor Summary
Constructors Constructor Description ClassDelegate(java.lang.Class<?> clazz, java.util.List<FieldDeclaration> fieldDeclarations)ClassDelegate(java.lang.Class<?> clazz, java.util.List<FieldDeclaration> fieldDeclarations, Expression skipExpression)ClassDelegate(java.lang.String id, java.lang.String className, java.util.List<FieldDeclaration> fieldDeclarations, Expression skipExpression, java.util.List<org.activiti.bpmn.model.MapExceptionEntry> mapExceptions)ClassDelegate(java.lang.String className, java.util.List<FieldDeclaration> fieldDeclarations)ClassDelegate(java.lang.String className, java.util.List<FieldDeclaration> fieldDeclarations, Expression skipExpression)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidapplyFieldDeclaration(java.util.List<FieldDeclaration> fieldDeclarations, java.lang.Object target)static voidapplyFieldDeclaration(java.util.List<FieldDeclaration> fieldDeclarations, java.lang.Object target, boolean throwExceptionOnMissingField)static voidapplyFieldDeclaration(FieldDeclaration declaration, java.lang.Object target)static voidapplyFieldDeclaration(FieldDeclaration declaration, java.lang.Object target, boolean throwExceptionOnMissingField)voidcompleted(DelegateExecution execution)called after the process instance is destroyed for this activity to perform its outgoing control flow logic.voidcompleting(DelegateExecution execution, DelegateExecution subProcessInstance)called before the process instance is destroyed to allow this activity to extract data from the sub process instance.static java.lang.ObjectdefaultInstantiateDelegate(java.lang.Class<?> clazz, java.util.List<FieldDeclaration> fieldDeclarations)static java.lang.ObjectdefaultInstantiateDelegate(java.lang.String className, java.util.List<FieldDeclaration> fieldDeclarations)protected ActivityBehaviordetermineBehaviour(ActivityBehavior delegateInstance)voidexecute(DelegateExecution execution)Default behaviour: just leave the activity with no extra functionality.static booleanfieldTypeCompatible(FieldDeclaration declaration, java.lang.reflect.Field field)protected ActivityBehaviorgetActivityBehaviorInstance()java.lang.StringgetClassName()returns the class name thisClassDelegateis configured to.java.util.Map<java.lang.String,java.lang.Object>getCustomPropertiesMap(DelegateExecution execution)protected CustomPropertiesResolvergetCustomPropertiesResolverInstance()protected ExecutionListenergetExecutionListenerInstance()protected TaskListenergetTaskListenerInstance()protected TransactionDependentExecutionListenergetTransactionDependentExecutionListenerInstance()protected TransactionDependentTaskListenergetTransactionDependentTaskListenerInstance()protected java.lang.ObjectinstantiateDelegate(java.lang.String className, java.util.List<FieldDeclaration> fieldDeclarations)voidnotify(java.lang.String processInstanceId, java.lang.String executionId, org.activiti.bpmn.model.FlowElement flowElement, java.util.Map<java.lang.String,java.lang.Object> executionVariables, java.util.Map<java.lang.String,java.lang.Object> customPropertiesMap)voidnotify(java.lang.String processInstanceId, java.lang.String executionId, org.activiti.bpmn.model.Task task, java.util.Map<java.lang.String,java.lang.Object> executionVariables, java.util.Map<java.lang.String,java.lang.Object> customPropertiesMap)voidnotify(DelegateExecution execution)voidnotify(DelegateTask delegateTask)voidtrigger(DelegateExecution execution, java.lang.String signalName, java.lang.Object signalData)-
Methods inherited from class org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior
executeCompensateBoundaryEvents, findBoundaryEventsForFlowNode, getMultiInstanceActivityBehavior, getProcessDefinition, hasLoopCharacteristics, hasMultiInstanceCharacteristics, leave, setMultiInstanceActivityBehavior
-
Methods inherited from class org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior
leaveIgnoreConditions, parseActivityType
-
-
-
-
Field Detail
-
serviceTaskId
protected java.lang.String serviceTaskId
-
className
protected java.lang.String className
-
fieldDeclarations
protected java.util.List<FieldDeclaration> fieldDeclarations
-
executionListenerInstance
protected ExecutionListener executionListenerInstance
-
transactionDependentExecutionListenerInstance
protected TransactionDependentExecutionListener transactionDependentExecutionListenerInstance
-
taskListenerInstance
protected TaskListener taskListenerInstance
-
transactionDependentTaskListenerInstance
protected TransactionDependentTaskListener transactionDependentTaskListenerInstance
-
activityBehaviorInstance
protected ActivityBehavior activityBehaviorInstance
-
skipExpression
protected Expression skipExpression
-
mapExceptions
protected java.util.List<org.activiti.bpmn.model.MapExceptionEntry> mapExceptions
-
customPropertiesResolverInstance
protected CustomPropertiesResolver customPropertiesResolverInstance
-
-
Constructor Detail
-
ClassDelegate
public ClassDelegate(java.lang.String className, java.util.List<FieldDeclaration> fieldDeclarations, Expression skipExpression)
-
ClassDelegate
public ClassDelegate(java.lang.String id, java.lang.String className, java.util.List<FieldDeclaration> fieldDeclarations, Expression skipExpression, java.util.List<org.activiti.bpmn.model.MapExceptionEntry> mapExceptions)
-
ClassDelegate
public ClassDelegate(java.lang.String className, java.util.List<FieldDeclaration> fieldDeclarations)
-
ClassDelegate
public ClassDelegate(java.lang.Class<?> clazz, java.util.List<FieldDeclaration> fieldDeclarations)
-
ClassDelegate
public ClassDelegate(java.lang.Class<?> clazz, java.util.List<FieldDeclaration> fieldDeclarations, Expression skipExpression)
-
-
Method Detail
-
notify
public void notify(DelegateExecution execution)
- Specified by:
notifyin interfaceExecutionListener
-
notify
public void notify(java.lang.String processInstanceId, java.lang.String executionId, org.activiti.bpmn.model.FlowElement flowElement, java.util.Map<java.lang.String,java.lang.Object> executionVariables, java.util.Map<java.lang.String,java.lang.Object> customPropertiesMap)- Specified by:
notifyin interfaceTransactionDependentExecutionListener
-
getCustomPropertiesMap
public java.util.Map<java.lang.String,java.lang.Object> getCustomPropertiesMap(DelegateExecution execution)
- Specified by:
getCustomPropertiesMapin interfaceCustomPropertiesResolver
-
notify
public void notify(DelegateTask delegateTask)
- Specified by:
notifyin interfaceTaskListener
-
notify
public void notify(java.lang.String processInstanceId, java.lang.String executionId, org.activiti.bpmn.model.Task task, java.util.Map<java.lang.String,java.lang.Object> executionVariables, java.util.Map<java.lang.String,java.lang.Object> customPropertiesMap)- Specified by:
notifyin interfaceTransactionDependentTaskListener
-
getExecutionListenerInstance
protected ExecutionListener getExecutionListenerInstance()
-
getTransactionDependentExecutionListenerInstance
protected TransactionDependentExecutionListener getTransactionDependentExecutionListenerInstance()
-
getCustomPropertiesResolverInstance
protected CustomPropertiesResolver getCustomPropertiesResolverInstance()
-
getTaskListenerInstance
protected TaskListener getTaskListenerInstance()
-
getTransactionDependentTaskListenerInstance
protected TransactionDependentTaskListener getTransactionDependentTaskListenerInstance()
-
execute
public void execute(DelegateExecution execution)
Description copied from class:FlowNodeActivityBehaviorDefault behaviour: just leave the activity with no extra functionality.- Specified by:
executein interfaceActivityBehavior- Overrides:
executein classFlowNodeActivityBehavior
-
trigger
public void trigger(DelegateExecution execution, java.lang.String signalName, java.lang.Object signalData)
- Specified by:
triggerin interfaceTriggerableActivityBehavior- Overrides:
triggerin classFlowNodeActivityBehavior
-
completing
public void completing(DelegateExecution execution, DelegateExecution subProcessInstance) throws java.lang.Exception
Description copied from interface:SubProcessActivityBehaviorcalled before the process instance is destroyed to allow this activity to extract data from the sub process instance. No control flow should be done on the execution yet.- Specified by:
completingin interfaceSubProcessActivityBehavior- Throws:
java.lang.Exception
-
completed
public void completed(DelegateExecution execution) throws java.lang.Exception
Description copied from interface:SubProcessActivityBehaviorcalled after the process instance is destroyed for this activity to perform its outgoing control flow logic.- Specified by:
completedin interfaceSubProcessActivityBehavior- Throws:
java.lang.Exception
-
getActivityBehaviorInstance
protected ActivityBehavior getActivityBehaviorInstance()
-
determineBehaviour
protected ActivityBehavior determineBehaviour(ActivityBehavior delegateInstance)
-
instantiateDelegate
protected java.lang.Object instantiateDelegate(java.lang.String className, java.util.List<FieldDeclaration> fieldDeclarations)
-
defaultInstantiateDelegate
public static java.lang.Object defaultInstantiateDelegate(java.lang.Class<?> clazz, java.util.List<FieldDeclaration> fieldDeclarations)
-
defaultInstantiateDelegate
public static java.lang.Object defaultInstantiateDelegate(java.lang.String className, java.util.List<FieldDeclaration> fieldDeclarations)
-
applyFieldDeclaration
public static void applyFieldDeclaration(java.util.List<FieldDeclaration> fieldDeclarations, java.lang.Object target)
-
applyFieldDeclaration
public static void applyFieldDeclaration(java.util.List<FieldDeclaration> fieldDeclarations, java.lang.Object target, boolean throwExceptionOnMissingField)
-
applyFieldDeclaration
public static void applyFieldDeclaration(FieldDeclaration declaration, java.lang.Object target)
-
applyFieldDeclaration
public static void applyFieldDeclaration(FieldDeclaration declaration, java.lang.Object target, boolean throwExceptionOnMissingField)
-
fieldTypeCompatible
public static boolean fieldTypeCompatible(FieldDeclaration declaration, java.lang.reflect.Field field)
-
getClassName
public java.lang.String getClassName()
returns the class name thisClassDelegateis configured to. Comes in handy if you want to check which delegates you already have e.g. in a list of listeners
-
-