Class ActivityPolicyRule

java.lang.Object
com.evolveum.midpoint.repo.common.activity.policy.ActivityPolicyRule
All Implemented Interfaces:
DebugDumpable

public class ActivityPolicyRule extends Object implements DebugDumpable
A policy rule that is being evaluated in a context of given activity. - These objects are created when an activity run (AbstractActivityRun) starts - in ActivityPolicyRulesCollector.collectRulesAndPreexistingValues(OperationResult) method. - They are evaluated periodically during the activity run - currently in ActivityPolicyRulesProcessor.evaluateAndExecuteRules(ItemProcessingResult, OperationResult) method. How it is related to EvaluatedActivityPolicyRuleImpl: This class represents the rule as defined in the policy, enriched with data such as current state and counters, and persisted in ActivityPolicyRulesContext throughout an activity run. On the other hand, EvaluatedActivityPolicyRuleImpl is a lightweight wrapper used only during a single evaluation cycle. TODO think of a better name, since this class is responsible for storing activity policy state (counters, data needs, etc.)
  • Constructor Details

  • Method Details

    • getPolicyRuleConfigItem

      @NotNull public @NotNull PolicyRuleConfigItem getPolicyRuleConfigItem()
    • getPath

      @NotNull public @NotNull ActivityPath getPath()
    • getRuleIdentifier

      @NotNull public @NotNull PolicyRuleIdentifier getRuleIdentifier()
    • getName

      public String getName()
    • getOrder

      public Integer getOrder()
    • getLocalCount

      public Integer getLocalCount()
      Local count of the rule, i.e., the count that was computed for the current activity only. It is a part of getTotalCount().
      See Also:
    • getTotalCount

      public Integer getTotalCount()
      Current count that should be used for policy threshold evaluation. This is the result of policy constraint evaluation. For activity trees, this value is the total count for the activity tree, i.e., it contains the relevant data from all activities that were already finished.
    • getCurrentState

      public ActivityPolicyStateType getCurrentState()
    • setCount

      public void setCount(Integer localValue, Integer totalValue)
    • setCurrentState

      public void setCurrentState(ActivityPolicyStateType currentState)
    • getPolicyBean

      @NotNull public @NotNull PolicyRuleType getPolicyBean()
    • getOrigin

      @NotNull public @NotNull ConfigurationItemOrigin getOrigin()
    • doesUseCounters

      public boolean doesUseCounters()
      Does this policy rule need counters to be evaluated? Currently not used, we take all counters from the whole tree.
    • debugDump

      public String debugDump(int indent)
      Specified by:
      debugDump in interface DebugDumpable
    • toString

      public String toString()
      Overrides:
      toString in class Object