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:
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ActivityBehaviorprotected Stringprotected CustomPropertiesResolverprotected ExecutionListenerprotected List<FieldDeclaration> protected List<org.activiti.bpmn.model.MapExceptionEntry> protected Stringprotected Expressionprotected TaskListenerprotected TransactionDependentExecutionListenerprotected TransactionDependentTaskListenerFields inherited from class org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior
multiInstanceActivityBehaviorFields inherited from class org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior
bpmnActivityBehaviorFields inherited from interface org.activiti.engine.delegate.BaseExecutionListener
EVENTNAME_END, EVENTNAME_START, EVENTNAME_TAKEFields inherited from interface org.activiti.engine.delegate.BaseTaskListener
EVENTNAME_ALL_EVENTS, EVENTNAME_ASSIGNMENT, EVENTNAME_COMPLETE, EVENTNAME_CREATE, EVENTNAME_DELETEFields inherited from interface org.activiti.engine.delegate.TransactionDependentExecutionListener
ON_TRANSACTION_BEFORE_COMMIT, ON_TRANSACTION_COMMITTED, ON_TRANSACTION_ROLLED_BACKFields inherited from interface org.activiti.engine.delegate.TransactionDependentTaskListener
ON_TRANSACTION_COMMITTED, ON_TRANSACTION_COMMITTING, ON_TRANSACTION_ROLLED_BACK -
Constructor Summary
ConstructorsConstructorDescriptionClassDelegate(Class<?> clazz, List<FieldDeclaration> fieldDeclarations) ClassDelegate(Class<?> clazz, List<FieldDeclaration> fieldDeclarations, Expression skipExpression) ClassDelegate(String id, String className, List<FieldDeclaration> fieldDeclarations, Expression skipExpression, List<org.activiti.bpmn.model.MapExceptionEntry> mapExceptions) ClassDelegate(String className, List<FieldDeclaration> fieldDeclarations) ClassDelegate(String className, List<FieldDeclaration> fieldDeclarations, Expression skipExpression) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyFieldDeclaration(List<FieldDeclaration> fieldDeclarations, Object target) static voidapplyFieldDeclaration(List<FieldDeclaration> fieldDeclarations, Object target, boolean throwExceptionOnMissingField) static voidapplyFieldDeclaration(FieldDeclaration declaration, Object target) static voidapplyFieldDeclaration(FieldDeclaration declaration, 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 ObjectdefaultInstantiateDelegate(Class<?> clazz, List<FieldDeclaration> fieldDeclarations) static ObjectdefaultInstantiateDelegate(String className, List<FieldDeclaration> fieldDeclarations) protected ActivityBehaviordetermineBehaviour(ActivityBehavior delegateInstance) voidexecute(DelegateExecution execution) Default behaviour: just leave the activity with no extra functionality.static booleanfieldTypeCompatible(FieldDeclaration declaration, Field field) protected ActivityBehaviorreturns the class name thisClassDelegateis configured to.getCustomPropertiesMap(DelegateExecution execution) protected CustomPropertiesResolverprotected ExecutionListenerprotected TaskListenerprotected TransactionDependentExecutionListenerprotected TransactionDependentTaskListenerprotected ObjectinstantiateDelegate(String className, List<FieldDeclaration> fieldDeclarations) voidnotify(String processInstanceId, String executionId, org.activiti.bpmn.model.FlowElement flowElement, Map<String, Object> executionVariables, Map<String, Object> customPropertiesMap) voidnotify(String processInstanceId, String executionId, org.activiti.bpmn.model.Task task, Map<String, Object> executionVariables, Map<String, Object> customPropertiesMap) voidnotify(DelegateExecution execution) voidnotify(DelegateTask delegateTask) voidtrigger(DelegateExecution execution, String signalName, Object signalData) Methods inherited from class org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior
executeCompensateBoundaryEvents, findBoundaryEventsForFlowNode, getMultiInstanceActivityBehavior, getProcessDefinition, hasLoopCharacteristics, hasMultiInstanceCharacteristics, leave, setMultiInstanceActivityBehaviorMethods inherited from class org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior
leaveIgnoreConditions, parseActivityType
-
Field Details
-
serviceTaskId
-
className
-
fieldDeclarations
-
executionListenerInstance
-
transactionDependentExecutionListenerInstance
-
taskListenerInstance
-
transactionDependentTaskListenerInstance
-
activityBehaviorInstance
-
skipExpression
-
mapExceptions
-
customPropertiesResolverInstance
-
-
Constructor Details
-
ClassDelegate
public ClassDelegate(String className, List<FieldDeclaration> fieldDeclarations, Expression skipExpression) -
ClassDelegate
public ClassDelegate(String id, String className, List<FieldDeclaration> fieldDeclarations, Expression skipExpression, List<org.activiti.bpmn.model.MapExceptionEntry> mapExceptions) -
ClassDelegate
-
ClassDelegate
-
ClassDelegate
public ClassDelegate(Class<?> clazz, List<FieldDeclaration> fieldDeclarations, Expression skipExpression)
-
-
Method Details
-
notify
- Specified by:
notifyin interfaceExecutionListener
-
notify
public void notify(String processInstanceId, String executionId, org.activiti.bpmn.model.FlowElement flowElement, Map<String, Object> executionVariables, Map<String, Object> customPropertiesMap) - Specified by:
notifyin interfaceTransactionDependentExecutionListener
-
getCustomPropertiesMap
- Specified by:
getCustomPropertiesMapin interfaceCustomPropertiesResolver
-
notify
- Specified by:
notifyin interfaceTaskListener
-
notify
public void notify(String processInstanceId, String executionId, org.activiti.bpmn.model.Task task, Map<String, Object> executionVariables, Map<String, Object> customPropertiesMap) - Specified by:
notifyin interfaceTransactionDependentTaskListener
-
getExecutionListenerInstance
-
getTransactionDependentExecutionListenerInstance
-
getCustomPropertiesResolverInstance
-
getTaskListenerInstance
-
getTransactionDependentTaskListenerInstance
-
execute
Description copied from class:FlowNodeActivityBehaviorDefault behaviour: just leave the activity with no extra functionality.- Specified by:
executein interfaceActivityBehavior- Overrides:
executein classFlowNodeActivityBehavior
-
trigger
- Specified by:
triggerin interfaceTriggerableActivityBehavior- Overrides:
triggerin classFlowNodeActivityBehavior
-
completing
public void completing(DelegateExecution execution, DelegateExecution subProcessInstance) throws 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:
Exception
-
completed
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:
Exception
-
getActivityBehaviorInstance
-
determineBehaviour
-
instantiateDelegate
-
defaultInstantiateDelegate
public static Object defaultInstantiateDelegate(Class<?> clazz, List<FieldDeclaration> fieldDeclarations) -
defaultInstantiateDelegate
public static Object defaultInstantiateDelegate(String className, List<FieldDeclaration> fieldDeclarations) -
applyFieldDeclaration
-
applyFieldDeclaration
public static void applyFieldDeclaration(List<FieldDeclaration> fieldDeclarations, Object target, boolean throwExceptionOnMissingField) -
applyFieldDeclaration
-
applyFieldDeclaration
public static void applyFieldDeclaration(FieldDeclaration declaration, Object target, boolean throwExceptionOnMissingField) -
fieldTypeCompatible
-
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
-