Search in sources :

Example 1 with ActionType

use of org.akaza.openclinica.bean.rule.action.ActionType in project OpenClinica by OpenClinica.

the class RuleActionDAO method getEntityFromHashMap.

public RuleActionBean getEntityFromHashMap(HashMap hm) {
    int actionTypeId = ((Integer) hm.get("action_type")).intValue();
    ActionType actionType = ActionType.getByCode(actionTypeId);
    RuleActionBean ruleAction = null;
    switch(actionType) {
        case FILE_DISCREPANCY_NOTE:
            ruleAction = new DiscrepancyNoteActionBean();
            ((DiscrepancyNoteActionBean) ruleAction).setMessage(((String) hm.get("message")));
        case EMAIL:
            ruleAction = new EmailActionBean();
            ((EmailActionBean) ruleAction).setMessage(((String) hm.get("message")));
            ((EmailActionBean) ruleAction).setTo(((String) hm.get("email_to")));
    }
    this.setEntityAuditInformation(ruleAction, hm);
    ruleAction.setActionType(actionType);
    ruleAction.setId(((Integer) hm.get("rule_action_id")).intValue());
    ruleAction.setExpressionEvaluatesTo(((Boolean) hm.get("expression_evaluates_to")).booleanValue());
    return ruleAction;
}
Also used : RuleActionBean(org.akaza.openclinica.bean.rule.action.RuleActionBean) DiscrepancyNoteActionBean(org.akaza.openclinica.bean.rule.action.DiscrepancyNoteActionBean) ActionType(org.akaza.openclinica.bean.rule.action.ActionType) EmailActionBean(org.akaza.openclinica.bean.rule.action.EmailActionBean)

Aggregations

ActionType (org.akaza.openclinica.bean.rule.action.ActionType)1 DiscrepancyNoteActionBean (org.akaza.openclinica.bean.rule.action.DiscrepancyNoteActionBean)1 EmailActionBean (org.akaza.openclinica.bean.rule.action.EmailActionBean)1 RuleActionBean (org.akaza.openclinica.bean.rule.action.RuleActionBean)1