Class PolicyRuleApplicabilityUtil

java.lang.Object
com.evolveum.midpoint.schema.policy.PolicyRuleApplicabilityUtil

public class PolicyRuleApplicabilityUtil extends Object
Code to determine whether a policy rule is to be applied in a given situation, i.e., when the application to a focus object, an assignment, a projection, or an activity is being considered. The idea is that during processing, we gather policy rules from various sources (from system configuration, from object marks, from assignments, from tasks/activities) and we have to know which of them should be applied e.g. when a specific assignment is being processed. General algorithm for applicability determination is: . If `evaluationTarget` (`assignment`, `object`, `projection`, `activity`) for the rule is set, it is used as authoritative information. . If it's not (which is good for simplicity), we apply some heuristics based on the constraints used in the rule. See specific methods for details.
  • Constructor Details

    • PolicyRuleApplicabilityUtil

      public PolicyRuleApplicabilityUtil()
  • Method Details

    • isApplicableToAssignment

      public static boolean isApplicableToAssignment(PolicyRuleType rule)
      Returns true if this policy rule can be applied to an assignment.
      See Also:
    • isApplicableToFocusObject

      public static boolean isApplicableToFocusObject(PolicyRuleType rule)
      Returns true if this policy rule can be applied to a focus object as a whole.
      See Also:
    • isApplicableToProjection

      public static boolean isApplicableToProjection(PolicyRuleType rule)
      Returns true if this policy rule can be applied to a projection. Currently, we don't provide heuristics here. These rules must be explicitly marked by `evaluationTarget`.
      See Also:
    • isApplicableToActivity

      public static boolean isApplicableToActivity(PolicyRuleType rule)
      Returns true if this policy rule can be applied to a projection. Currently, we don't support `evaluationTarget` setting here, because the distinction can be based solely on the presence of activity-specific constraints.