Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 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.
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 additions or deletions in a project. Click Edit > Undo or press Ctrl+Z.
To Revert to an Earlier Version or Restore a Deleted Resource  Eclipse also allows you to compare your work with local history and to revert to an earlier saved version (not just the last saved version). Right-click a resource in BusinessEvents Studio Explorer and select Compare With > Local History or Replace With > Local History. Also, if you right-click a folder and select Restore From Local History you can restore items deleted from that folder.
Project Level Actions
You can rename a project (use File > Rename) and you can copy and paste a project. However, you cannot 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:
5.
6.
To Move an Element to a Different Project Folder
1.
2.
3.
The problem page displays if the move cannot 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 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.
3.
Click OK to delete without previewing, or click Preview to preview the effect of the deletion.
4.
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:
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
Copyright © TIBCO Software Inc. All Rights Reserved