public Object getValue(ELContext context, Object base, Object property) {
Object object = context.getContext(VariableScope.class);
if (object instanceof VariableScope) {
VariableScope variableScope = (VariableScope) object;
if (base == null) {
String variable = (String) property; // according to javadoc, can only be a String
if( (EXECUTION_KEY.equals(property) && variableScope instanceof ExecutionEntity)
|| (TASK_KEY.equals(property) && variableScope instanceof TaskEntity)
|| (variableScope instanceof CaseExecutionEntity
&& (CASE_EXECUTION_KEY.equals(property) || EXECUTION_KEY.equals(property))) ) {
context.setPropertyResolved(true);
return variableScope;
} else if (EXECUTION_KEY.equals(property) && variableScope instanceof TaskEntity) {
context.setPropertyResolved(true);
return ((TaskEntity) variableScope).getExecution();
} else if(LOGGED_IN_USER_KEY.equals(property)){
context.setPropertyResolved(true);
return Context.getCommandContext().getAuthenticatedUserId();
} else {
if (variableScope.hasVariable(variable)) {
context.setPropertyResolved(true); // if not set, the next elResolver in the CompositeElResolver will be called
return variableScope.getVariable(variable);
}
}
}
}