Class BpmnAggregation
- java.lang.Object
-
- org.flowable.engine.impl.variable.BpmnAggregation
-
public class BpmnAggregation extends Object
- Author:
- Filip Hrisafov
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOUNTER_VAR_PREFIXstatic StringCOUNTER_VAR_VALUE_SEPARATORprotected StringexecutionId
-
Constructor Summary
Constructors Constructor Description BpmnAggregation(String executionId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VariableInstanceEntityaggregate(DelegateExecution execution, DelegateExecution parentExecution, VariableAggregatorContext aggregationContext, ProcessEngineConfigurationImpl processEngineConfiguration)Create an aggregated variable instance for the given aggregation context.static VariableInstanceEntityaggregate(DelegateExecution execution, DelegateExecution parentExecution, VariableAggregatorContext aggregationContext, ProcessEngineConfigurationImpl processEngineConfiguration, VariableAggregator aggregator, String targetVarName)static VariableInstanceEntityaggregateComplete(DelegateExecution execution, DelegateExecution parentExecution, org.flowable.bpmn.model.VariableAggregationDefinition aggregation, ProcessEngineConfigurationImpl processEngineConfiguration)Create an aggregated variable instance for a completed execution.static ObjectaggregateOverview(String parentExecutionId, String targetVarName, CommandContext commandContext)Aggregate an overview value for the execution and variable namestatic ObjectaggregateOverviewForMultiInstance(ExecutionEntity parentExecution, String targetVarName, ProcessEngineConfigurationImpl processEngineConfiguration)Create an overview value for a multi instance executionstatic VariableInstanceEntitycreateScopedVariableAggregationVariableInstance(String tenantId, String varName, String scopeId, String subScopeId, Object value, VariableServiceConfiguration variableServiceConfiguration)static StringgetAggregationTargetVarName(org.flowable.bpmn.model.VariableAggregationDefinition aggregation, DelegateExecution execution, ProcessEngineConfigurationImpl processEngineConfiguration)StringgetExecutionId()static Map<String,org.flowable.bpmn.model.VariableAggregationDefinition>groupAggregationsByTarget(DelegateExecution multiInstanceRootExecution, Collection<org.flowable.bpmn.model.VariableAggregationDefinition> aggregations, ProcessEngineConfigurationImpl processEngineConfiguration)static Map<String,List<org.flowable.variable.api.persistence.entity.VariableInstance>>groupVariableInstancesByName(List<? extends org.flowable.variable.api.persistence.entity.VariableInstance> instances)static VariableAggregatorresolveVariableAggregator(org.flowable.bpmn.model.VariableAggregationDefinition aggregation, DelegateExecution execution)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
-
executionId
protected final String executionId
-
-
Constructor Detail
-
BpmnAggregation
public BpmnAggregation(String executionId)
-
-
Method Detail
-
getExecutionId
public String getExecutionId()
-
aggregateComplete
public static VariableInstanceEntity aggregateComplete(DelegateExecution execution, DelegateExecution parentExecution, org.flowable.bpmn.model.VariableAggregationDefinition aggregation, ProcessEngineConfigurationImpl processEngineConfiguration)
Create an aggregated variable instance for a completed execution.- Parameters:
execution- the execution which completedparentExecution- the parent executionaggregation- the aggregation definitionprocessEngineConfiguration- the process engine configuration- Returns:
- the created variables (not yet saved), or
nullif no name could be resolved for the variable
-
aggregate
public static VariableInstanceEntity aggregate(DelegateExecution execution, DelegateExecution parentExecution, VariableAggregatorContext aggregationContext, ProcessEngineConfigurationImpl processEngineConfiguration)
Create an aggregated variable instance for the given aggregation context.- Parameters:
execution- the executionparentExecution- the parent executionaggregationContext- the aggregation contextprocessEngineConfiguration- the process engine configuration- Returns:
- the created variables (not yet saved), or
nullif no name could be resolved for the variable
-
aggregate
public static VariableInstanceEntity aggregate(DelegateExecution execution, DelegateExecution parentExecution, VariableAggregatorContext aggregationContext, ProcessEngineConfigurationImpl processEngineConfiguration, VariableAggregator aggregator, String targetVarName)
- Parameters:
execution- the executionparentExecution- the parent executionaggregationContext- the aggregation contextprocessEngineConfiguration- the process 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 parentExecutionId, String targetVarName, CommandContext commandContext)
Aggregate an overview value for the execution and variable name- Parameters:
parentExecutionId- the execution for which the overview needs to be donetargetVarName- the name of the variable- Returns:
- the aggregated variable value
-
aggregateOverviewForMultiInstance
public static Object aggregateOverviewForMultiInstance(ExecutionEntity parentExecution, String targetVarName, ProcessEngineConfigurationImpl processEngineConfiguration)
Create an overview value for a multi instance execution- Parameters:
parentExecution- the multi instance root executiontargetVarName- the name of the variableprocessEngineConfiguration- the process engine configuration- Returns:
- the overview value for the multi instance execution
-
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 VariableAggregator resolveVariableAggregator(org.flowable.bpmn.model.VariableAggregationDefinition aggregation, DelegateExecution execution)
-
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.bpmn.model.VariableAggregationDefinition> groupAggregationsByTarget(DelegateExecution multiInstanceRootExecution, Collection<org.flowable.bpmn.model.VariableAggregationDefinition> aggregations, ProcessEngineConfigurationImpl processEngineConfiguration)
-
getAggregationTargetVarName
public static String getAggregationTargetVarName(org.flowable.bpmn.model.VariableAggregationDefinition aggregation, DelegateExecution execution, ProcessEngineConfigurationImpl processEngineConfiguration)
-
-