Search in sources :

Example 1 with EvaluatedPolicyRuleTriggerType

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

the class EvaluatedTriggerGroupDto method initializeFromRules.

public static EvaluatedTriggerGroupDto initializeFromRules(List<EvaluatedPolicyRuleType> rules, boolean highlighted, UniquenessFilter uniquenessFilter) {
    List<AugmentedTrigger<HighlightingInformation>> augmentedTriggers = new ArrayList<>();
    for (EvaluatedPolicyRuleType rule : rules) {
        for (EvaluatedPolicyRuleTriggerType trigger : rule.getTrigger()) {
            augmentedTriggers.add(new AugmentedTrigger<>(trigger, new HighlightingInformation(highlighted)));
        }
    }
    List<TreeNode<AugmentedTrigger<HighlightingInformation>>> triggerTrees = arrangeForPresentationExt(augmentedTriggers, uniquenessFilter);
    return new EvaluatedTriggerGroupDto(null, triggerTrees);
}
Also used : AugmentedTrigger(com.evolveum.midpoint.model.api.util.EvaluatedPolicyRuleUtil.AugmentedTrigger) EvaluatedPolicyRuleType(com.evolveum.midpoint.xml.ns._public.common.common_3.EvaluatedPolicyRuleType) EvaluatedPolicyRuleTriggerType(com.evolveum.midpoint.xml.ns._public.common.common_3.EvaluatedPolicyRuleTriggerType) TreeNode(com.evolveum.midpoint.util.TreeNode) ArrayList(java.util.ArrayList)

Example 2 with EvaluatedPolicyRuleTriggerType

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

the class EvaluatedPolicyRuleTrigger method toEvaluatedPolicyRuleTriggerType.

public EvaluatedPolicyRuleTriggerType toEvaluatedPolicyRuleTriggerType(EvaluatedPolicyRule owningRule) {
    EvaluatedPolicyRuleTriggerType rv = new EvaluatedPolicyRuleTriggerType();
    fillCommonContent(rv, owningRule);
    return rv;
}
Also used : EvaluatedPolicyRuleTriggerType(com.evolveum.midpoint.xml.ns._public.common.common_3.EvaluatedPolicyRuleTriggerType)

Example 3 with EvaluatedPolicyRuleTriggerType

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

the class EvaluatedPolicyRuleTrigger method fillCommonContent.

protected void fillCommonContent(EvaluatedPolicyRuleTriggerType tt, EvaluatedPolicyRule owningRule) {
    tt.setRuleName(owningRule.getName());
    tt.setConstraintKind(constraintKind);
    tt.setConstraint(constraint);
    tt.setMessage(message);
    if (owningRule.getAssignmentPath() != null) {
        tt.setAssignmentPath(owningRule.getAssignmentPath().toAssignmentPathType());
    }
    ObjectType directOwner = owningRule.getDirectOwner();
    if (directOwner != null) {
        tt.setDirectOwnerRef(ObjectTypeUtil.createObjectRef(directOwner));
        tt.setDirectOwnerDisplayName(ObjectTypeUtil.getDisplayName(directOwner));
    }
}
Also used : ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)

Aggregations

EvaluatedPolicyRuleTriggerType (com.evolveum.midpoint.xml.ns._public.common.common_3.EvaluatedPolicyRuleTriggerType)2 AugmentedTrigger (com.evolveum.midpoint.model.api.util.EvaluatedPolicyRuleUtil.AugmentedTrigger)1 TreeNode (com.evolveum.midpoint.util.TreeNode)1 EvaluatedPolicyRuleType (com.evolveum.midpoint.xml.ns._public.common.common_3.EvaluatedPolicyRuleType)1 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)1 ArrayList (java.util.ArrayList)1