Map Body
The map body begins with the keyword BEGIN_MAP followed by a sequence of statements that defines attribute values for the newly created map instances should be computed. All statement types defined in EDMexpressX can be specified within a map body.
Optionally the map body may define an algorithm head, i.e. local variables that are necessary for the calculation of the attribute values. The algorithm head must be placed after the keyword BEGIN_MAP and before the first statement in the map body.
Invoking the function xpxCreateMapInstance from the map body is the only way to create map instances, in case a MAP declaration does not have a map entity specification. 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 later be retrieved by the xpxGetMapInstances function. Instances created by the function xpxCreateInstance or by executing the NEW statement, will not be classified as map instances. Hence they cannot be retrieved by the xpxGetMapInstances function, or be returned in a map call.
An execution of a MAP can be escaped by means of the ESCAPE statement or the xpxEscapeScope function. It is also possible to terminate the execution of a specific iterator. See xpxTerminateXpxIterator.
Example:
(* A complete map declaration*)
MAP aMapExample FOR t_e:target::targetEntity; – start of map head
FROM (s_e:source::sourceEntity)
WHEN (TRUE); – end of map head
BEGIN_MAP – start of map body
LOCAL – start of optional algorithm head
anInst : GENERIC;
valueOne : INTEGER := 1;
END_LOCAL; – end of optional algorithm head
(* executable statements *)
t_e.int_v1 := 100;
t_e.real_v2 := -bc.real_c1;
t_e.str_v3 := 'This is a string value';
(* End of map_body *)
END_MAP; – end of map declaration