Map Head
The only mandatory declarations in the map head are the FROM clause and the WHEN clause, the rest is optional.
The optional keyword ON_CALL_ONLY specifies that the actual MAP will only be executed when it is invoked by a Map Call.
The optional keyword NO_INHERITANCE specifies that this map should not invoke a map with a MAP entity that is a supertype of the MAP entity of the current map. For more details see: Map Inheritance.
Optionally a map can be given a name for the following three reasons:
Make the map callable. A map can be called by name in the same way as a function can be called. See Explicit Map Call.
Increase the documentation of the mapping schema. Giving a map a descriptive name, improves the documentation of a mapping schema.
Ease the readability of the log file from the EDMmodelConverter as the map can be referenced by its name.
The map name must be a unique identifier in the global scope of the mapping schema followed by the keyword FOR.
Optionally the MAP head can define a MAP entity, i.e. an instance type in the target model. Instances of this type will implicitly be created for each combination of source instances defined in the FROM clause, provided that the defined WHEN clause evaluates to TRUE.
A MAP should be declared without a map entity when:
One source instance or a set of source instances, is mapped to more than one target instance.
One source instance or a set of source instances, is mapped to one target instance of a type that is dependant of attribute values in the source instances, the actual instance type of the source instances or other data.
For all maps without a defined map entity, invoking the xpxCreateMapInstance function should create all map instances. The term map instance means here a target instance that is created from one source instance or a combination of source instances. Map instances can be later retrieved by the xpxGetMapInstances function. The particular source instance or combination of source instances that caused the creation of the map instances, should be given as arguments.
The following examples show the three different legal map head declarations without taking the optional keywords NO_INHERITANCE and ON_CALL_ONLY into account:
Example:
(* Full map_head with map_id and map entity *)
MAP fullMapHead FOR t_e:target_model::TargetEntity;
(* A map_head with name but without a map entity *)
MAP mapName_no_mapInstance FOR;
(* A map_head without name and without a map entity specification *)
MAP;