Search in sources :

Example 1 with ProgramRuleActionValidationContext

use of org.hisp.dhis.programrule.action.validation.ProgramRuleActionValidationContext in project dhis2-core by dhis2.

the class ProgramRuleActionObjectBundleHook method validateProgramRuleAction.

private ProgramRuleActionValidationResult validateProgramRuleAction(ProgramRuleAction ruleAction, ObjectBundle bundle) {
    ProgramRuleActionValidationResult validationResult;
    ProgramRuleActionValidationContext validationContext = contextLoader.load(bundle.getPreheat(), bundle.getPreheatIdentifier(), ruleAction);
    ProgramRuleActionValidator validator = programRuleActionValidatorMap.get(ruleAction.getProgramRuleActionType());
    validationResult = validator.validate(ruleAction, validationContext);
    return validationResult;
}
Also used : ProgramRuleActionValidationResult(org.hisp.dhis.programrule.ProgramRuleActionValidationResult) ProgramRuleActionValidator(org.hisp.dhis.programrule.action.validation.ProgramRuleActionValidator) ProgramRuleActionValidationContext(org.hisp.dhis.programrule.action.validation.ProgramRuleActionValidationContext)

Aggregations

ProgramRuleActionValidationResult (org.hisp.dhis.programrule.ProgramRuleActionValidationResult)1 ProgramRuleActionValidationContext (org.hisp.dhis.programrule.action.validation.ProgramRuleActionValidationContext)1 ProgramRuleActionValidator (org.hisp.dhis.programrule.action.validation.ProgramRuleActionValidator)1