Skip to main content
Version: Early Access

Built-in Validation Rules

Digital.ai Deploy provides several built-in validation rules that can be applied directly in synthetic.xml. These rules cover common validation scenarios and do not require JAR packaging or custom Java code.

note

If the built-in rules are insufficient, you can create your own rules. For more information, see Create Custom Validation Rules.

The following section lists the most commonly used built-in validation rules, along with their purpose, supported attributes, and applicable property types. For the full list of available built-in validators and attributes, see the Deploy UDM Plugin API Reference.

Rule TypePurposeCommon AttributesApplies To
applicationDependenciesValidates that each key in an application-dependency map is a valid application name (not a path). Keys must be non-null and cannot contain /.(none) — fixed message: Application names should be used instead of paths: '%s'.Key–value maps
containEnsures that the property value contains (string), includes (collection), or has keys (map) for all specified required values.value = required entries, message (default: The property must contain %s.)Strings, collections, or key–value maps
fileEncodingsValidates that each key in a Map<regex, charset> is a valid regular expression and each value is a supported Java charset.(none)Key–value maps
no-self-referenceEnsures that a CI does not reference itself in a relationship or collection property.referenceField = name of the property containing CI referencesConfiguration item (CI) types
not-containEnsures the property value does not contain any specified forbidden values.value = forbidden entries, message (default: The property must not contain %s.)Strings, collections, or key–value maps
not-emptyFails if the value is null, an empty string, an empty collection, or an empty map.message (default: Value is required.)Strings, collections, or maps
placeholdersValidates consistency between a Deployed item’s placeholders map and its Deployable’s placeholder set. Errors if any placeholder is missing or extra.(none)Configuration item (CI) types
rangeEnsures a numeric property lies within inclusive bounds [min, max].minimum, maximum, message (default: Value is not in range [%s, %s].)Numbers
regexValidates that a string (or each element of a collection) matches the given regular expression.pattern (required), message (default: Value entered did not conform to pattern %s.)Strings or string collections
sizeEnsures that the length or collection size is within inclusive [min, max].min, max, message (default: The size must be between min and max.)Strings, collections, or maps

Usage Examples

The following examples show how to apply these rules to properties in synthetic.xml:

not-empty

<rule type="not-empty" message="Ticket must be provided." />

range

<rule type="range" minimum="1" maximum="10" message="Replicas must be between 1 and 10." />

regex

<rule type="regex" pattern="^JIRA-[0-9]+$" message="Ticket format must be JIRA-<digits>." />

size

<rule type="size" minimum="1" maximum="3" message="Provide between 1 and 3 approvers." />

contain

<rule type="contain" value="PROD" message="Value must include PROD." />

not-contain

<rule type="not-contain" value="DROP DATABASE" message="Forbidden directive present." />

placeholders

<rule type="placeholders" message="Unresolved placeholders found." />

no-self-reference

<rule type="no-self-reference" message="CI cannot depend on itself." />

application-dependencies-format

<rule type="application-dependencies-format" message="Invalid dependency declaration." />

file-encodings

<rule type="file-encodings" message="Unsupported file encoding specified." />

is-control-task-parameters

<rule type="is-control-task-parameters" message="Invalid control task parameters." />

Chaining Multiple Rules

You can declare multiple <rule> entries under a single <property>.

<property name="changeTicketNumber" required="true">
<rule type="not-empty" message="Change ticket is required." />
<rule type="regex" pattern="^JIRA-[0-9]+$" message="Format must be JIRA-<digits>." />
<rule type="size" minimum="10" maximum="15" message="Ticket length must be 10–15 characters." />
</property>