Class CmmnClassDelegate
java.lang.Object
org.flowable.cmmn.engine.impl.delegate.CmmnClassDelegate
- All Implemented Interfaces:
Serializable,PlanItemVariableAggregator,CaseInstanceLifecycleListener,PlanItemInstanceLifecycleListener,CmmnActivityBehavior,CmmnTriggerableActivityBehavior,BaseTaskListener,TaskListener
- Direct Known Subclasses:
ClassDelegateHttpHandler
public class CmmnClassDelegate
extends Object
implements CmmnTriggerableActivityBehavior, TaskListener, PlanItemInstanceLifecycleListener, CaseInstanceLifecycleListener, PlanItemVariableAggregator
- Author:
- Joram Barrez
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CmmnActivityBehaviorprotected Stringprotected List<FieldExtension>protected Stringprotected StringFields inherited from interface org.flowable.task.service.delegate.BaseTaskListener
EVENTNAME_ALL_EVENTS, EVENTNAME_ASSIGNMENT, EVENTNAME_COMPLETE, EVENTNAME_CREATE, EVENTNAME_DELETE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaggregateMultiVariables(DelegatePlanItemInstance planItemInstance, List<? extends VariableInstance> instances, PlanItemVariableAggregatorContext context) Aggregated the provided variable instances into one variable value.aggregateSingleVariable(DelegatePlanItemInstance planItemInstance, PlanItemVariableAggregatorContext context) Create a single variable value based on the provided aggregation definition.protected static voidapplyFieldExtension(FieldExtension fieldExtension, Object target, boolean throwExceptionOnMissingField) static voidapplyFieldExtensions(List<FieldExtension> fieldExtensions, Object target, boolean throwExceptionOnMissingField) voidexecute(DelegatePlanItemInstance planItemInstance) protected CaseInstanceLifecycleListenerprotected CmmnActivityBehaviorgetCmmnActivityBehavior(String className) protected PlanItemInstanceLifecycleListenerprotected PlanItemVariableAggregatorprotected TaskListenergetTaskListenerInstance(DelegateTask delegateTask) protected Objectinstantiate(String className) voidnotify(DelegateTask delegateTask) voidsetActivityBehaviorInstance(CmmnActivityBehavior activityBehaviorInstance) voidsetClassName(String className) voidsetFieldExtensions(List<FieldExtension> fieldExtensions) voidsetSourceState(String sourceState) voidsetTargetState(String targetState) voidstateChanged(DelegatePlanItemInstance planItemInstance, String oldState, String newState) Will be called when the state of aDelegatePlanItemInstancechanges and thePlanItemInstanceLifecycleListener.getSourceState()andPlanItemInstanceLifecycleListener.getTargetState()match.voidstateChanged(CaseInstance caseInstance, String oldState, String newState) Will be called when the state of aCaseInstancechanges and theCaseInstanceLifecycleListener.getSourceState()andCaseInstanceLifecycleListener.getTargetState()match.voidtrigger(DelegatePlanItemInstance planItemInstance)
-
Field Details
-
sourceState
-
targetState
-
className
-
fieldExtensions
-
activityBehaviorInstance
-
-
Constructor Details
-
CmmnClassDelegate
-
-
Method Details
-
execute
- Specified by:
executein interfaceCmmnActivityBehavior
-
trigger
- Specified by:
triggerin interfaceCmmnTriggerableActivityBehavior
-
getCmmnActivityBehavior
-
notify
- Specified by:
notifyin interfaceTaskListener
-
getTaskListenerInstance
-
stateChanged
public void stateChanged(DelegatePlanItemInstance planItemInstance, String oldState, String newState) Description copied from interface:PlanItemInstanceLifecycleListenerWill be called when the state of aDelegatePlanItemInstancechanges and thePlanItemInstanceLifecycleListener.getSourceState()andPlanItemInstanceLifecycleListener.getTargetState()match.- Specified by:
stateChangedin interfacePlanItemInstanceLifecycleListener
-
stateChanged
Description copied from interface:CaseInstanceLifecycleListenerWill be called when the state of aCaseInstancechanges and theCaseInstanceLifecycleListener.getSourceState()andCaseInstanceLifecycleListener.getTargetState()match.- Specified by:
stateChangedin interfaceCaseInstanceLifecycleListener
-
getPlanItemLifeCycleListenerInstance
-
getCaseLifeCycleListenerInstance
-
aggregateSingleVariable
public Object aggregateSingleVariable(DelegatePlanItemInstance planItemInstance, PlanItemVariableAggregatorContext context) Description copied from interface:PlanItemVariableAggregatorCreate a single variable value based on the provided aggregation definition. This is called after a single repeatable plan item instance is completed, or an overview for a non completed repeatable plan item instance is needed.- Specified by:
aggregateSingleVariablein interfacePlanItemVariableAggregator- Parameters:
planItemInstance- the delegate planItemInstance from where we need to get data fromcontext- the aggregation context- Returns:
- the value for the aggregated variable
-
aggregateMultiVariables
public Object aggregateMultiVariables(DelegatePlanItemInstance planItemInstance, List<? extends VariableInstance> instances, PlanItemVariableAggregatorContext context) Description copied from interface:PlanItemVariableAggregatorAggregated the provided variable instances into one variable value. This is called when all repeatable plan item instances are complete, or an overview for repeatable plan item instances is needed.- Specified by:
aggregateMultiVariablesin interfacePlanItemVariableAggregator- Parameters:
planItemInstance- the delegated planItemInstance for which we need to do the aggregationinstances- the variable values that should be aggregated (these variables are created based on the value fromPlanItemVariableAggregator.aggregateSingleVariable(DelegatePlanItemInstance, PlanItemVariableAggregatorContext))context- the aggregation context- Returns:
- the aggregated value
-
getPlanItemVariableAggregator
-
instantiate
-
applyFieldExtensions
public static void applyFieldExtensions(List<FieldExtension> fieldExtensions, Object target, boolean throwExceptionOnMissingField) -
applyFieldExtension
protected static void applyFieldExtension(FieldExtension fieldExtension, Object target, boolean throwExceptionOnMissingField) -
getSourceState
- Specified by:
getSourceStatein interfaceCaseInstanceLifecycleListener- Specified by:
getSourceStatein interfacePlanItemInstanceLifecycleListener- Returns:
- The type a plan item instance is changing from, use a value from
PlanItemInstanceState. This listener will only receive elements where the state changing from this value to another one. Return null or the empty String to listen to any state.
-
setSourceState
-
getTargetState
- Specified by:
getTargetStatein interfaceCaseInstanceLifecycleListener- Specified by:
getTargetStatein interfacePlanItemInstanceLifecycleListener- Returns:
- The type a plan item instance is changing to, use a value from
PlanItemInstanceState. This listener will only receive elements where the state changing from this value to another one. Return null or the empty String to listen to any state.
-
setTargetState
-
getClassName
-
setClassName
-
getFieldExtensions
-
setFieldExtensions
-
getActivityBehaviorInstance
-
setActivityBehaviorInstance
-