You can create mappings in the Mapping Editor by drag and drop, or by
using the Create Mapping tool or contextual command. You can select
multiple objects and sub-objects in the Source pane using the
Ctrl or Shift keys, but only one object in
the Source pane.
To create a mapping, perform one of the following actions:
- Drag and drop - Select one or more objects and sub-objects in the
Source pane and drag and drop them onto an object or
sub-object in the Target pane. The pointer becomes a
barred circle when it is over an object to which the selected objects cannot be
mapped, and if one source object in a multi-selection would create an invalid
mapping, the whole selection is rejected.
- Target pane - Select an object or sub-object in the
Target pane and (optionally for objects), one or more
objects and sub-objects in the Source pane and click the
Create Mapping tool (or right-click one of the
selected objects and select Create Mapping). If the
selected source objects are ambiguous or would create an invalid mapping, a
selection dialog opens, allowing you to select the source objects to map
to.
- Mappings pane - Select an object or sub-object in the
Target pane and click the Create
Mapping tool in the Mappings pane. For
objects, a selection dialog opens, allowing you to select the source objects to
map to. For sub-objects, an empty mapping is created, which you should complete
by selecting a source object on the Sources sub-tab.
- Default mappings - To create default mappings between source and target objects
that have the same name, right-click a data source and select
Generate Default Mappings.
Note: If a mapping already exists between a source and target object, then
dragging and dropping will reuse and add additional information to the existing mapping
object, while using the Create Mapping tool or contextual command
will create a second mapping object. Each mapping object is available in the
Mapping list at the top of the
Mappings pane.
Mappings can be created for combinations of source and target objects and sub-objects as follows:
-
Source object mapped to target object - The objects are mapped together, and
any sub-objects that have the same name and code are also mapped together. A
mapping overlay is displayed on each of the source and the target objects
and sub-objects mapped, and a link is drawn between them:
The mapping details are shown in the Mappings pane.
The source objects are shown on the Sources sub-tab,
and any sub-objects are shown on the
Sub-object Mappings
sub-tab.
-
Source sub-object mapped to target sub-object – The sub-objects and their
parent objects are mapped together and the mapping is added to the list on
the Sub-object Mappings sub-tab of
the parent object.
-
Source sub-object mapped to target object – The parent source object is
mapped to the target object.
-
Source object mapped to target sub-object – Not permitted.
Mappings (including sub-object mappings) are always stored in target objects (for
example, a mapping between a source CDM entity attribute and a target PDM table column
will be stored in the table).
Note: In an XSM, elements can appear at any level in the hierarchy, and objects and
sub-objects can be freely mapped to any element. Each element (whether parent, child, or
grandchild) stores its own mappings, except in the case of elements bearing a complex
type, where all mappings to any sub-elements are stored on the element bearing the type
(though they are displayed on the sub-elements).
If you open the Mapping Editor with
a source or target XSM containing shortcuts to complex types in a closed model,
PowerDesigner will offer to open the model for you. If you choose not to open the
model at this time, you can do so at any time by right-clicking a shortcut and
selecting Open Model:
Shortcuts Closed |
Shortcuts Open |
|
|