Skip to content

Domain validators

A domain-level <validator> lists valid configurations of propositions. Each configuration is a conjunction; the declared configurations are alternatives.

<validator name="DestinationValidity">
  <configuration>
    <proposition predicate="destination" value="karlstad"/>
  </configuration>
  <configuration>
    <proposition predicate="destination" value="gothenburg"/>
  </configuration>
</validator>

name identifies the validator. The XML compiler reads configuration children; DDD JSON represents them as valid_configurations. The runtime checks whether supplied propositions are compatible with at least one declared configuration. A configuration can match partially: values for every predicate in the configuration are not required. If supplied values contradict every configuration, validation rejects them and identifies the validator in the rejection move. This declaration validates domain facts and differs from a Service Interface validator, which calls an external operation.