Administración de la empresa > Exportación y importación en Windchill > PTC Windchill PLM Connector - Creo Packages Administrator's and User's Guide > Creo Packages > Importing Packages > Before Importing a Package > Mapping the Target PLM System > Creating Mapping Files
  
Creating Mapping Files
A mapping file is a text file with a .mapping extension. Creo Packages uses this file to import the package.
Using Blocks
When you create a mapping file, you must arrange its contents using blocks. A block is a group of rules between the keywords begin and end. A mapping file can have single or multiple blocks depending on the source and target PLM system setup. You cannot have a block inside another block. Within a block, you must map an object property in the form of an equation, such as the following:
owner object property = target object property.
You can write the following mappings in each block:
location <owner path> = <target path>

lifecyclestate <owner release scheme>::<owner release level> =
<target release scheme>::<target release level>

revision <owner revision label> = <target revision label>
What a Mapping File Includes
Mapping files contain keywords that have a structure. The map.mapping.template file contains all of the keywords and usage. For more information, see map.mapping.template.
Keywords Usage Concerning Blocks:
Two keywords appear outside the begin and end blocks. These keywords are applicable to all blocks.
Site—Required. Every mapping file must have a site label that is outside the blocks and is at the beginning of the mapping file.
Rule—Optional. The rule label can appear outside the blocks.
Keywords and Structure:
This section contains mapping file keywords and structure.
Site—The source system is the PLM system in which the object was created. You must specify the site label outside the blocks. You must have the site label at the beginning of the mapping file. This keyword has the following modifiers:
Modifier
Description
Required
Example Values
id
The ID of the source PLM system.
The value can be obtained by viewing the contents of the package.
Yes
Source Windchill PDMLink: 476250931-1165312260509-17489534-123-184-21-130@i3190.ptcnet.ptc.com
Also see the package.xml file.
alias
The user-defined name to identify the source PLM system.
Use this modifier if you want to expose the source PLM system name as an attribute.
Optional
PTC.com
ownername
The user-defined master or non-versioned attribute name that represents the source PLM system name.
Any string attribute name can be specified.
Optional
OWNER_NAME
ownerversion
The user-defined versioned attribute name that represents the version of the source PLM system. It is assigned to a specific version of the object in the target PLM system.
Use the format, revision:version of the source PLM system.
Any string attribute name can be specified.
Optional
OWNER_VERSION
Rule—The common rule for iteration schemes and revision schemes in all blocks. You can specify this optional label outside the blocks. The rule keyword can be present in each block. If it is present in each block, the rule in the block overrides the global rule. This keyword has the following modifiers:
Modifiers
Description
Required
Values
iteration_rule
Specifies which iteration to map
Optional
latest (default), position, position_latest
position: retains the position of an iteration in a given version.
position_latest: if the default value (latest) cannot import the object; the position_latest rule is used.
revision_rule
Specifies which revision to map
Optional
position, label
position: when positional mapping is applied.
label: when importing objects with specific revisions.
Location—The folder location in the target PLM system where you want to import the package. This keyword is mandatory in each block. For example:
location <owner label> = <target path>
Revision—Mapping a revision is optional. You can skip a revision only if it is not used by any object. This keyword is optional and does not need to be mapped if it is not used by any object. Following is an example of the revision keyword:
revision <owner label> = <target label>
Life cycle—A unique combination of the life cycle scheme and life cycle state. This keyword is optional and does not need to be mapped if it is not used by any object. Following is an example of the life cycle keyword:
<owner life cycle name>::<owner life cycle state>=<target life cycle name>::<target life cycle state>
Basic Block Structure and Sample Format of a Mapping File
The following example shows a basic block structure and sample format of a mapping file. For more information, see map.mapping.template.
site -id 476250931-1165312260509-17489534-123-184-21-130@i3190.
ptcnet.ptc.com -alias "PTC.com" -ownername OWNERNAME -ownerversion
OWNERVERSION

#

rule -iteration_rule latest -revision_rule Label

#

begin

#

location "/PTC_2/Product_2"="/PTC/Product/PROD1//folderxyzf"

#

lifecyclestate "Basic::INWORK"="Basic::INWORK"

revision A=Z

revision B=Y

revision C=X

#

rule -iteration_rule position -revision_rule Label

#

end

#

begin

#

location "/PTC_2/Library/LIB1//folderx="/PTC/Product/PROD1//folderxyzf"
location "/PTC_2/Library/LIB1//foldery="/PTC/Product/PROD1//folder2"

#

lifecyclestate "Basic::INWORK"="Basic::INWORK"

lifecyclestate "Default::INWORK"="Basic::INWORK"

#

rule -iteration_rule position -revision_rule position

#

end