...
Code Block |
---|
language | xml |
---|
title | Inline Constraint example |
---|
linenumbers | true |
---|
|
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 |
---|
language | xml |
---|
title | Inline Constraint example |
---|
linenumbers | true |
---|
|
<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 |
---|
language | xml |
---|
title | Inline Constraint example |
---|
linenumbers | true |
---|
|
<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>
|