< Previous

Connecting the elements in the custom visual snippet

After adding the required elements to the custom visual snippet, you need to connect the elements with links in the visual snippet editor. Links are used to specify the order that you want your elements to execute in a custom visual snippet.

In the following steps, you connect the elements of the IsListEmpty custom visual snippet. When you have finished connecting the elements, the visual snippet editor should resemble the following figure:


Picture of the visual snippet editor with the elements connected

To connect the elements in the custom visual snippet:

  1. Connect the list variable to the size Java visual snippet:
    1. In the visual snippet editor canvas, hover your cursor over the triangular output terminal on the right side of the list variable. The Add a Link icon is displayed, as shown in the following figure:
      Picture of the cursor hovering over the output terminal of the list variable
    2. Click the small circle at the end of the Add a Link icon, as shown in the following figure:
      Picture of the cursor selecting the small circle on the Add a Link icon
      The Add a Link icon changes to a moveable link.
    3. Hover your cursor over the input terminal of the size Java visual snippet, as shown in the following figure:
      Picture of the cursor hovering over the size Java visual snippet
    4. Click the input terminal of the size Java visual snippet to connect the link from the list variable. The visual snippet editor automatically realigns the connected list variable and size Java visual snippet in the canvas, as shown in the following figure:
      Picture of the list variable and the size Java visual snippet aligned in the canvas
  2. Using the same procedure that you used to connect the list variable to the size Java visual snippet, complete the following steps:
    1. Connect the output terminal of the size Java visual snippet to the input terminal of the top length variable.
    2. Connect the output terminal of the bottom length variable to the top input terminal of the equal to standard visual snippet.
    3. Connect the output terminal of the 0 expression to the bottom input terminal of the equal to standard visual snippet.
    4. Connect the output terminal of the equal to standard visual snippet to the input terminal of the return node.
The elements have now been connected in the custom visual snippet and you have finished building the visual snippets sample.

Feedback
(C) Copyright IBM Corporation 2005, 2006. All Rights Reserved.
< Previous