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 CmmnActivityBehavior
protected String
protected List<FieldExtension>
protected String
protected String
Fields 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 void
applyFieldExtension
(FieldExtension fieldExtension, Object target, boolean throwExceptionOnMissingField) static void
applyFieldExtensions
(List<FieldExtension> fieldExtensions, Object target, boolean throwExceptionOnMissingField) void
execute
(DelegatePlanItemInstance planItemInstance) protected CaseInstanceLifecycleListener
protected CmmnActivityBehavior
getCmmnActivityBehavior
(String className) protected PlanItemInstanceLifecycleListener
protected PlanItemVariableAggregator
protected TaskListener
getTaskListenerInstance
(DelegateTask delegateTask) protected Object
instantiate
(String className) void
notify
(DelegateTask delegateTask) void
setActivityBehaviorInstance
(CmmnActivityBehavior activityBehaviorInstance) void
setClassName
(String className) void
setFieldExtensions
(List<FieldExtension> fieldExtensions) void
setSourceState
(String sourceState) void
setTargetState
(String targetState) void
stateChanged
(DelegatePlanItemInstance planItemInstance, String oldState, String newState) Will be called when the state of aDelegatePlanItemInstance
changes and thePlanItemInstanceLifecycleListener.getSourceState()
andPlanItemInstanceLifecycleListener.getTargetState()
match.void
stateChanged
(CaseInstance caseInstance, String oldState, String newState) Will be called when the state of aCaseInstance
changes and theCaseInstanceLifecycleListener.getSourceState()
andCaseInstanceLifecycleListener.getTargetState()
match.void
trigger
(DelegatePlanItemInstance planItemInstance)
-
Field Details
-
sourceState
-
targetState
-
className
-
fieldExtensions
-
activityBehaviorInstance
-
-
Constructor Details
-
CmmnClassDelegate
-
-
Method Details
-
execute
- Specified by:
execute
in interfaceCmmnActivityBehavior
-
trigger
- Specified by:
trigger
in interfaceCmmnTriggerableActivityBehavior
-
getCmmnActivityBehavior
-
notify
- Specified by:
notify
in interfaceTaskListener
-
getTaskListenerInstance
-
stateChanged
public void stateChanged(DelegatePlanItemInstance planItemInstance, String oldState, String newState) Description copied from interface:PlanItemInstanceLifecycleListener
Will be called when the state of aDelegatePlanItemInstance
changes and thePlanItemInstanceLifecycleListener.getSourceState()
andPlanItemInstanceLifecycleListener.getTargetState()
match.- Specified by:
stateChanged
in interfacePlanItemInstanceLifecycleListener
-
stateChanged
Description copied from interface:CaseInstanceLifecycleListener
Will be called when the state of aCaseInstance
changes and theCaseInstanceLifecycleListener.getSourceState()
andCaseInstanceLifecycleListener.getTargetState()
match.- Specified by:
stateChanged
in interfaceCaseInstanceLifecycleListener
-
getPlanItemLifeCycleListenerInstance
-
getCaseLifeCycleListenerInstance
-
aggregateSingleVariable
public Object aggregateSingleVariable(DelegatePlanItemInstance planItemInstance, PlanItemVariableAggregatorContext context) Description copied from interface:PlanItemVariableAggregator
Create 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:
aggregateSingleVariable
in 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:PlanItemVariableAggregator
Aggregated 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:
aggregateMultiVariables
in 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:
getSourceState
in interfaceCaseInstanceLifecycleListener
- Specified by:
getSourceState
in 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:
getTargetState
in interfaceCaseInstanceLifecycleListener
- Specified by:
getTargetState
in 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
-