# TimeValidityPolicyConstraintType (Complex Type)

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

Supertype: AbstractPolicyConstraintType
A constraint that triggers when validity of an object, assignment, or basically any time-sensitive item (e.g. password) is about to end.

Item Summary
Name | Type | Multiplicity | Description
--- | --- | --- | ---
name | property string | [0,1] | Identifier of the constraint.
description | property string | [0,1] |
presentation | container PolicyConstraintPresentationType | [0,1] | How should be triggering of this constraint presented, e.
enforcement | property PolicyConstraintEnforcementType | [0,1] |
item | property ItemPathType | [0,1] | The item whose validity is to be checked.
assignment | property boolean | [0,1] | If set to true, validity of assignments of the relevant object are to be checked, not items of the object itself.
activateOn | property duration | [0,1] | When will this policy constraint activate (trigger)? If not specified, activation will occur on the moment of validity change.
deactivateOn | property duration | [0,1] | When will be this policy constraint deactivated? If not specified, it will be active forever.

- ### Items

  - #### name

    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.

  - #### description

    Flags: RAM,runtime

    Multiplicity: [0,1]

  - #### presentation

    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.

  - #### enforcement

    Flags: RAM,runtime,AVals:3

    Multiplicity: [0,1]

  - #### item

    Flags: RAM,runtime

    Multiplicity: [0,1]

    The item whose validity is to be checked. If not specified, activation/validTo is assumed.

  - #### assignment

    Flags: RAM,runtime

    Multiplicity: [0,1]

    If set to true, validity of assignments of the relevant object are to be checked, not items of the object itself. So, for example, if you want to send notifications before validity of assignments to roles A, B, C expire, you'd need to attach a policy rule with this constraint having assignment=true to roles A, B, and C.

  - #### activateOn

    Flags: RAM,runtime

    Multiplicity: [0,1]

    When will this policy constraint activate (trigger)? If not specified, activation will occur on the moment of validity change. Specify negative durations if you need to activate the trigger before that moment; and positive ones if the trigger should be activated after that.

  - #### deactivateOn

    Flags: RAM,runtime

    Multiplicity: [0,1]

    When will be this policy constraint deactivated? If not specified, it will be active forever. Specify negative durations if you need to activate the trigger before the moment of validity change; and positive ones is the trigger should be deactivated after that. If not specified, the trigger will be active forever (TODO ok? or only until validTo occurs?)