ESIMap
Windchill ESI maps are objects that represent the contents of the Map elements in the ESI response meta information file. A Map element may have one or more child elements named attributeMapping, each of which represents a pair of source and target attribute names and optionally a default value for the attribute. Each attributeMapping entry in the file takes the following form:
<esi:attributeMapping sourceAttribute="Source_Name" defaultValue="Default">
Target_Name</esi:attributeMapping>
Source_Name is an instruction describing where to find the data that is to be extracted. This section of the entry is required.
If the object being mapped is an Info*Engine element object, Source_Name is the name of an Info*Engine Att object on that element object.
If the object being mapped is not an Info*Engine element, Source_Name is the name of a "getter method" to invoke on the object. The value supplied for Source_Name is pre-pended with the characters, "get", and the resulting string is used as a method name. The mapper only invokes methods that take no arguments and have a name that begins with "get".
The mapper is able to navigate object structures. If Source_Name contains periods, the periods are interpreted as method delimiters. The mapper invokes the "getter method" identified by the first segment of the Source_Name on the object being mapped. If that method returns a result, the mapper invokes the second segment of the Source_Name on the result. The mapper continues to obtain the result for each section of Source_Name.
Example:
This is the Source_Name value from one of the attribute Mapping entries used by the Windchill ESI BOM component renderer: Quantity Amount. The mapper executes the getQuantity() method on the object being mapped. If the result is not null, the mapper executes the getAmount() method on the object obtained by the getQuantity() method. If getAmount() returns a value, the mapper assigns that value to the output.
Target_Name is the name to give to the output Att object that is created by the mapper. This section of the entry is required.
Default is the value to assign to the output if the value is not available from the source. This section of the entry is optional.
These are the available methods of the class:
ESIMap(fileName : String)
Loads the map file identified by the fileName argument. This constructor is used only when the ESI map is to be created from a map file. See the Note at the end of this section for more information on map files.
ESIMap(mapID : String, attributes : List<Entry>)
Creates a new ESIMap instance, setting its attributes id and entries to the input values. This constructor is invoked by the API that parses the ESI response meta information file.
getID() : String
Returns the value of the attribute id.
getSourceAttributes() : Collection
Returns a collection of Strings that represent the names of the source attributes.
getTargetAttributes() : Collection
Returns a collection of Strings that represent the names of the target attributes.
iterator() : java.util.Iterator
Returns an iterator for the Collection in the entries attribute.
* 
The ESIMap instance holds a list of Entry instances, each of which represents a given attribute Mapping entry of a given Map element in the ESI response meta information file. The entries above refers to the said list of Entry instances.
* 
While most ESI map objects are populated using the contents of the ESI response meta information file, there are certain others that are populated from map files such ESITarget.map, ESIReleaseActivities.map etc. The map files are ASCII text files. Each entry in a map file is expected to have the following format:
Source_Name = Target_Name|Default
Where Source_Name, Target_Name and Default have the same meanings as described earlier in this section.
Was this helpful?