}
public Map<String, Object> execute(CommandContext commandContext) {
ensureNotNull("caseExecutionId", caseExecutionId);
CaseExecutionEntity caseExecution = commandContext
.getCaseExecutionManager()
.findCaseExecutionById(caseExecutionId);
ensureNotNull(CaseExecutionNotFoundException.class, "case execution " + caseExecutionId + " doesn't exist", "caseExecution", caseExecution);
Map<String, Object> caseExecutionVariables;
if (isLocal) {
caseExecutionVariables = caseExecution.getVariablesLocal();
} else {
caseExecutionVariables = caseExecution.getVariables();
}
if (variableNames != null && variableNames.size() > 0) {
// if variableNames is not empty, return only variable names mentioned in it
Map<String, Object> tempVariables = new HashMap<String, Object>();