Interface EvaluatedPolicyRule
- All Superinterfaces:
Cloneable,DebugDumpable,Serializable
- All Known Subinterfaces:
DirectlyEvaluatedClockworkPolicyRule,EvaluatedClockworkPolicyRule,ForeignEvaluatedClockworkPolicyRule
- All Known Implementing Classes:
BaseEvaluatedPolicyRuleImpl,DirectlyEvaluatedClockworkPolicyRuleImpl,EvaluatedActivityPolicyRuleImpl,ForeignEvaluatedClockworkPolicyRuleImpl
Common interface for policy rules obtained from different places and evaluated at different places.
E.g. policy rules from task activities, task assignments or global rules from system configuration.
TODO sort the methods in some logical order, document them, etc.
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Method Summary
Modifier and TypeMethodDescriptiondefault booleandefault booleancontainsEnabledAction(Class<? extends PolicyActionType> type) Are there any enabled actions of given type?default @NotNull List<PolicyActionType>Returns actions (beans) defined for the policy rule - in the form of a list, not the structuredPolicyActionsType.default @NotNull Collection<String>@NotNull Collection<EvaluatedPolicyRuleTrigger<?>>Returns all triggers, even those that were indirectly collected via situation policy rules.<T extends EvaluatedPolicyRuleTrigger<?>>
Collection<T>getAllTriggers(Class<T> type) Returns all triggers of given type, stepping down to situation policy rules and composite triggers.getCount()default <T extends PolicyActionType>
@Nullable PolicyActionConfigItem<T>getEnabledAction(Class<T> type) Returns enabled action of given type, if there's any.Collection<? extends PolicyActionConfigItem<?>>Returns all enabled actions.default <T extends PolicyActionType>
@NotNull List<? extends PolicyActionConfigItem<T>>getEnabledActions(Class<T> type) Returns all enabled actions of given type.default StringgetName()Name of the policy rule, as configured.default IntegergetOrder()default PolicyConstraintsTypedefault @NotNull List<ObjectReferenceType>default @NotNull PolicyRuleType@NotNull AbstractPolicyRuleConfigItem<?>@Nullable StringReturns the policy situation connected to this rule.default PolicyThresholdTypedefault PolicyActionsType@NotNull PolicyRuleIdentifierAutomatically generated identifier that - we hope - uniquely identifies the policy rule.default @NotNull ConfigurationItemOrigin@NotNull Collection<EvaluatedPolicyRuleTrigger<?>>Returns triggers for this policy rule, except for ones triggered by related situation policy rules.default booleandefault booleandefault booleanisContainedIn(Collection<? extends EvaluatedPolicyRule> rules) Returnstrueif this rule is present in the provided collection of rules.default booleanEvaluates whether the current count is over the threshold defined in the policy rule.booleanWas this rule triggered, i.e. are there any triggers?void@NotNull Collection<EvaluatedPolicyRuleType>toEvaluatedPolicyRuleBeans(@NotNull PolicyRuleExternalizationOptions options, @Nullable Predicate<EvaluatedPolicyRuleTrigger<?>> triggerSelector) Serializes the policy rule into bean form (EvaluatedPolicyRuleType)default voidtrigger(EvaluatedPolicyRuleTrigger<?> trigger) voidtrigger(Collection<EvaluatedPolicyRuleTrigger<?>> triggers) Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDump, debugDumpLazily, debugDumpLazily
-
Method Details
-
getRuleIdentifier
Automatically generated identifier that - we hope - uniquely identifies the policy rule. -
getActivityPath
ActivityPath getActivityPath() -
getAllTriggers
Returns all triggers of given type, stepping down to situation policy rules and composite triggers. An exception are composite "not" triggers: it is usually of no use to collect negated triggers. -
getPolicyConstraints
-
getPolicyThreshold
-
getRawActions
-
getPolicyRuleConfigItem
-
getAllEventMarksOids
-
getPolicyRuleBean
-
getRuleOrigin
-
getName
Name of the policy rule, as configured. -
getOrder
-
containsEnabledAction
default boolean containsEnabledAction() -
getEnabledActions
Collection<? extends PolicyActionConfigItem<?>> getEnabledActions()Returns all enabled actions. Fails if they were not computed yet. TODO clockwork vs other policy rules -
getEnabledAction
@Nullable default <T extends PolicyActionType> @Nullable PolicyActionConfigItem<T> getEnabledAction(Class<T> type) Returns enabled action of given type, if there's any. Throws an exception if there are more of them. -
getEnabledActions
@NotNull default <T extends PolicyActionType> @NotNull List<? extends PolicyActionConfigItem<T>> getEnabledActions(Class<T> type) Returns all enabled actions of given type. -
getActions
Returns actions (beans) defined for the policy rule - in the form of a list, not the structuredPolicyActionsType. -
containsEnabledAction
Are there any enabled actions of given type? -
getTriggers
Returns triggers for this policy rule, except for ones triggered by related situation policy rules. -
getAllTriggers
Returns all triggers, even those that were indirectly collected via situation policy rules. -
trigger
-
trigger
-
isTriggered
boolean isTriggered()Was this rule triggered, i.e. are there any triggers? Note that for activity-based rules this may include triggers that occurred in previous activity runs (and so stored in the activity state). -
extractMessages
List<TreeNode<LocalizableMessage>> extractMessages() -
extractShortMessages
List<TreeNode<LocalizableMessage>> extractShortMessages() -
hasSituationConstraint
default boolean hasSituationConstraint() -
hasThreshold
default boolean hasThreshold() -
getCount
Integer getCount() -
setCount
-
isOverThreshold
default boolean isOverThreshold()Evaluates whether the current count is over the threshold defined in the policy rule. If there is no threshold, it returns true. -
getPolicySituation
Returns the policy situation connected to this rule. Will be replaced by object marks. -
getPolicyMarkRef
-
toEvaluatedPolicyRuleBeans
@NotNull @NotNull Collection<EvaluatedPolicyRuleType> toEvaluatedPolicyRuleBeans(@NotNull @NotNull PolicyRuleExternalizationOptions options, @Nullable @Nullable Predicate<EvaluatedPolicyRuleTrigger<?>> triggerSelector) Serializes the policy rule into bean form (EvaluatedPolicyRuleType). - Serializes only triggered rules. - For sitation rules with are both hidden and final, serializes the inner rules. (TODO why should that be?) TODO consider if we cannot merge trigger selector with the options- Parameters:
options- Options - how the serialization should take place.triggerSelector- Which triggers should be processed?
-
isContainedIn
Returnstrueif this rule is present in the provided collection of rules. Checking by id.
-