Search in sources :

Example 1 with ReminderRule

use of org.olat.modules.reminder.ReminderRule in project OpenOLAT by OpenOLAT.

the class ReminderRuleEngineTest method getRules.

private List<ReminderRule> getRules(String propertyName, String value) {
    ReminderRuleImpl rule = new ReminderRuleImpl();
    rule.setType(UserPropertyRuleSPI.class.getSimpleName());
    rule.setLeftOperand(propertyName);
    rule.setOperator("=");
    rule.setRightOperand(value);
    List<ReminderRule> rules = new ArrayList<>(1);
    rules.add(rule);
    return rules;
}
Also used : ReminderRule(org.olat.modules.reminder.ReminderRule) ReminderRuleImpl(org.olat.modules.reminder.model.ReminderRuleImpl) UserPropertyRuleSPI(org.olat.modules.reminder.rule.UserPropertyRuleSPI) ArrayList(java.util.ArrayList)

Example 2 with ReminderRule

use of org.olat.modules.reminder.ReminderRule in project OpenOLAT by OpenOLAT.

the class ReminderRuleEngineTest method getRules.

private List<ReminderRule> getRules(RepositoryEntryRoleRuleSPI.Roles option) {
    ReminderRuleImpl rule = new ReminderRuleImpl();
    rule.setType(RepositoryEntryRoleRuleSPI.class.getSimpleName());
    rule.setOperator("=");
    rule.setRightOperand(option.name());
    List<ReminderRule> rules = new ArrayList<>(1);
    rules.add(rule);
    return rules;
}
Also used : ReminderRule(org.olat.modules.reminder.ReminderRule) ReminderRuleImpl(org.olat.modules.reminder.model.ReminderRuleImpl) ArrayList(java.util.ArrayList) RepositoryEntryRoleRuleSPI(org.olat.modules.reminder.rule.RepositoryEntryRoleRuleSPI)

Example 3 with ReminderRule

use of org.olat.modules.reminder.ReminderRule in project OpenOLAT by OpenOLAT.

the class ReminderRuleEngineTest method getCourseEnrollmentDateRules.

private List<ReminderRule> getCourseEnrollmentDateRules(int amount, LaunchUnit unit) {
    ReminderRuleImpl rule = new ReminderRuleImpl();
    rule.setType(CourseEnrollmentDateRuleSPI.class.getSimpleName());
    rule.setOperator(">");
    rule.setRightOperand(Integer.toString(amount));
    rule.setRightUnit(unit.name());
    List<ReminderRule> rules = new ArrayList<>(1);
    rules.add(rule);
    return rules;
}
Also used : ReminderRule(org.olat.modules.reminder.ReminderRule) ReminderRuleImpl(org.olat.modules.reminder.model.ReminderRuleImpl) CourseEnrollmentDateRuleSPI(org.olat.modules.reminder.rule.CourseEnrollmentDateRuleSPI) ArrayList(java.util.ArrayList)

Example 4 with ReminderRule

use of org.olat.modules.reminder.ReminderRule in project OpenOLAT by OpenOLAT.

the class ReminderRuleEngineTest method getInitialLaunchRules.

private List<ReminderRule> getInitialLaunchRules(int amount, LaunchUnit unit) {
    ReminderRuleImpl rule = new ReminderRuleImpl();
    rule.setType(InitialCourseLaunchRuleSPI.class.getSimpleName());
    rule.setOperator(">");
    rule.setRightOperand(Integer.toString(amount));
    rule.setRightUnit(unit.name());
    List<ReminderRule> rules = new ArrayList<>(1);
    rules.add(rule);
    return rules;
}
Also used : InitialCourseLaunchRuleSPI(org.olat.modules.reminder.rule.InitialCourseLaunchRuleSPI) ReminderRule(org.olat.modules.reminder.ReminderRule) ReminderRuleImpl(org.olat.modules.reminder.model.ReminderRuleImpl) ArrayList(java.util.ArrayList)

Example 5 with ReminderRule

use of org.olat.modules.reminder.ReminderRule in project OpenOLAT by OpenOLAT.

the class ReminderRuleEngineTest method getScoreRules.

private List<ReminderRule> getScoreRules(String operator, float value, String nodeIdent) {
    ReminderRuleImpl rule = new ReminderRuleImpl();
    rule.setType(ScoreRuleSPI.class.getSimpleName());
    rule.setLeftOperand(nodeIdent);
    rule.setOperator(operator);
    rule.setRightOperand(Float.toString(value));
    List<ReminderRule> rules = new ArrayList<>(1);
    rules.add(rule);
    return rules;
}
Also used : ReminderRule(org.olat.modules.reminder.ReminderRule) ReminderRuleImpl(org.olat.modules.reminder.model.ReminderRuleImpl) ScoreRuleSPI(org.olat.course.reminder.rule.ScoreRuleSPI) ArrayList(java.util.ArrayList)

Aggregations

ReminderRule (org.olat.modules.reminder.ReminderRule)46 ArrayList (java.util.ArrayList)32 ReminderRuleImpl (org.olat.modules.reminder.model.ReminderRuleImpl)26 RuleSPI (org.olat.modules.reminder.RuleSPI)12 ReminderRules (org.olat.modules.reminder.model.ReminderRules)12 DateRuleSPI (org.olat.modules.reminder.rule.DateRuleSPI)10 RepositoryEntryRoleRuleSPI (org.olat.modules.reminder.rule.RepositoryEntryRoleRuleSPI)8 UserPropertyRuleSPI (org.olat.modules.reminder.rule.UserPropertyRuleSPI)8 Identity (org.olat.core.id.Identity)6 FilterRuleSPI (org.olat.modules.reminder.FilterRuleSPI)6 IdentitiesProviderRuleSPI (org.olat.modules.reminder.IdentitiesProviderRuleSPI)6 RepositoryEntryRuleSPI (org.olat.modules.reminder.RepositoryEntryRuleSPI)6 BusinessGroupRoleRuleSPI (org.olat.modules.reminder.rule.BusinessGroupRoleRuleSPI)6 InitialAttemptsRuleSPI (org.olat.course.reminder.rule.InitialAttemptsRuleSPI)4 Reminder (org.olat.modules.reminder.Reminder)4 ReminderModule (org.olat.modules.reminder.ReminderModule)4 ReminderService (org.olat.modules.reminder.ReminderService)4 CourseEnrollmentDateRuleSPI (org.olat.modules.reminder.rule.CourseEnrollmentDateRuleSPI)4 ParseException (java.text.ParseException)2 Calendar (java.util.Calendar)2