@Override public void setVariableLocal(String variableName, Object value) { ExecutionEntity execution = getExecutionFromContext(); if(execution != null) { execution.setVariableLocal(variableName, value); execution.getVariableLocal(variableName); } else { getScopedAssociation().setVariableLocal(variableName, value); } }
@Override public void execute(DelegateExecution execution) throws Exception { Task task = execution.getProcessEngineServices().getTaskService().createTaskQuery().taskName(TASK_WITH_CONDITION).singleResult(); ((TaskEntity) task).getExecution().setVariableLocal(VARIABLE_NAME, 1); execution.setVariableLocal(VARIABLE_NAME+1, 1); } }
eventScopeExecution.setVariableLocal(variable.getKey(), variable.getValue());
eventScopeExecution.setVariableLocal(variable.getKey(), variable.getValue());
public Void execute(CommandContext commandContext) { ExecutionEntity execution = commandContext.getExecutionManager() .findExecutionById(executionId); // fetch the variable instance but not the value (make sure the byte array is lazily fetched) VariableInstanceEntity varInstance = (VariableInstanceEntity) execution.getVariableInstanceLocal(varName); String byteArrayValueId = varInstance.getByteArrayValueId(); assertNotNull("Byte array id is expected to be not null", byteArrayValueId); CachedDbEntity cachedByteArray = commandContext.getDbEntityManager().getDbEntityCache() .getCachedEntity(ByteArrayEntity.class, byteArrayValueId); assertNull("Byte array is expected to be not fetched yet / lazily fetched.", cachedByteArray); monitor.sync(); // now update the value execution.setVariableLocal(varInstance.getName(), newValue); return null; }
@Override public void setVariableLocal(String variableName, Object value) { ExecutionEntity execution = getExecutionFromContext(); if(execution != null) { execution.setVariableLocal(variableName, value); execution.getVariableLocal(variableName); } else { getScopedAssociation().setVariableLocal(variableName, value); } }
@Override public void execute(DelegateExecution execution) throws Exception { Task task = execution.getProcessEngineServices().getTaskService().createTaskQuery().taskName(TASK_WITH_CONDITION).singleResult(); ((TaskEntity) task).getExecution().setVariableLocal(VARIABLE_NAME, 1); execution.setVariableLocal(VARIABLE_NAME+1, 1); } }
eventScopeExecution.setVariableLocal(variable.getKey(), variable.getValue());
public Void execute(CommandContext commandContext) { ExecutionEntity execution = commandContext.getExecutionManager() .findExecutionById(executionId); // fetch the variable instance but not the value (make sure the byte array is lazily fetched) VariableInstanceEntity varInstance = (VariableInstanceEntity) execution.getVariableInstanceLocal(varName); String byteArrayValueId = varInstance.getByteArrayValueId(); assertNotNull("Byte array id is expected to be not null", byteArrayValueId); CachedDbEntity cachedByteArray = commandContext.getDbEntityManager().getDbEntityCache() .getCachedEntity(ByteArrayEntity.class, byteArrayValueId); assertNull("Byte array is expected to be not fetched yet / lazily fetched.", cachedByteArray); monitor.sync(); // now update the value execution.setVariableLocal(varInstance.getName(), newValue); return null; }