# ActivityPolicyConstraintsType (Complex Type)

### Namespace: http://midpoint.evolveum.com/xml/ns/public/common/common-3

Supertype: AbstractPolicyConstraintType
Set of governance, risk management, compliance (GRC) and similar policy constraints related to tasks. These constraints act as triggers for the rules.

Item Summary
Name | Type | Multiplicity | Description
--- | --- | --- | ---
name | property string | [0,1] | Identifier of the constraint.
description | property string | [0,1] |
documentation | property string | [0,1] | Technical documentation for a particular object or construct.
presentation | container PolicyConstraintPresentationType | [0,1] | How should be triggering of this constraint presented, e.
executionTime | container DurationThresholdPolicyConstraintType | [0,1] | The execution time constraint doesn’t use counters, implicit value to check constraint/threshold is the activity execution time.
executionAttempts | container NumericThresholdPolicyConstraintType | [0,1] | This constraint deals with how many times the activity realization was attempted.
itemState | container ItemStatePolicyConstraintType | [0,1] | Item state constraint uses policy counters to evaluate the threshold if defined.
and | container ActivityPolicyConstraintsType | [0,-1] | Constraints that must all apply.
or | container ActivityPolicyConstraintsType | [0,-1] | Constraints from which at least one must apply.
not | container ActivityPolicyConstraintsType | [0,-1] | The inner constraint must not apply.

- ### Items

  - #### name

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Display order:

    Identifier of the constraint. It is used when midPoint needs to refer to a specific constraint, e.g. in order to record exception. This element is formally specified as optional, mostly due to the compatibility reasons. But it has to be provided in order for some functionality to work correctly.

  - #### description

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Display order:

  - #### documentation

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Display order:

    Technical documentation for a particular object or construct.

    The purpose of this element is to document system configuration and behavior. The documentation will not be presented to end users. In fact, it will probably not be presented at all in midPoint user interface. This documentation element is supposed to be a part of the technical documentation of midPoint deployment. The tools than generate deployment configuration will look for these elements and combine them to compiled documentation document.

    AsciiDoc formatting is assumed for this element. Any leading or trailing whitespace is skipped. Indentation equivalent to he indentation of the first non-blank line of text is also skipped.

  - #### presentation

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Display order:

    How should be triggering of this constraint presented, e.g. in enforcement messages, in approvals, in certification, in notifications, etc.

  - #### executionTime

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Display order:

    The execution time constraint doesn’t use counters, implicit value to check constraint/threshold is the activity execution time. When the exceeds element is specified, constraint will trigger if the task execution time exceeds the specified value. When the below element is specified, constraint will trigger if the task execution time is below the specified value. If this constraint is not combined with other constraints, then exceeds/below element doesn’t have to be specified and policyReaction/threshold/interval can be used to evaluate the threshold, while not taking into account processed items (policy counter). If this constraint is combined with other constraints, then it has to have exceeds/below element specified, otherwise it will never trigger. In this case, the policyReaction/threshold/[low|high]WaterMark/count will be used to evaluate the threshold against counter for policy.

  - #### executionAttempts

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Display order:

    This constraint deals with how many times the activity realization was attempted. When the "exceeds" element is specified, constraint will trigger if the number of attempts exceeds the specified value. When the "below" element is specified, constraint will trigger if the number of attempts is below the specified value. If this constraint is not combined with other constraints, then exceeds/below element doesn’t have to be specified and policyReaction/threshold/[low|high]WaterMark/count can be used to evaluate the threshold, while not taking into account processed items (policy counter). If this constraint is combined with other constraints, then it has to have exceeds/below element specified, otherwise it will never trigger. In this case, the policyReaction/threshold/[low|high]WaterMark/count will be used to evaluate the threshold against counter for policy. Implementation note: This constraint doesn't use counters. The value being observed is the number of execution attempts stored in the activity state.

  - #### itemState

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Display order:

    Item state constraint uses policy counters to evaluate the threshold if defined.

  - #### and

    Flags: RAM,runtime

    Multiplicity: [0,-1]

    Display order:

    Constraints that must all apply. (But note that if there are more values of this item, they are interpreted according to the enclosing operator.)

  - #### or

    Flags: RAM,runtime

    Multiplicity: [0,-1]

    Display order:

    Constraints from which at least one must apply. (But note that if there are more values of this item, they are interpreted according to the enclosing operator.)

  - #### not

    Flags: RAM,runtime

    Multiplicity: [0,-1]

    Display order:

    The inner constraint must not apply.