Chapter 5 Managing Models


Moving a diagram to a package

When you retrieve a model in which all diagrams are displayed in the same package, you may want to split the package to reorganize the model by moving some diagrams into other packages you have created.

PowerDesigner lets you move a diagram to package using the Move Diagram wizard from the View→Diagram submenu. It allows you to select an existing target package (or composite object such as process or activity) then select objects to move with the diagram. The diagram must contain symbols in order to display the Selecting Objects to Move page of the wizard and proceed to the move. Also, you cannot move a diagram into a package, if the diagram contains a symbol for the target package, as you cannot move a parent to its child. To do so, you have to delete the package symbol in the diagram.

When you move a diagram to a package, symbols of the objects you selected in the wizard are always moved with the diagram to the target package. Objects themselves are either moved or replaced by a shortcut to preserve the diagram contents if you deselected them in the wizard selection page.

The linking objects that you move with the diagram keep their links in the target package and a shortcut is usually created in the source package. The general rule being that the design of the original diagram must be preserved.

Shortcut creation rules in PowerDesigner also apply to moving objects between packages.

For more information on shortcut creation, see chapter Managing shortcuts.

PowerDesigner lets you select the objects of the diagram you want to move to a package using the Selecting Objects to Move page of the wizard. Only relevant tabs are displayed. For example, if you move to package a diagram that only contains tables and references, only the Table tab will be available, as the reference is contained in the table definition. Besides, when you deselect two objects related with an oriented link, the link is automatically deselected (for example two classes with an association link or two entities with a relation link). Just as when you deselect a non-oriented link, ending objects are automatically deselected. Also, objects that do not support shortcuts do not appear in the selection page as they are always moved with diagram.

Dragging and dropping a diagram

You can also drag and drop a diagram in the Model Explorer to move it to a package. All objects displayed in the diagram are automatically moved to the target package. However a mixed selection of diagrams and objects is forbidden using the drag and drop feature.

Last diagram in package

When the last diagram of a package is moved, a new diagram is automatically created in the source package to ensure that all packages contain at least one diagram.

Moving entities

When you move an entity that contains data items, the move can have diverse results on data items depending on the namespace and the number of entities that use them.

For more information, see section Moving entities in chapter Managing Objects.

Steps To move a diagram to a package:

  1. Select View→Diagram→Move to Package.

    or

    Right-click the diagram background window and select Diagram→Move to Package from the contextual menu.

    or

    Right-click the diagram node in the Model Explorer and select Move to Package from the contextual menu.

    The Move Diagram to Package page appears.
  2. Select a target package in which you want to move the current diagram.
  3. Click Next.

    The Selecting Objects to Move page appears. It displays all relevant tabbed pages. By default, all the objects are selected.

    When you deselect objects in the selection list, other object selections are not affected.

    For more information on how to select items in a selection list, see section Adding an item from a selection list in chapter Using the PowerDesigner interface.
  4. Click Finish, if you want all the selected objects to be moved with the diagram into the target package.

    or

    Deselect the objects you do not want to be moved with the diagram to the target package and click Finish.

    The selected objects are moved with the diagram to the target package and shortcuts are created in the target package for objects you did not select to preserve the diagram contents.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.