Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 4 Element Refactoring Operations : Renaming, Moving, Deleting, and Copy-Pasting Elements

Renaming, Moving, Deleting, and Copy-Pasting Elements
Changes that affect the structure of a project, but not its behavior, are known as project refactoring changes. Refactoring ensures that the project structure remains self-consistent.
Copy-paste operations are not strictly speaking refactoring operations. However some refactoring is also done to support these operations, so they are included here.
You can copy items from one project to other projects in the workspace. Ensure that the items are suitable for their destination projects.
Moving, renaming, deleting, or copy-pasting project elements are changes that often affect other parts of a TIBCO BusinessEvents Studio project. Names of elements, element properties, and element locations, are referenced in various parts of a project such as rules, rule functions, and concept relationship properties.
When you make changes to a project element, all references to that element must be updated accordingly. The refactoring wizard has a preview page that enables you to review all these changes (see Working with the Preview Page).
This section explains the refactoring (and related) procedures. See Automatic Refactoring Actions and Limitations to understand what TIBCO BusinessEvents does for each type of refactoring operation.
Updating All References is Strongly Recommended
To ensure the integrity of the project, it is strongly recommended that you make all changes to all locations where a renamed or moved items is referenced. Only disable such changes if you are certain there are no references to the element, or there are unusual circumstances that justify such action.
 
To Undo Changes  You can undo any change you make to a project. Click Edit > Undo or press Ctrl+Z.
Project Level Actions
You can rename a project (use File > Rename) and you can copy and paste a project. However, you can’t move a project.
Renaming, Moving, and Deleting Elements
Renaming, moving, and deleting are refactoring actions that can have an effect on other parts of the project where element names and locations are referenced.
To Rename a Project Element
1.
The first page of the Rename Element wizard appears.
2.
3.
4.
Click Preview. One of the following occurs:
The problems page displays if the rename can’t be done, for example, because a new element name is used by an existing element. Click Back to fix the problem, or Cancel to cancel the rename.
5.
6.
To Move an Element to a Different Project Folder
1.
2.
If you opened the Move Element wizard using menus, navigate the project tree in the first page of the wizard to select a destination folder, then click Preview.
3.
The problem page displays if the move can’t be made. Click Back to fix the problem, or Cancel to cancel the move.
4.
5.
To Delete an Element or Folder
When you delete a folder, all elements within that folder are also deleted.
1.
2.
At the Delete Resources page, click OK to delete without previewing, or click Preview to preview the effect of the deletion.
3.
The preview page displays so you can examine the effect of this change. (For deletions, there is generally no information.) Click OK to delete.
The problems page displays if there is a problem with the deletion. Click Back to fix the problem, or Continue to force the deletion (or Cancel to cancel the deletion).
To Delete a Project
1.
2.
If you want to remove the project contents on disk, check the Delete Project Contents on Disk check box. If you do not check this checkbox, then the project is removed from Studio Explorer, but the project contents remain on disk.
3.
Click OK to delete without previewing, or click Preview to preview the effect of the deletion.
4.
The preview page displays so you can examine the effect of this change. (For deletions, there is generally no information.) Click OK to delete.
The problems page displays if there is a problem with the deletion. Click Back to fix the problem, or Continue to force the deletion (or Cancel to cancel the deletion).
Working with the Preview Page
During refactoring operations, you can click Preview to examine the effects of the operation on the project. (If a pre-check finds issues that may prevent the operation from completing successfully, a problem page appears instead.) This section explains how to use the preview page.
Checks in the upper panel indicate elements that will change as a result of a refactoring operation. Expand to take a closer look at individual folders and elements. All elements that appear are affected by the change. When you highlight an element, details of the change to be made are shown in the lower panel.
The Original Source panel on the left and the Refactored Source on the right use the persisted format of the element. Change bars indicate changed areas.
Do any of the following as needed to examine the changes and select a subset of the changes to be done on clicking OK:
Click the Filter Changes button and select Hide Derived Resources. For example, a diagram is a derived resource. Diagrams are not persisted. You can easily recreate them. So you may not be interested in seeing those changes.
If you want to apply the change to only some of the project elements, uncheck the checkboxes next to the elements as desired. For example, you may wish to replace or delete an element after you have completed the refactoring operation, so you don’t need to apply the change to that element.
It is recommended that you accept all changes to be performed  Your project can become corrupted if you do not make the changes throughout the project. Only deselect changes if you have a specific, valid reason to do so.
Copy-Pasting an Element
Copy-pasting is not a true refactoring operation, because it does change the behavior of the TIBCO BusinessEvents Studio project. You would generally make manual changes to your project to use the newly created project element. However, some limited refactoring is done for your convenience. For example, the definition of a rule or rule function begins with its fully qualified name, such as the following:
rule SomeRules.Application_Rule
If you copy and paste the above rule into the folder OtherRules, the definition of the rule automatically changes to:
rule OtherRules.Application_Rule
To Copy-Paste an Element
1.
Press Ctrl+C.
Select Edit > Copy.
2.
Press Ctrl+V.
Select Edit > Paste.
If you are pasting an element to the same folder that you copied it from, a dialog enables you to provide a different name. The default value is CopyOfoldname.
 

Copyright © TIBCO Software Inc. All Rights Reserved