/
One source instance maps to many target instances

One source instance maps to many target instances


One source instance creating many (three) map instances. The map instances will always be of the same type, i.e., type target::EntA, target::EntB, and target::EntC. This specification cannot be defined by map entities in a MAP declaration. All map instances must be created by the xpxCreateMapInstance() function
 
MAP; – No map entity specification
FROM (s_e:source::sourceEntity)
WHEN ( . . .);
BEGIN_MAP
 LOCAL
  mapInstA: GENERIC;   -- Holds actual map instance of any type
  mapInstB: target::EntB; -- Holds map instance of type target::EntB
  mapInstC: GENERIC;   -- Holds actual map instance of any type.
 END_LOCAL;
 
 (* Creating the set of map instances *)
 xpxCreateMapInstance(target::EntA, mapInstA);
 xpxCreateMapInstance(target::ENTB, mapInstB);
 xpxCreateMapInstance(target::EntC, mapInstC);
 (* Attribute mapping for mapInstA *)
 mapInstA.intAttr := 12345;
 . . .
 (* Attribute mapping for mapInstB *)
 mapInstB.anAttribute.aReal := s_e.aRealValue;
 (* Rest of attribute mapping *)
 . . .
END_MAP;

Related content