use of org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity in project camunda-bpm-platform by camunda.
the class VariableInstanceHandler method handle.
@Override
public void handle(MigratingInstanceParseContext parseContext, MigratingProcessElementInstance owningInstance, List<VariableInstanceEntity> variables) {
ExecutionEntity representativeExecution = owningInstance.resolveRepresentativeExecution();
for (VariableInstanceEntity variable : variables) {
parseContext.consume(variable);
boolean isConcurrentLocalInParentScope = (variable.getExecution() == representativeExecution.getParent() && variable.isConcurrentLocal()) || representativeExecution.isConcurrent();
owningInstance.addMigratingDependentInstance(new MigratingVariableInstance(variable, isConcurrentLocalInParentScope));
}
}
use of org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity in project camunda-bpm-platform by camunda.
the class MigratingUserTaskInstance method attachState.
@Override
public void attachState(MigratingScopeInstance owningInstance) {
ExecutionEntity representativeExecution = owningInstance.resolveRepresentativeExecution();
representativeExecution.addTask(userTask);
for (VariableInstanceEntity variable : userTask.getVariablesInternal()) {
variable.setExecution(representativeExecution);
}
userTask.setExecution(representativeExecution);
}
use of org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity in project camunda-bpm-platform by camunda.
the class AbstractVariableScope method setVariableLocal.
public void setVariableLocal(String variableName, TypedValue value, AbstractVariableScope sourceActivityExecution) {
checkJavaSerialization(variableName, value);
VariableStore<CoreVariableInstance> variableStore = getVariableStore();
if (variableStore.containsKey(variableName)) {
CoreVariableInstance existingInstance = variableStore.getVariable(variableName);
existingInstance.setValue(value);
invokeVariableLifecycleListenersUpdate(existingInstance, sourceActivityExecution);
} else if (variableStore.isRemoved(variableName)) {
CoreVariableInstance existingInstance = variableStore.getRemovedVariable(variableName);
existingInstance.setValue(value);
getVariableStore().addVariable(existingInstance);
invokeVariableLifecycleListenersUpdate(existingInstance, sourceActivityExecution);
DbEntityManager dbEntityManager = Context.getCommandContext().getDbEntityManager();
dbEntityManager.undoDelete((VariableInstanceEntity) existingInstance);
} else {
CoreVariableInstance variableValue = getVariableInstanceFactory().build(variableName, value, false);
getVariableStore().addVariable(variableValue);
invokeVariableLifecycleListenersCreate(variableValue, sourceActivityExecution);
}
}
Aggregations