Class CmmnAggregation
- java.lang.Object
-
- org.flowable.cmmn.engine.impl.variable.CmmnAggregation
-
public class CmmnAggregation extends Object
- Author:
- Filip Hrisafov
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOUNTER_VAR_PREFIXstatic StringCOUNTER_VAR_VALUE_SEPARATORprotected StringplanItemInstanceId
-
Constructor Summary
Constructors Constructor Description CmmnAggregation(String planItemInstanceId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VariableInstanceEntityaggregate(DelegatePlanItemInstance planItemInstance, PlanItemVariableAggregatorContext aggregationContext, CmmnEngineConfiguration cmmnEngineConfiguration)Create an aggregated variable instance for the given aggregation context.static VariableInstanceEntityaggregate(DelegatePlanItemInstance planItemInstance, PlanItemVariableAggregatorContext aggregationContext, CmmnEngineConfiguration cmmnEngineConfiguration, PlanItemVariableAggregator aggregator, String targetVarName)static VariableInstanceEntityaggregateComplete(DelegatePlanItemInstance planItemInstance, org.flowable.cmmn.model.VariableAggregationDefinition aggregation, CmmnEngineConfiguration cmmnEngineConfiguration)Create an aggregated variable instance for a completed plan item.static ObjectaggregateOverview(String parentScopeId, String targetVarName, CommandContext commandContext)Aggregate an overview value for the scope and variable namestatic ObjectaggregateOverviewForRepetition(PlanItemInstanceEntity planItemInstance, org.flowable.cmmn.model.RepetitionRule repetitionRule, String targetVarName, CmmnEngineConfiguration cmmnEngineConfiguration)Create an overview value for a repetition plan itemstatic VariableInstanceEntitycreateScopedVariableAggregationVariableInstance(String tenantId, String varName, String scopeId, String subScopeId, Object value, VariableServiceConfiguration variableServiceConfiguration)static StringgetAggregationTargetVarName(org.flowable.cmmn.model.VariableAggregationDefinition aggregation, org.flowable.variable.api.delegate.VariableScope parentScope, CmmnEngineConfiguration cmmnEngineConfiguration)StringgetPlanItemInstanceId()static Map<String,org.flowable.cmmn.model.VariableAggregationDefinition>groupAggregationsByTarget(org.flowable.variable.api.delegate.VariableScope scope, Collection<org.flowable.cmmn.model.VariableAggregationDefinition> aggregations, CmmnEngineConfiguration cmmnEngineConfiguration)static Map<String,List<org.flowable.variable.api.persistence.entity.VariableInstance>>groupVariableInstancesByName(List<? extends org.flowable.variable.api.persistence.entity.VariableInstance> instances)static PlanItemVariableAggregatorresolveVariableAggregator(org.flowable.cmmn.model.VariableAggregationDefinition aggregation, DelegatePlanItemInstance planItemInstance)static voidsortVariablesByCounter(List<org.flowable.variable.api.persistence.entity.VariableInstance> variableInstances, List<org.flowable.variable.api.persistence.entity.VariableInstance> counterVariableInstances)
-
-
-
Field Detail
-
COUNTER_VAR_PREFIX
public static final String COUNTER_VAR_PREFIX
- See Also:
- Constant Field Values
-
COUNTER_VAR_VALUE_SEPARATOR
public static final String COUNTER_VAR_VALUE_SEPARATOR
- See Also:
- Constant Field Values
-
planItemInstanceId
protected final String planItemInstanceId
-
-
Constructor Detail
-
CmmnAggregation
public CmmnAggregation(String planItemInstanceId)
-
-
Method Detail
-
getPlanItemInstanceId
public String getPlanItemInstanceId()
-
aggregateComplete
public static VariableInstanceEntity aggregateComplete(DelegatePlanItemInstance planItemInstance, org.flowable.cmmn.model.VariableAggregationDefinition aggregation, CmmnEngineConfiguration cmmnEngineConfiguration)
Create an aggregated variable instance for a completed plan item.- Parameters:
planItemInstance- the planItemInstance which completedaggregation- the aggregation definitioncmmnEngineConfiguration- the cmmn engine configuration- Returns:
- the created variables (not yet saved), or
nullif no name could be resolved for the variable
-
aggregate
public static VariableInstanceEntity aggregate(DelegatePlanItemInstance planItemInstance, PlanItemVariableAggregatorContext aggregationContext, CmmnEngineConfiguration cmmnEngineConfiguration)
Create an aggregated variable instance for the given aggregation context.- Parameters:
planItemInstance- the planItemInstanceaggregationContext- the aggregation contextcmmnEngineConfiguration- the cmmn engine configuration- Returns:
- the created variables (not yet saved), or
nullif no name could be resolved for the variable
-
aggregate
public static VariableInstanceEntity aggregate(DelegatePlanItemInstance planItemInstance, PlanItemVariableAggregatorContext aggregationContext, CmmnEngineConfiguration cmmnEngineConfiguration, PlanItemVariableAggregator aggregator, String targetVarName)
- Parameters:
planItemInstance- the planItemInstanceaggregationContext- the aggregation contextcmmnEngineConfiguration- the cmmn engine configurationaggregator- the aggregator that should be used to perform the aggregationtargetVarName- the name of the variable, nevernull- Returns:
- the created variables (not yet saved), or
nullif no name could be resolved for the variable
-
aggregateOverview
public static Object aggregateOverview(String parentScopeId, String targetVarName, CommandContext commandContext)
Aggregate an overview value for the scope and variable name- Parameters:
parentScopeId- the id of the scope for which the overview needs to be donetargetVarName- the name of the variable- Returns:
- the aggregated variable value
-
aggregateOverviewForRepetition
public static Object aggregateOverviewForRepetition(PlanItemInstanceEntity planItemInstance, org.flowable.cmmn.model.RepetitionRule repetitionRule, String targetVarName, CmmnEngineConfiguration cmmnEngineConfiguration)
Create an overview value for a repetition plan item- Parameters:
planItemInstance- one of the repetition plan item instancestargetVarName- the name of the variablecmmnEngineConfiguration- the cmmn engine configuration- Returns:
- the overview value for repetition plan items
-
createScopedVariableAggregationVariableInstance
public static VariableInstanceEntity createScopedVariableAggregationVariableInstance(String tenantId, String varName, String scopeId, String subScopeId, Object value, VariableServiceConfiguration variableServiceConfiguration)
-
groupVariableInstancesByName
public static Map<String,List<org.flowable.variable.api.persistence.entity.VariableInstance>> groupVariableInstancesByName(List<? extends org.flowable.variable.api.persistence.entity.VariableInstance> instances)
-
resolveVariableAggregator
public static PlanItemVariableAggregator resolveVariableAggregator(org.flowable.cmmn.model.VariableAggregationDefinition aggregation, DelegatePlanItemInstance planItemInstance)
-
sortVariablesByCounter
public static void sortVariablesByCounter(List<org.flowable.variable.api.persistence.entity.VariableInstance> variableInstances, List<org.flowable.variable.api.persistence.entity.VariableInstance> counterVariableInstances)
-
groupAggregationsByTarget
public static Map<String,org.flowable.cmmn.model.VariableAggregationDefinition> groupAggregationsByTarget(org.flowable.variable.api.delegate.VariableScope scope, Collection<org.flowable.cmmn.model.VariableAggregationDefinition> aggregations, CmmnEngineConfiguration cmmnEngineConfiguration)
-
getAggregationTargetVarName
public static String getAggregationTargetVarName(org.flowable.cmmn.model.VariableAggregationDefinition aggregation, org.flowable.variable.api.delegate.VariableScope parentScope, CmmnEngineConfiguration cmmnEngineConfiguration)
-
-