The StreamBase Server process that runs when you start StreamBase Studio typechecks the streams, operators, data constructs, and module references that appear in the EventFlow Editor.
Typechecking is the process of ensuring that tuples output
by one component or statement in an application have the schema required to be
processed by the components or statements to which they are routed. For StreamSQL
applications, typechecking involves validating the StreamSQL code. For EventFlows,
typechecking also includes validation of the component's properties. That is,
typechecking validates the syntax of the XML elements that define the properties.
This validation is done because you may have edited the sbapp file's XML directly, outside of Studio.
By default, the Typecheck Errors view is located in the bottom center portion of the SB Authoring perspective. The Typecheck Errors view displays typecheck problems found in the selected EventFlow Editor or StreamSQL Editor.
When editing an EventFlow that contains typecheck errors, the Typecheck Errors view displays a row for each error detected. When you single-click a row:
-
The component experiencing the error is centered and selected in the EventFlow Editor.
-
The Properties view displays the properties for that component, with a
red error icon on the tab that has the problem.
-
The error in the Typecheck Errors view becomes italicized.
In the following figure, the Typecheck Errors view shows an application with one typecheck error, which is already selected in the view.
Important
If you are editing the properties of a component in its Properties View, you can apply your changes and see any new typecheck errors by using one of the following methods:
-
Click the
button near the top-right area of the Properties view
-
Enter Ctrl-T
-
Click off the Properties view
Note
In some cases, after switching among multiple EventFlow or StreamSQL applications, components in an EventFlow may appear to not typecheck. For example, downstream components may have a gray background. Before assuming there is a typecheck problem, try clicking the Typecheck button shown above, invoking → in the top menu, or enabling the Automatically typecheck components option in your StreamBase preferences.
In the figure above, notice how certain components in the EventFlow Editor (myMerge, and MergeOut) have different color circles around them. These colors indicate different levels of typechecking severity. Only red typecheck errors, the most severe, are displayed in the Typecheck Errors view.
The following list explains what each of these typecheck status colors indicates, in order of severity from least severe to most severe:
- White
-
The component typechecks successfully.
- Gray
-
The component has not yet had its typecheck status evaluated, because a prior connected component failed typechecking. (In the figure above, this is the problem with MergeOut.)
- Light yellow
-
The meaning varies by component:
-
For an input stream, a schema has not yet been assigned.
-
For an operator, at least one of the input ports is not yet connected to a stream.
-
For a data construct, the data construct has not yet been edited.
-
- Red
-
The component failed the typechecking evaluation.
Note
If the application's sbapp file contains invalid
XML parameters (for example, if it was edited incorrectly outside of
StreamBase Studio), the sbapp file may
not load in StreamBase Studio.
StreamSQL Editor sessions alway typechecks your work, and are not affected by the Automatically typecheck components setting in StreamBase Preferences. Typecheck errors are indicated by error icons in the StreamSQL Editor and in the Typecheck view, as shown in the following screen:
The Typecheck Errors view displays a row for each error detected. The row includes an information message and the line on which it occurs. In the preceding example, the message indicates that the statement is incomplete, and the red error icon in the StreamSQL Editor indicates the line of code with the error.
It is possible that not all errors in your code are shown. Some errors may prevent the parser from proceeding and showing later errors. Thus, as you resolve errors, new errors may be displayed.
For more information about resolving errors, see the StreamSQL Editor topic.
Two settings control whether typechecking is enabled, and under what circumstances.
- StreamBase Preferences
-
By default, typechecking occurs automatically as you build your EventFlow. You can disable automatic typechecking for EventFlow Editors (but not for StreamSQL Editors). To do so, invoke → , then → . At the top of the Authoring page, uncheck Automatically typecheck components.
This setting disables automatic typechecking while you make changes in any EventFlow Editor session. You can still typecheck manually by selecting → from the top menu, or by pressing Ctrl-T.
- Project menu > Build Automatically
-
When Build Automatically in the menu is checked, whenever you save an EventFlow or StreamSQL Editor session, the saved application and all StreamBase applications in your workspace are typechecked. With this menu item unselected, automatic typechecking on save does not occur.
This setting affects the automatic typechecking of all StreamBase applications in your workspace when any application is saved. By contrast, the Preferences setting above affects automatic typechecking only while working in EventFlow Editor sessions.
If you need more room for a column in the Typecheck Errors view, you can select the divider line in the header row, and drag it to the desired width. Doing this to the Description column may give you a better view of the descriptions of typecheck errors.
If you right-click a row in the Typecheck Errors view, StreamBase Studio presents you with one or both of these options:
- Copy
-
Copies the typecheck error onto the clipboard, so you can paste it elsewhere.
- Properties
-
For EventFlows only, opens a Typecheck Properties dialog that provides more room to read lengthy error messages.
To display a context-sensitive Help view or an InfoPop that provides a brief description of the view and links to more information, click anywhere in the view and press F1 on Windows, or Ctrl-F1 on Linux.
