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;
}
Aggregations