// get first identity to use this identity for condition interpreter
Identity identity = getGroupIdentitiesFromGroupmanagement(group).get(0);
IdentityEnvironment identityEnvironment = new IdentityEnvironment();
identityEnvironment.setIdentity(identity);
UserCourseEnvironment uce = new UserCourseEnvironmentImpl(identityEnvironment, course.getCourseEnvironment());
OnlyGroupConditionInterpreter ci = new OnlyGroupConditionInterpreter(uce);
List listOfConditionExpressions = courseNode.getConditionExpressions();
boolean allConditionAreValid = true;
// loop over all conditions, all must be true
for (Iterator iter = listOfConditionExpressions.iterator(); iter.hasNext();) {
ConditionExpression conditionExpression = (ConditionExpression) iter.next();
Tracing.logDebug("conditionExpression=" + conditionExpression, this.getClass());
Tracing.logDebug("conditionExpression.getId()=" + conditionExpression.getId(), this.getClass());
Condition condition = new Condition();
condition.setConditionId(conditionExpression.getId());
condition.setConditionExpression(conditionExpression.getExptressionString());
if ( !ci.evaluateCondition(condition) ) {
allConditionAreValid = false;
}
}
return allConditionAreValid;
}