IBM Streams 4.3.0
SPL Graphical Editor
The SPL Graphical Editor provides a graphical user interface to create stream processing applications and to generate SPL code.
A stream processing application is a directed graph with operators that are connected by streams. The operators describe how the data is transformed. The edges or streams represent the direction and flow of data between two operators.
SPL Graphical Editor features
The SPL Graphical Editor opens in the editor area of the IBM® Streams perspective. The SPL Graphical Editor provides the following features:- Drag-and-drop capability to create SPL applications
- Drag an element from the palette and drop it onto the canvas to create SPL applications. The palette contains elements that you can drag onto the canvas to create an SPL graph. The canvas is the drawing area where you drag the elements to create an SPL graph.
- Generate SPL code
- Save the SPL graph to generate SPL code from the SPL Graphical Editor. The SPL Graphical Editor formats the code and saves it in the SPL source file. If the SPL graph has syntax errors, the SPL Graphical Editor does not generate SPL code for elements (and related elements) that have syntax errors that prevent code generation.
- Palette filter
- A palette might contain many operators and schemas. To quickly find an element in the palette, use the Find field of the palette. You can search the palette by toolkits to view operators and schemas from specific toolkits. You can also search the palette by operator and schema names. As you type, the entries are filtered based on the search criteria. Clear the filter to see all the elements. The search results have decorators in the labels, which display the toolkit name and the namespace for the operators and the schema name for the schemas.
- Layout
- Use the Layout button
to lay out the graph and organize the graph elements on the canvas by using the standard SPL layout algorithm. You do not have to manually arrange the graph elements to fit in the canvas.
- Hover information
- You can view hover help for elements in an SPL graph. For example, the hover help for an operator displays operator name, SPL source code, and error and warning messages. The hover help can be toggled by using the Toggle hover button. Press F2 or click anywhere in the hover information to set focus on the hover and to prevent the hover information from disappearing when you move the mouse cursor.
- Reload Graph
- The graph in the SPL Graphical Editor might sometimes be out-of-sync with the SPL code in the SPL file. The graph might be out-of-sync if you introduce syntax errors in the graph that prevents SPL code from being generated or when you update the SPL file and choose not to refresh the graph in the Graphical Editor when prompted. Click Reload Graph to synchronize the graph with the SPL file. Any unsaved changes, including changes that cannot be safely generated into SPL code, are lost.
- Zoom
- Use the slider to resize the graph and to control the level of details that are shown in the graph.
- Fit to Content
- Use the Fit to Content button
to resize the graph to a size that is optimum for displaying the graph in the current canvas area.
- Layers
- Layers define the amount of information that is displayed in the graph. This information is displayed by using icons, hover text, note annotations, and labels on graph elements. You can enable or disable a layer as you want to complete tasks. By default, all layers are enabled when you open the SPL Graphical Editor.
- Edit element properties
- Use the Properties view to edit properties, such as operator clauses, parameters, and schemas. The SPL Graphical Editor uses this information to generate SPL code for your SPL application. Right-click an element and click Edit to open the Properties view for the selected element.
- Outline view
- Use the Outline view to provide a high-level view of the complete SPL graph. In the Outline view, the current section of the graph that is visible in the SPL Graphical Editor is highlighted in yellow.
- Quick Outline view
- Use the Quick Outline view to quickly find elements in the graph. Press Ctrl-O to open the Quick Outline view and in the filter field, specify the elements that you want to search. You can modify the scope of the search to include elements, such as operators, schemas, attributes, and tags. When you select an element, the corresponding element is highlighted in the graph.
- Validation
- You must correct all errors in the SPL graph before you can generate SPL code. The Validation layer, when enabled, shows elements that have errors that are associated with them. Disable the Validation layer if you are designing an application that is not yet implemented.
- Reuse elements
- The Current Graph category in the palette lists all the composite operators and schemas that are defined in the current graph. You can reuse these operators and schemas in your application to replicate the operator-defined logic or schemas.
- Synchronize SPL graph and SPL source code
- If you edit SPL source code in a text editor, the SPL Graphical Editor reloads the graph to reflect the changes that you made in the SPL source file. Similarly, if you edit an SPL graph in the SPL Graphical Editor, the SPL Graphical Editor updates the SPL source file to reflect the changes that you made in the graph.
- Note Annotations
- You can add note annotations to elements to explain the behavior of the element or to share information about a particular element. Note annotations are displayed as green-colored notes in the SPL Graphical Editor. To add note annotations, you must enable the note annotation layer. To hide the note annotations, disable the note annotation layer.
- Add SPL annotations
- You can add the following SPL annotations in the SPL Graphical Editor by right-clicking the @ character on an operator in the current graph: parallel, consistent, autonomous, view, catch, threading, and eventTime.
- Color Schemes
- Color is used to distinguish characteristics of operators that are displayed in the graph. The color can indicate category, consistent region, relative host constraint, operator type, and relative partition constraint of an operator.
- Code Templates
- Operators that have code templates that are defined in their models have additional palette elements that can be dragged and dropped onto the canvas. These template elements create operators that include the appropriate clauses and ports. The code templates are the same templates made available through content assist in the SPL editor. Filter and search also show code templates for operators whose model defines a code template.