Apama 10.7.2 | Developing Apama Applications | Developing Apama Applications in EPL | Working with Streams and Stream Queries | Defining streams
 
Defining streams
 
Creating streams from event templates
Terminating streams
You can use a stream variable to reference a stream. A stream variable declaration has the following form:
stream<type> name
Replace type with the type of the items in the stream. This can be any Apama type.
Replace name with an identifier for the stream. For example:
stream<Tick> ticks;
A stream variable can be a field in an event. However, you cannot route, enqueue, or send an event that contains a stream variable field.
There are two ways to create a stream:
*From an event template. See Creating streams from event templates.
*From the result of a stream query on some other stream. See Defining stream queries.
To obtain a reference to an existing stream, you must assign from or clone another stream value.
An inert stream never generates any output. There are a number of ways to create an inert stream including, but not limited to, the following:
*Calling new on a stream type or a type that contains a stream
*Declaring a global variable of stream type, or a type that contains a stream
*Spawning a monitor instance that contains a stream value