Search in sources :

Example 1 with ModificationPolicyConstraintType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ModificationPolicyConstraintType in project midpoint by Evolveum.

the class FocusProcessor method triggerRule.

private <F extends FocusType> void triggerRule(LensFocusContext<F> focusContext, EvaluatedPolicyRule policyRule) throws PolicyViolationException, SchemaException {
    PolicyConstraintsType policyConstraints = policyRule.getPolicyConstraints();
    if (policyConstraints == null) {
        return;
    }
    for (ModificationPolicyConstraintType modificationConstraintType : policyConstraints.getModification()) {
        focusContext.addPolicyRule(policyRule);
        if (modificationConstraintMatches(focusContext, policyRule, modificationConstraintType)) {
            EvaluatedPolicyRuleTrigger<?> trigger = new EvaluatedPolicyRuleTrigger<>(PolicyConstraintKindType.MODIFICATION, modificationConstraintType, "Focus " + focusContext.getHumanReadableName() + " was modified");
            focusContext.triggerConstraint(policyRule, trigger);
        }
    }
}
Also used : PolicyConstraintsType(com.evolveum.midpoint.xml.ns._public.common.common_3.PolicyConstraintsType) EvaluatedPolicyRuleTrigger(com.evolveum.midpoint.model.api.context.EvaluatedPolicyRuleTrigger) ModificationPolicyConstraintType(com.evolveum.midpoint.xml.ns._public.common.common_3.ModificationPolicyConstraintType)

Aggregations

EvaluatedPolicyRuleTrigger (com.evolveum.midpoint.model.api.context.EvaluatedPolicyRuleTrigger)1 ModificationPolicyConstraintType (com.evolveum.midpoint.xml.ns._public.common.common_3.ModificationPolicyConstraintType)1 PolicyConstraintsType (com.evolveum.midpoint.xml.ns._public.common.common_3.PolicyConstraintsType)1