Defining Output Streams

You can define one or more output streams, where data exits a StreamBase application. In an EventFlow, output streams are typically the last component in the flow.

Note

Tuple output produced by an operator at runtime is also considered an output stream. These types of output streams are automatically named by StreamBase Studio.

This topic describes the actions you can take on each tab of the output stream's Properties view.

General Tab

Name: Every application component must have a unique name. Use this field to specify or change the component's name. The name must contain only alphabetic characters, numbers, and underscores, and no hyphens or other special characters. The first character must be alphabetic or an underscore.

Description: Optionally, enter a description to briefly describe the component's purpose and function. In the EventFlow canvas, you can see the description by pressing Ctrl while the component's tooltip is displayed.

Schema Tab

The Schema tab allows you to view the schema fields of this output stream. That is, the schema that will be used for dequeued data.

Advanced Tab

The Advanced tab has a single text field, Dequeue predicate expression, which you can optionally use to filter the output. The result can be similar to adding a Filter operator to your application. For example, you might specify a value, a limit, or range of values, such as symbol=='IBM' && price > 85.0.

To be output, a tuple must satisfy any restrictions included in the predicate. If the predicate does not evaluate to true, the tuple is not emitted.

Note

Dequeue predicate expressions affect only network clients; they do not affect any internal container connections — all tuples on the output stream are delivered to internal connected containers.

If the output stream is dequeued by a client application, any filtering in this tab occurs before any filtering performed by the client application (described in Narrowing Dequeue Results with Filtered Subscribe).

In addition to fields available on the stream, output stream predicate expressions can use the following special fields:

subscriptionid

The ID of the current subscription. A field of this name is available on the subscription stream in the system container.

connectionid

ID of the current client connection. A field of this name is available on the connection stream in the system container.

tupleid

ID of the current tuple.

These fields can be used in conjunction with streams available in the system container (see the descriptions of connections and subscriptions in Using Containers).

Note

To avoid name collisions between fields in different containers, you can qualify your field names. For example, system:xxx will not be confused with a field of the same name that occurs on any other stream.

When dequeuing occurs, tuples will be delivered only to clients for whom all of the predicates are true. If a predicate is null, then it will not restrict the stream: the field applies to all clients.