# HasAssignmentPolicyConstraintType (Complex Type)

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

Supertype: AbstractPolicyConstraintType
Constraint that triggers when the focus has given assignment(s).

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 | reference ObjectReferenceType | [1,1] | Assignment target to be matched.
$itemDefinition.Name.LocalPart | property boolean | [0,1] | If true the assignment to given target must be direct.
$itemDefinition.Name.LocalPart | property boolean | [0,1] | If true the assignment to given target must be effectively enabled.
$itemDefinition.Name.LocalPart | property QName | [0,-1] | This policy only applies to relations of the specified type.

- ### 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

    Multiplicity: [1,1]

    Assignment target to be matched. Might be dynamic (with a resolution time of "run"), just like the one in exclusion constraint. If a relation here is specified, it takes precedence over "relation" item in this constraint.

  - #### $itemDefinition.Name.LocalPart

    Flags: RAM,runtime

    Multiplicity: [0,1]

    If true the assignment to given target must be direct. If false, it must be indirect (induced). If not specified, it might be either direct or indirect. But in all cases it must be of the order one, i.e. metaroles are not considered.

  - #### $itemDefinition.Name.LocalPart

    Flags: RAM,runtime

    Multiplicity: [0,1]

    If true the assignment to given target must be effectively enabled. If false, it must be present but effectively disabled (beware, the behavior of midPoint for disabled indirect assignments may be fragile). If not specified, the effective status is not considered.

  - #### $itemDefinition.Name.LocalPart

    Flags: RAM,runtime

    Multiplicity: [0,-1]

    This policy only applies to relations of the specified type. (Provided that the relation is not set in the targetRef.) The value of this element is compared to the relation of the targetRef relation in the assignment/inducement. If not specified then this policy only applies to the null (default) relation. If all relations need to be affected by this policy then the special value of "any" should be specified in this element or in the targetRef element.