Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
titleInline Constraint example
linenumberstrue
Inline Constraint example

Standalone Constraint

...

<Def name="Manager" inherits="Employee">
     <String name="Employment.BusinnesRole" default="manager" eq="manager" cardinality="1" modifiers="hidden,readonly"/>
</Def>

Standalone Constraint

Constraint can be defines a block under model definition.

Code Block
languagexml
titleInline Constraint example
linenumberstrue
<Def name="Janitor" inherits="Employee">
      <Constraint target="Employment.BusinnesRole" eq="janitor"/>
</Def>

Nested Constraint

Constraints can be nested by using And, Or and XoR constructs.

Code Block
languagexml
titleInline Constraint example
linenumberstrue
<DataModel name='OlegOrder'>
      <Attribute name='Owner' value='Order.Owner'>
        <And>
          <OR>
            <EQ value='Oleg'/>
            <EQ value='Michael'/>
          </OR>
          <OR>
            <EQ target='ShippingCost' value='10.2'/>
            <EQ target='TotalCost' value='20.2'/>
          </OR>
        </And>
      </Attribute>
      <Attribute name='ShippingCost' value='Order.ShippingCost'/>
      <Attribute name='TotalCost' value='Order.TotalCost'/>
</DataModel>