This sample introduces you to visual snippets and demonstrates how the visual snippet editor is used to create and edit custom visual snippets.
The visual snippet editor is the graphical programming environment that you use to create and edit custom visual snippets. Although the visual snippet editor is the main tool for developing visual snippets, you can use visual snippets in other component editors, such as the business processes editor. The visual snippet editor is shown in the following figure:
In this visual snippets sample, you work with a custom visual snippet named IsListEmpty that is shown in the preceding figure of the visual snippet editor. As the name implies, this custom visual snippet simply determines whether an input list is empty and it returns a result of either true or false.
In the snippet, an input list is passed to a size Java visual snippet, which reads the number of elements in the list and then passes the number to a length variable. The length variable and an expression of 0 (zero) are then both passed to an equal to standard visual snippet, which compares the two values and passes the result to the return node. If the number of elements in the length variable is equal to 0, the return node reports a result of true. If the number of elements in the length variable is not equal to 0, the return node reports a result of false.
To work with the visual snippets sample, you can either browse the ready-made visual snippets sample or you can build the visual snippets sample yourself. These activities are described in the following topics: