IBM Streams 4.2

Composite operators

A composite operator contains one or more operators that define a streams graph.

Composite operator definition

To create a composite operator in the SPL Graphical Editor, drag the Composite element from the palette onto the canvas. If you drag the Composite element onto an existing composite operator, the following two elements are added to the graph:
  • Composite operator definition
  • Composite operator invocation.
Use the composite operator definition to add operators, connect streams, and define properties. Any changes that are made to the composite operator definition are reflected in all invocations of that operator. The invocation is a read-only version of the operator. When you create a composite operator definition, the SPL Graphical Editor adds the composite operator to the palette under the Current Graph > Composites category.
Tip: If a composite operator is invoked in more than one composite operator, create the composite operator in a separate file or in a file with other common composite operator definitions.

Connecting operators in a composite operator

To connect to the output ports of a composite operator:
  1. Select the output port of the operator, which you want to connect to the output port of the composite operator.
  2. Drag the mouse to connect to a port on the composite operator’s edge.

    A "ghost port" might appear on the edge of the composite operator when you select, and you can connect to this port to create a new output port. As you drag the connection, the target port turns green if it is valid to make the connection to that port.

To connect to the input ports of a composite operator:
  1. Select the input port of the composite operator and drag the mouse to connect to an operator’s input port in the composite.
  2. If there are no input ports currently defined on the composite operator you can choose any one of the following methods:
    • Click the Toggle Link button This figure shows the toggle link icon in the graphical editor. to switch to link mode. This action causes "ghost ports" to appear, which you can then select and connect to an operator’s input port within the composite. This action also creates a new input port on the composite operator.
    • From the palette, drag an input port and drop it on the composite operator. This action creates a new input port.

Composite operator invocation

A composite operator invocation is similar to any other operator invocation. You can edit the properties to define values for the parameters. You can expand or collapse the composite operator to view the subgraph of the composite operator.