You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Example File (Builder projectAdvanced Modeling/Mapping):

<your example path>\Advanced Modeling\Mapping\uml\mappingSimple.xml

For mappings between complex type objects it may is easier to draw the mappings only on class level and define the mapping between the attributes by set statements within the mapping rule.

Within the mapping rule it is possible to use the action script language. To refer source and target objects attributes, use the keyword source or target within the action script (see example in class diagram simpleClassMapping above).

  • Associations with multiplicity = 1 can directly be referenced, following the structure, delimited by a dot, e.g.

    set target.childLevel1.childLevel2.Name = source.firstChild.grandChild.name;
  • Associations with multiplicity > 1 cannot directly be referenced.The xUML Compiler will throw an error.

The necessary elements on the target side will be created automatically.

For further examples for using the simple mapping action <<Mapping>> consult the simple Mapping example.

  • No labels