use of org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity in project camunda-bpm-platform by camunda.
the class DbOperationsOrderingTest method setup.
@Before
public void setup() {
TestIdGenerator idGenerator = new TestIdGenerator();
entityManager = new ExposingDbEntityManager(idGenerator, null);
execution1 = new ExecutionEntity();
execution1.setId("101");
execution2 = new ExecutionEntity();
execution2.setId("102");
execution3 = new ExecutionEntity();
execution3.setId("103");
execution4 = new ExecutionEntity();
execution4.setId("104");
execution5 = new ExecutionEntity();
execution5.setId("105");
execution6 = new ExecutionEntity();
execution6.setId("106");
execution7 = new ExecutionEntity();
execution7.setId("107");
execution8 = new ExecutionEntity();
execution8.setId("108");
task1 = new TaskEntity();
task1.setId("104");
task2 = new TaskEntity();
task2.setId("105");
task3 = new TaskEntity();
task3.setId("106");
task4 = new TaskEntity();
task4.setId("107");
variable1 = new VariableInstanceEntity();
variable1.setId("108");
variable2 = new VariableInstanceEntity();
variable2.setId("109");
variable3 = new VariableInstanceEntity();
variable3.setId("110");
variable4 = new VariableInstanceEntity();
variable4.setId("111");
}
use of org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity in project camunda-bpm-platform by camunda.
the class FilterResourceImpl method getSortedVariableInstances.
protected Map<String, List<VariableInstance>> getSortedVariableInstances(Collection<String> variableNames, Collection<String> variableScopeIds) {
List<VariableInstance> variableInstances = queryVariablesInstancesByVariableScopeIds(variableNames, variableScopeIds);
Map<String, List<VariableInstance>> sortedVariableInstances = new HashMap<String, List<VariableInstance>>();
for (VariableInstance variableInstance : variableInstances) {
String variableScopeId = ((VariableInstanceEntity) variableInstance).getVariableScopeId();
if (!sortedVariableInstances.containsKey(variableScopeId)) {
sortedVariableInstances.put(variableScopeId, new ArrayList<VariableInstance>());
}
sortedVariableInstances.get(variableScopeId).add(variableInstance);
}
return sortedVariableInstances;
}
use of org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity in project camunda-bpm-platform by camunda.
the class UserTaskActivityBehavior method onParseMigratingInstance.
@Override
public void onParseMigratingInstance(MigratingInstanceParseContext parseContext, MigratingActivityInstance migratingInstance) {
ExecutionEntity execution = migratingInstance.resolveRepresentativeExecution();
for (TaskEntity task : execution.getTasks()) {
migratingInstance.addMigratingDependentInstance(new MigratingUserTaskInstance(task, migratingInstance));
parseContext.consume(task);
Collection<VariableInstanceEntity> variables = task.getVariablesInternal();
if (variables != null) {
for (VariableInstanceEntity variable : variables) {
// we don't need to represent task variables in the migrating instance structure because
// they are migrated by the MigratingTaskInstance as well
parseContext.consume(variable);
}
}
}
}
use of org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity in project camunda-bpm-platform by camunda.
the class ActivityInstanceHandler method collectActivityInstanceVariables.
protected List<VariableInstanceEntity> collectActivityInstanceVariables(MigratingActivityInstance instance) {
List<VariableInstanceEntity> variables = new ArrayList<VariableInstanceEntity>();
ExecutionEntity representativeExecution = instance.resolveRepresentativeExecution();
ExecutionEntity parentExecution = representativeExecution.getParent();
// decide for representative execution and parent execution whether to none/all/concurrentLocal variables
// belong to this activity instance
boolean addAllRepresentativeExecutionVariables = instance.getSourceScope().isScope() || representativeExecution.isConcurrent();
if (addAllRepresentativeExecutionVariables) {
variables.addAll(representativeExecution.getVariablesInternal());
} else {
variables.addAll(getConcurrentLocalVariables(representativeExecution));
}
boolean addAnyParentExecutionVariables = parentExecution != null && instance.getSourceScope().isScope();
if (addAnyParentExecutionVariables) {
boolean addAllParentExecutionVariables = parentExecution.isConcurrent();
if (addAllParentExecutionVariables) {
variables.addAll(parentExecution.getVariablesInternal());
} else {
variables.addAll(getConcurrentLocalVariables(parentExecution));
}
}
return variables;
}
use of org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity in project camunda-bpm-platform by camunda.
the class CompensationInstanceHandler method parseDependentEntities.
protected void parseDependentEntities(MigratingInstanceParseContext parseContext, MigratingEventScopeInstance migratingInstance) {
ExecutionEntity representativeExecution = migratingInstance.resolveRepresentativeExecution();
List<VariableInstanceEntity> variables = new ArrayList<VariableInstanceEntity>(representativeExecution.getVariablesInternal());
parseContext.handleDependentVariables(migratingInstance, variables);
}
Aggregations