# StatePolicyConstraintType (Complex Type)

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

Supertype: AbstractPolicyConstraintType
A constraint that triggers when a object or assignment is in a given state. If both filter and expressions are specified, both must be true in order for constraint to be triggered.

Item Summary
Name | Type | Multiplicity | Description
--- | --- | --- | ---
$itemDefinition.Name.LocalPart | property string | [0,1] | Identifier of the constraint.
$itemDefinition.Name.LocalPart | property string | [0,1] |
$itemDefinition.Name.LocalPart | container PolicyConstraintPresentationType | [0,1] | How should be triggering of this constraint presented, e.
$itemDefinition.Name.LocalPart | property SearchFilterType | [0,1] | Filter that is to be used to determine the state.
$itemDefinition.Name.LocalPart | property ExpressionType | [0,1] | Expression that is to be used to determine the state.
$itemDefinition.Name.LocalPart | property ExpressionType | [0,1] | Expression that is to be used to determine the state: if state matches it should return LocalizableMessageType to be used (both as normal and short messages).
$itemDefinition.Name.LocalPart | property ExecuteScriptType | [0,1] | Scripting expression (bulk action) to be used to determine the state.

- ### Items

  - #### $itemDefinition.Name.LocalPart

    Flags: RAM,runtime

    Multiplicity: [0,1]

    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.

  - #### $itemDefinition.Name.LocalPart

    Flags: RAM,runtime

    Multiplicity: [0,1]

  - #### $itemDefinition.Name.LocalPart

    Flags: RAM,runtime

    Multiplicity: [0,1]

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

  - #### $itemDefinition.Name.LocalPart

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Filter that is to be used to determine the state. Mutually exclusive with expression, messageExpression, and executeScript.

  - #### $itemDefinition.Name.LocalPart

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Expression that is to be used to determine the state. Mutually exclusive with messageExpression, filter, and executeScript.

  - #### $itemDefinition.Name.LocalPart

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Expression that is to be used to determine the state: if state matches it should return LocalizableMessageType to be used (both as normal and short messages). Mutually exclusive with message, filter, and executeScript. HIGHLY EXPERIMENTAL. Probably will change in the future.

  - #### $itemDefinition.Name.LocalPart

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Scripting expression (bulk action) to be used to determine the state. Mutually exclusive with filter, expression and messageExpression.