Rule Builder > Managing Decision Trees > Editing Operations on Tree Elements > Cut / Copy / Paste

The decision tree features a Cut / Copy / Paste mechanism that allows you to import and export data to and from the decision tree. This mechanism also enhances editing capabilities in the tree, allowing the copying and pasting of complete decision nodes from one branch to another.

Cut

The Cut action first copies the selected data to the clipboard and then cuts selected branches, decision tests and actions included
Note
The Delete command cuts the selected elements, but does not copy the data to the clipboard.

Copy

The Copy action can help you to build your decision tree more quickly, by copying and pasting parts of the tree you have already created elsewhere to create new branches. You can then edit the values, if required. You can select elements for copying using the following methods:

Copying a branch copies selected elements and all elements lower down in the hierarchy (decision tests and actions included).

You can copy elements in two ways, Copy / Paste and Drag and Drop. In both cases, the elements at the point of the paste or drop are replaced by the information on the clipboard. This means that nodes are replaced by nodes and the links are added that connect the nodes.

This section has the following subsections:

Decision Nodes

Test Links

Action Nodes

Actions

Decision Nodes

When you copy a decision node, all the elements to the right of it in the branch (or below it, depending on the view) are copied also. The element that you paste your selection onto is replaced by the part of the tree you have copied, see Figure 13.39. In this example, the decision node Category is copied and pasted onto the decision node B, which it replaces. If you paste the decision node at the end of a branch, it is added as a new node and nothing is replaced.

images/dtree_copypn.png

Copying a Decision Node 

images/dtree_pastepn.png

Pasting a Decision Node 

Figure 13.39    Copying and Pasting a Decision Node
Test Links

When you copy a test link, all the elements to the right of it in the branch are copied also. Test links are the only elements that allow you to copy more than one item at the same time. In Figure 13.40 the test links Gold and Platinum have been copied to the decision node below containing only the test link Silver. The action nodes to the right of them have also been copied.

images/dtree_copypi.png

Copying Test Links 

images/dtree_pastepi.png

Pasting Test Links 

Figure 13.40    Copying and Pasting Test Links
Action Nodes

You can copy an action node and paste it into the branch belonging to a decision node. If the action node has an action set belonging to it, this is also copied. In Figure 13.41 the action node Discount 10, belonging to the test link Gold, has been copied to the test link Silver of the decision node Category. This is an example of Copy / Paste where an element is added at the end of a branch. If you paste onto an existing element that element and its associated branch are replaced by the information on the clipboard.

images/dtree_copyact.png

Copying an Action Node 

images/dtree_pasteact.png

Pasting an Action Node 

Figure 13.41    Copying and Pasting an Action Node
Actions

You can copy one or more actions in an action set of one action node and paste them into another action node. If you paste them into another action node containing the same action or actions, the target actions are overwritten. If you paste them into an empty action node they are added to it.

Figure 13.42 shows one of the actions contained in the Platinum Discount 10 action node pasted into the empty Silver Discount 10 action node situated below it.

images/dtree_copyaction.png

Copying an Action 

images/dtree_pasteaction.png

Pasting an Action 

Figure 13.42    Copying and Pasting Actions

Paste

The Paste action, by default, overwrites (that is, replaces) destination nodes with the clipboard contents. As a visual aide, the paste point is highlighted; this is of particular use in more complex trees where it is not so easy to identify the results of your action.

Note that the pasting mechanism pastes links with no values, and pasting into empty nodes assigns a type and name to these empty nodes on the fly.

See Also

Decision Tree Operations | Selecting Elements


Customer Support | Copyright © 1987-2004 ILOG S.A. All rights reserved. Legal terms. PREVIOUS   NEXT