Search in sources :

Example 11 with VariableInstanceEntity

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));
    }
}
Also used : ExecutionEntity(org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity) MigratingVariableInstance(org.camunda.bpm.engine.impl.migration.instance.MigratingVariableInstance) VariableInstanceEntity(org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity)

Example 12 with VariableInstanceEntity

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);
}
Also used : ExecutionEntity(org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity) VariableInstanceEntity(org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity)

Example 13 with VariableInstanceEntity

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);
    }
}
Also used : CoreVariableInstance(org.camunda.bpm.engine.impl.core.variable.CoreVariableInstance) DbEntityManager(org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager) VariableInstanceEntity(org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity)

Aggregations

VariableInstanceEntity (org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity)13 ExecutionEntity (org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity)9 ArrayList (java.util.ArrayList)3 TaskEntity (org.camunda.bpm.engine.impl.persistence.entity.TaskEntity)3 CoreVariableInstance (org.camunda.bpm.engine.impl.core.variable.CoreVariableInstance)2 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)2 VariableInstance (org.camunda.bpm.engine.runtime.VariableInstance)2 VariableInstanceLifecycleListener (org.camunda.bpm.engine.impl.core.variable.scope.VariableInstanceLifecycleListener)1 DbEntityManager (org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager)1 MigratingActivityInstance (org.camunda.bpm.engine.impl.migration.instance.MigratingActivityInstance)1 MigratingUserTaskInstance (org.camunda.bpm.engine.impl.migration.instance.MigratingUserTaskInstance)1 MigratingVariableInstance (org.camunda.bpm.engine.impl.migration.instance.MigratingVariableInstance)1 EventSubscriptionEntity (org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity)1 ExternalTaskEntity (org.camunda.bpm.engine.impl.persistence.entity.ExternalTaskEntity)1 IncidentEntity (org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity)1 JobDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.JobDefinitionEntity)1 JobEntity (org.camunda.bpm.engine.impl.persistence.entity.JobEntity)1 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)1 ActivityExecution (org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution)1 ActivityImpl (org.camunda.bpm.engine.impl.pvm.process.ActivityImpl)1