Add an input window to the diagram in the sample
my_portfolio_valuation project.
These steps let you create an input window directly, and define the
schema, without importing a schema.
If you used the input adapter to
discover the schema and generated both input windows automatically, skip these steps and
go directly to the next task.
- In the Visual editor, in the Palette to the right of the diagram,
open the Streams and Windows compartment.
- Click
Input
Window.
- Click in an empty area in the diagram where you want to insert the
input window.
The input window object is added to the project. The red
border indicates that it needs more definition to be valid.
- To set the name of the input window, either:
- In iconic mode, click once to select the shape, then click
again to edit the name.
- In verbose mode, click the edit icon next to the
name.
For this example, enter the name
PriceFeed.
- Click the "plus" sign to expand the shape to verbose mode if
necessary, and click Add Column (
) on the toolbar in the input
window, to add each new column.
Tip: Hover over any icon to see its name.
A new column is created with a default name, and default
datatype of integer.
- Specify additional columns.
- Double-click each column name to edit it.
- Then double-click each datatype to select the correct datatype.
For this example, enter these column names and datatypes:
- Id – integer
- Symbol – string
- TradeTime – date
- Price – float
- Shares – integer
- Click the
button for the Id column to toggle it to the Key
symbol. Input windows require a primary key.
The Id column is now the primary key for the PriceFeed input
window. The red warning border disappears, indicating that
the element is now valid.
- Create a retention window.
- Click Set Keep Policy
.
- In the Edit Keep Policy dialog, choose Time, and enter
10 MIN in the text box to its right. Click
OK.
The default policy is to keep all rows of incoming data.
This step defines a CCL KEEP clause, and retains all
price events received in the last 10 minutes. Without a KEEP
clause, the PriceFeed window would grow infinitely large. For more information on
specifying a retention policy, see the Studio Users Guide.
- Save (Ctrl+S).
This saves changes to both the .cclnotation file (the
diagram) and the .ccl file (the CCL).
The input window and its schema (or deduced schema) are in the
diagram.