protected RestVariable setSimpleVariable(RestVariable restVariable, Task task, boolean isNew) { if (restVariable.getName() == null) { throw new ActivitiIllegalArgumentException("Variable name is required"); } // Figure out scope, revert to local is omitted RestVariableScope scope = restVariable.getVariableScope(); if (scope == null) { scope = RestVariableScope.LOCAL; } Object actualVariableValue = restResponseFactory.getVariableValue(restVariable); setVariable(task, restVariable.getName(), actualVariableValue, scope, isNew); return restResponseFactory.createRestVariable( restVariable.getName(), actualVariableValue, scope, task.getId(), RestResponseFactory.VARIABLE_TASK, false); }