Designing Intelligent Event Processor (IEP) Projects

Output Operators

Output operators enable you to send data from an event process to an external source.

Batched Stream Output

The Batched Stream Output operator enables you to output events in batches, rather than one event at a time.

Depending on the downstream JBI component, this approach can improve performance. For example, if you are using IEP with the File Binding Component, sending 10 events at a time might be faster than sending one event at a time.

ProcedureTo Create a Batched Stream Output Operator

  1. Drag a Batched Stream Output operator from the Palette to the Design view.

  2. Connect the input of the new Batched Stream Output component to an operator that has stream output.

  3. Double-click the Batched Stream Output operator.

    The property editor opens. Notice that the component has inherited the schema of its input stream.

  4. If you want to include a timestamp on the output, then select the Include Timestamp check box.

  5. In the Batch Size field, specify the number of events in a batch.

  6. In the Maximum Delay field and drop-down list, specify the maximum amount of time that the operator will wait before sending a batch.

    For example, assume that the batch size is 10 and the maximum delay is 30 seconds. If 30 seconds have passed since the previous batch was sent, and only eight events have arrived, then the operator sends the eight events.

  7. (Optional) Click the Documentation tab and supply notes on this component.

  8. Click OK.

Invoke Stream

The Invoke Stream operator enables you to send a stream of data from one event process directly to another event process. The stream does not go through the Normalized Message Router.

For example, you could create two event processes:

You could then configure the Invoke Stream operator in the second event process to send data to the first event process.

ProcedureTo Create an Invoke Stream Operator

  1. Create an event process that will receive a stream of data from another event process. This event process must contain a Stream Input operator.

  2. Create an event process that will send a stream of data to the first event process. This event process must contain an Invoke Stream operator.

  3. Double-click the Invoke Stream operator in the second event process.

    The property editor opens.

  4. Click the ellipsis.

    The Select Stream Input dialog box appears.

  5. Expand the node that represents the first event process and select the Stream Input operator.

  6. Click OK to close the Select Stream Input dialog box.

  7. The Inputs area contains the attributes of the second event process. Drag and drop attributes from the Inputs area to the Expression column in the SELECT area.

  8. (Optional) Click the Documentation tab and supply notes on this component.

  9. Click OK to close the property editor.

    Now you can deploy both event processes. When an event is sent to the stream input of the second event process, the Invoke Stream operator sends the event to the stream input of the first event process.

Relation Output

The Relation Output operator sends out groups of tuples that reflect its input. When an event triggers a change in a relation result, the operator sends out changes rather than an entire result each time a triggering event is received.

The Relation Output operator sends out groups of tuples that reflect changes in the relation result. Whenever an event triggers a change in the relation result, the operator sends out records with a tag on the end. If the tag is a plus sign (+), then the record has been added. If the tag is a minus sign (-), then the record has been deleted.

If a change occurs as a result of the triggering event such that a record changes, IEP sends a delete record matching the changed record. IEP sends an add record when there is an updated or new version of that record. The operator only sends out change events rather than repeatedly sending the entire result.

If a triggering event enters into the event process, but the result of the final relation from that event does not change, then the relation output is not triggered and data is not sent.

Use the Relation Output operator to provide a summary of data that has been added or deleted.

ProcedureTo Create a Relation Output Operator

  1. Drag a Relation Output operator from the Palette to the Design view.

  2. Double-click the Relation Output operator.

    The property editor opens.

  3. If you want to include a timestamp on the output, then select the Include Timestamp check box.

  4. Click OK.

Save Stream

The Save Stream and Replay Stream operators are intended to help you perform diagnostics. For example, you can use these operators when the output from an IEP Module project is not the expected output.

You first enable the Save Stream operator to begin saving an input stream to a database table. You then use the Replay Stream operator to replay the events that the Save Stream operator saved to the database table.

Before you begin, you must deploy an event process that contains a Stream Input operator.


Note –

If you know up front that you want to save an input stream to a database table, then you can use the Save Stream operator at design time. The property editor enables you to configure the same properties described in the following procedure.


ProcedureTo Enable the Save Stream Operator Dynamically at Runtime

  1. Start the IEP monitoring and debugging tool. For detailed information about this tool, see the Open ESB wiki.

  2. Run the listIEP command. You must specify the IEP service unit name as a parameter. You can find the service unit name by going to the Services window of the IDE and expanding the Servers node, the GlassFish V2 node, the JBI node, the Service Assemblies node, and the individual service assembly node.

    The command returns a list of plan names. For example:


    [IEP] listIEP CompositeApp1-IepModule1
    test_iep
  3. Run the listOperators command. You must specify the plan name as a parameter.

    The command returns a list of the operators in the event process. For example:


    [IEP] listOperators test_iep
    StreamInput0
    StreamOutput0
  4. Run the addSaveStream command. You must specify the following parameters: the plan name, the name of the Stream Input operator, the JNDI name of the database resource, and the name of the database table where the input stream will be saved. You can optionally specify a boolean parameter called Is Global, which indicates whether the table and its data are kept between deployments. By default, the Is Global parameter is set to true.

    The command returns the name of the Save Stream operator that was added. For example:


    [IEP] addSaveStream test_iep StreamInput0 jdbc/iepseDerbyNonXA STOCKTRANSACTIONS false
    The result is StreamInput0SaveStream0
  5. The Save Stream operator begins saving the input stream to the database table. If the table name that you specified does not exist, then the table is created.

ProcedureTo Disable the Save Stream Operator Dynamically at Runtime

  1. Start the IEP monitoring and debugging tool. For detailed information about this tool, see the Open ESB wiki.

  2. Run the removeSaveStream command. You must specify the following parameters: the plan name and the name of the Save Stream operator. For example:


    [IEP] removeSaveStream test_iep StreamInput0SaveStream0
  3. The Save Stream operator stops saving the input stream to the database table.

    If the Is Global parameter of the addSaveStream command was set to true, then the table and its data are not deleted. However, if you subsequently modify the schema of the stream input (for example, by adding a column) and re-enable the Save Stream operator, then the table and its data are deleted at that time.

    If the Is Global parameter of the addSaveStream command was set to false, then the table and its data are deleted.

Stream Output

The Stream Output operator enables you to convert a stream of events into outgoing messages that can be sent to the Normalized Message Router and received by any JBI component.

When the WSDL document for the event processor is automatically generated, IEP uses the Stream Output operator to define various WSDL elements. For example, if the Stream Output operator is called SuspiciousTransactions, then the WSDL document contains an operation called SuspiciousTransactions and a message called SuspiciousTransactions_Msg.

ProcedureTo Create a Stream Output Operator

  1. Drag a Stream Output operator from the Palette to the Design view.

  2. Connect the input of the Stream Output operator to an operator that has stream output.

  3. Double-click the Stream Output operator.

    The property editor opens. Notice that the component has inherited the schema of its input stream.

  4. If you want to change the default name, then change the value in the Name field.

  5. If you want to include a timestamp on the output, then select the Include Timestamp check box.

  6. (Optional) Click the Documentation tab and supply notes on this component.

  7. Click OK.

Table Output

The Table Output operator provides static output in the form of relational tables.

Use the Table Output operator to provide relational table output from an event processor.

ProcedureTo Create a Table Output Operator

  1. Drag a Table Output operator from the Palette to the Design view.

  2. Double-click the Table Output operator.

    The property editor opens.

  3. If you want to share the table related to the Table Output with other IEP processes or other applications, then select the isGlobal parameter.

    The table related to the Table Output is created if it does not exist. The table remains after the undeployment or redeployment of the IEP process that contains it. IEP generates an additional column for every table that is output.