Specify stream properties
The streams are what hold the graph together, so give meaning to them first. Tell the operators how to do their jobs later.
To assign a name and a type to a stream:
- Select the stream (dashed arrow) connecting FileSource_2 and Filter_3. Sometimes you need to try a few times before the cursor catches the stream instead of selecting the enclosing main composite.The Properties view, which you used earlier to create LocationType, now shows stream properties. Reposition and resize the view if necessary so that it doesn’t obscure the graph you’re editing. If you closed the Properties view, double-click the stream to reopen it.
- Enter descriptive stream names, which are preferable to the placeholder names generated by the editor, by clicking Rename in the Properties view (General tab).
- In the Rename dialog, under Specify a new name, enter
Observationsand click OK.Notice that this saves the file and starts a build. This is because renaming an identifier is a form of refactoring, which means that not only the identifier itself but also any references to it must be found and updated. This requires a compilation step to ensure that the code is consistent and all references are known.
Specify the stream schema. You can do that in the Properties view, but because you already created a type for this, you can also drag and drop it in the graphical editor like any other object.
- In the graphical editor, clear the palette filter by clicking the Eraser button next to where you entered
filThis makes all the objects visible again.
- Under Current Graph, expand Schemas. This shows the LocationType type and the names of the two streams in the graph.
- Select LocationType and drag it into the graph. Drop it onto the Observations stream, which is the one between FileSource_2 and Filter_3. Make sure that the stream’s selection handles turn green as you hover before you let go as shown below:
If you open the Properties view to the Schema tab, it now shows a Type of LocationType and <extends> as a placeholder under Name. This indicates that the stream type does not contain some named attribute of type LocationType, but instead inherits the entire schema with its attribute names and types.
- Using the same drag and drop technique, assign the LocationType type to the other stream between Filter_3 and FileSink_1. Select that stream so that its properties show in the Properties view.
- In the Properties view, General tab, rename the stream to
Note: There is still an error indicator on FileSink_1 and because of that, on the main composite too. This is expected because you have not yet told the FileSink operator what file to write. You also need to provide details for the other operators.