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 IsDisplayArticle
custom visual snippet.
To connect the elements in the custom visual snippet:
- At the very top of the visual snippet editor canvas, connect
the false expression to the isDisplayArticle expression
by completing the following steps:
- In the visual snippet editor canvas, hover your cursor over
the triangular output terminal on the right side of the false expression.
The Add a Link icon is displayed, as shown in the following
figure:

- Click the small circle at the end of the Add a Link icon,
as shown in the following figure:

The Add a Link icon
changes to a moveable link.
- Hover your cursor over the input terminal of the isDisplayArticle expression,
as shown in the following figure:

- Click the input terminal of the isDisplayArticle expression
to connect the link from the false expression. The
visual snippet editor automatically realigns the connected false expression
and the isDisplayArticle expression in the canvas,
as shown in the following figure:

- At the top of the visual snippet editor canvas, use the
same procedure to connect the symbols variable, isListEmpty standard
visual snippet, and if true header of the Choice control
structure, as shown in the following figure:

- At the very bottom of the visual snippet editor canvas,
connect the isDisplayArticle variable to the return activity,
as shown in the following figure:

- Using the following figure as a guide, connect the remaining elements
as described below:

- In the if true section at the top of
the Choice control structure, connect the output terminal of the true expression
to the input terminal of the isDisplayArticle variable.
- In the otherwise section of the Choice
control structure, connect the output terminal of the symbols variable
to the input terminal of the iterator Java visual snippet and then
connect the output terminal of the iterator Java visual
snippet to the input terminal of the it expression.
- In the condition area (upper section) of the While
true control structure, connect the output terminal of the it variable
to the input terminal of the hasNext Java visual snippet and then
connect the output terminal of the hasNext Java visual
snippet to the input terminal of the hasMoreSymbols expression.
- In the condition area (upper section) of the While
true control structure, connect the output terminal of the hasMoreSymbols &&
isDisplayArticle == false expression to the condition input terminal.
- In the body (lower section) of the While true control
structure, connect the output terminal of the it variable
to the input terminal of the next Java visual snippet and then
connect the output terminal of the next Java visual
snippet to the input terminal of the symbol expression.
- In the body (lower section) of the While true control
structure, connect the output terminal of the article.title variable
to the top input terminal of the indexOf Java
visual snippet and then connect the output terminal of the indexOf Java
visual snippet to the input terminal of the index expression.
- In the body (lower section) of the While true control
structure, connect the output terminal of the symbol variable
to the bottom input terminal of the indexOf Java
visual snippet.
- In the body (lower section) of the While true control
structure, connect the output terminal of the index > -1 expression
to the input terminal of the if true header of the
Choice control structure.
- In the if true section of the Choice
control structure, connect the output terminal of the true expression
to the input terminal of the isDisplayArticle variable.
- Press Ctrl-S to save your changes. The
workspace begins to rebuild itself and the warning and error symbols on the
elements disappear.
The elements have now been connected in the custom visual snippet
and you have finished building the sample.