Search in sources :

Example 36 with ReminderRule

use of org.olat.modules.reminder.ReminderRule in project openolat by klemens.

the class ReminderRuleEngineTest method getRepositoryEntryLifecycleRuleValidFromRule.

private List<ReminderRule> getRepositoryEntryLifecycleRuleValidFromRule(int amount, LaunchUnit unit) {
    ReminderRuleImpl rule = new ReminderRuleImpl();
    rule.setType(RepositoryEntryLifecycleAfterValidFromRuleSPI.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) ArrayList(java.util.ArrayList) RepositoryEntryLifecycleAfterValidFromRuleSPI(org.olat.modules.reminder.rule.RepositoryEntryLifecycleAfterValidFromRuleSPI)

Example 37 with ReminderRule

use of org.olat.modules.reminder.ReminderRule in project openolat by klemens.

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)

Example 38 with ReminderRule

use of org.olat.modules.reminder.ReminderRule in project openolat by klemens.

the class ReminderRuleEngineTest method getAttemptsRules.

private List<ReminderRule> getAttemptsRules(String operator, int value, String nodeIdent) {
    ReminderRuleImpl rule = new ReminderRuleImpl();
    rule.setType(AttemptsRuleSPI.class.getSimpleName());
    rule.setLeftOperand(nodeIdent);
    rule.setOperator(operator);
    rule.setRightOperand(Integer.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) AttemptsRuleSPI(org.olat.course.reminder.rule.AttemptsRuleSPI) InitialAttemptsRuleSPI(org.olat.course.reminder.rule.InitialAttemptsRuleSPI) ArrayList(java.util.ArrayList)

Example 39 with ReminderRule

use of org.olat.modules.reminder.ReminderRule in project openolat by klemens.

the class ReminderRuleEngineTest method getRepositoryEntryLifecycleRuleValidToRule.

private List<ReminderRule> getRepositoryEntryLifecycleRuleValidToRule(int amount, LaunchUnit unit) {
    ReminderRuleImpl rule = new ReminderRuleImpl();
    rule.setType(RepositoryEntryLifecycleAfterValidToRuleSPI.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) ArrayList(java.util.ArrayList) RepositoryEntryLifecycleAfterValidToRuleSPI(org.olat.modules.reminder.rule.RepositoryEntryLifecycleAfterValidToRuleSPI)

Example 40 with ReminderRule

use of org.olat.modules.reminder.ReminderRule in project openolat by klemens.

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)

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