Rule Builder > Managing Decision Trees > Editing Operations on Tree Elements > Drag and Drop

The drag and drop feature enables you to reorder existing tree elements or to manipulate decision tree elements in ways that can speed up the building of a decision tree. Note however, that dragging and dropping an element onto another existing element replaces the target and any branches belonging to it. There are several ways that you can use the drag and drop facility.

This section has the following subsections:

You can cancel a drag and drop operation by pressing the Esc key.

Decision Node

To drag and drop a decision node:

  1. Click the decision node to select it.
  2. Drag and drop the decision node into the target node.

The complete branch to the right of the decision node is dragged and dropped, as shown in Figure 13.43. If the rules have not been given a title, their letters are automatically changed to maintain an alphabetical series. Note that in Figure 13.43 the target node is empty, so effectively this is the same as a copy / paste action. If you drag and drop the decision node onto an existing element, that element and its associated branch (if any) will be replaced.

images/drag_partition.png

Dragging a Decision Node 

images/drop_partition.png

Dropping a Decision Node 

Figure 13.43    Dragging and Dropping a Decision Node

Test Link

To drag and drop a test link:

  1. Click the test link to select it.
  2. Drag and drop the test link into the target node.

In Figure 13.44 the test link Platinum has been dragged and dropped into the Category node of the [51, 60] Age test link. The complete branch to the right of the test link is dragged and dropped with it.

images/drag_pitem.png

Dragging a Test Link 

images/drop_pitem.png

Dropping a Test Link 

Figure 13.44    Dragging and Dropping a Test Link

Action Nodes

To drag and drop an action node:

  1. Click the action node to select it.
  2. Drag and drop the action node into the target node.

The associated action set is copied to the target node. If there are already actions present in the target node, they are overwritten. Figure 13.45 shows the result of dragging and dropping an action node from rule 7 to an empty rule 8. The empty rule 8 is overwritten by the content of rule 7.

images/dtree_drag.png

Dragging an Action Node 

images/dtree_drop.png

Dropping an Action Node 

Figure 13.45    Dragging and Dropping an Action Node

Actions

To drag and drop an action:

  1. Click the action to select it.
  2. Drag and drop the action into the target node.

The associated action is removed from the source node and copied to the target node. If this action is already present in the target node, it is overwritten. Figure 13.45 shows the result of dragging and dropping the action Apply discount 10 to shoppingCart from the rule Discount 10 to the rule Discount 5. You can then edit the value of the action.

images/dtree_dragaction.png

Dragging an Action 

images/dtree_dropaction.png

Dropping an Action 

Figure 13.46    Dragging and Dropping an Action

Repositioning Nodes

To reposition a node:

  1. Click the node to select it.
  2. Drag and drop the node to where you want to position it.

The node is repositioned. Figure 13.47 shows the result of dragging and dropping the rule Discount 15 above the rule Discount 10.

images/drag_move.png

Dragging to a New Position 

images/drop_move.png

Dropping in a New Position 

Figure 13.47    Repositioning a Node Using Drag and Drop

Copying an Element

You can use drag and drop to copy an element and paste it into the tree in another position. To do this you need to use the Ctrl key in conjunction with the drag action. When you press the Ctrl key and click the element you want to copy the cursor has a + sign attached to it to indicate that this is a copy action as well as a drag and drop action images/dtree_dragdropcopy.png .

To drag and drop to copy an element:

  1. Press Ctrl and click the element to select it.
  2. Drag and drop the element in the place where you want to position it.

Figure 13.48 shows the result of dragging the [51, 60] Age test link and dropping it directly below. The branch is copied and pasted into the decision tree. An error is generated due to overlap of the [51, 60] Age test link values, but you can edit the values to remove the overlap.

images/dtree_ddcopy.png

Dragging an Element 

images/dtree_ddpaste.png

Dropping an Element 

Figure 13.48    Copying an Element Using Drag and Drop

See Also

Decision Tree Operations | Selecting Elements


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