# LimitationsType (Complex Type)

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

Definition of complexity and string policy

Item Summary
Name | Type | Multiplicity | Description
--- | --- | --- | ---
minLength | property int | [0,1] | Minimal length of the string.
maxLength | property int | [0,1] | Maximal length of the string.
minUniqueChars | property int | [0,1] | Minimum number of unique characters in the string.
checkAgainstDictionary | property boolean | [0,1] | Currently ignored.
checkPattern | property string | [0,1] | Currently ignored.
checkExpression | property CheckExpressionType | [0,-1] | Expression that is used to check the value whether it is acceptable or not.
maxAttempts | property int | [0,1] | Maximum number of attempts to generate an expression.
limit | property StringLimitType | [0,-1] | Limitations (e.

- ### Items

  - #### minLength

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Display order:

    Minimal length of the string. If not specified, the string can be empty. (When generating values, though, the default for minimal generated length is situation-specific, e.g. 10 or 24 characters. It is used when both minLength and minUniqueChars are unspecified or zero.)

  - #### maxLength

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Display order:

    Maximal length of the string. If not specified or if negative, the string can have arbitrary length.

  - #### minUniqueChars

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Display order:

    Minimum number of unique characters in the string. Defaults to minLength.

  - #### checkAgainstDictionary

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Display order:

    Currently ignored.

  - #### checkPattern

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Display order:

    Currently ignored.

  - #### checkExpression

    Flags: RAM,runtime

    Multiplicity: [0,-1]

    Display order:

    Expression that is used to check the value whether it is acceptable or not. If the expression returns true, then the value is accepted. If the expression returns false value, then the value is rejected and (in the case of value generation) it will be generated again. Until the maximum number of attempts is reached. If there are several expressions that all of them must pass for the value to be accepted. However, each of them may produce a different failure message.

  - #### maxAttempts

    Flags: RAM,runtime

    Multiplicity: [0,1]

    Display order:

    Maximum number of attempts to generate an expression. Attempts are used with limitations that cannot be incorporated directly into the generation algorithm (check expression, pattern, dictionary). Any value less than 1 is interpreted as 1.

  - #### limit

    Flags: RAM,runtime

    Multiplicity: [0,-1]

    Display order:

    Limitations (e.g., minimum and maximum occurrences) related to individual character classes. Important note: Generation of values is guaranteed to work if the character classes are disjunctive. If they are not, there may be situations where the value cannot be generated entirely, or their generation would require computationally intensive algorithms involving, e.g., approaches known from constraints programming area. This can be the case if requirements for individual classes contradict each other - like A is subset of B, and minOccurs for A is greater than maxOccurs of B - or if the current simple algorithm walks into a dead end by randomly selected required characters from one class in such a way that there will be no chance of fulfilling the requirements of other classes and the global requirements at the same time. Hence, you should either use disjunctive character classes or make sure that all the limitations can be met even when selecting required amounts of characters from individual classes randomly and independently of each other. If there are no specific limitations, alphanumeric chars are used for value generation.