Adding an Input Adapter

Attach an adapter by inserting it in the diagram, connecting it to a stream or window, and setting properties.

The input adapter identifies the external source for the input stream or window, and translates it into a format that Event Stream Processor Server accepts. You can add adapters to the diagram before or after adding input and output streams or windows.

This example shows you how to insert an adapter, enable it for schema discovery, then generate and attach the input window and its schema automatically. This is the best practice for adapters that support it.

Alternatively, ESP Studio allows you to create the stream or window and then attach an adapter. Use this method for adapters that do not support schema discovery, or where you want to explicitly create an inline schema for input streams or windows.

For a list of adapters that support schema discovery, and descriptions of properties to configure, see the Studio Users Guide.

  1. Open the Input Adapters compartment in the Palette and locate the adapter you want.
    For this example, choose the File XML Input adapter, which reads data from an XML file.
  2. Click the adapter in the Palette, then click in the diagram.
    The adapter shape is inserted but its border is red, indicating it is not complete, until you define its properties and attach it to a stream or window.
  3. In the adapter shape toolbar, click Edit Properties(adapter_in) .
  4. (Optional) In the Adapter Properties dialog, change Name to identify your adapter.
  5. Under Adapter Properties, configure the adapter for schema discovery:
    1. Choose Set properties locally.
      This lets you set properties in the table on the right side of the dialog. Required properties are in red.
      Note: Do not choose Use named property set, as it will not allow you to discover the schema for this adapter.
      To use schema discovery for the File XML Input adapter, set the Directory and File properties to specify the absolute path to the data files you want the adapter to read.
    2. Click in the Value column for Directory, and click the button to browse for the directory with the data files. Then enter the File value.
      For this example, specify the path to the sample data installed with the product.
      Property Value
      Directory

      workspace_install_path\exampledata

      Windows default: C:\Documents and Settings\username\My Documents\SybaseESP\5.0\workspace\exampledata

      Linux and Solaris default: your_home_directory/SybaseESP/5.0/workspace/exampledata

      File positions.xml
  6. Press OK to save.
Next
Import the schema and create a connected input stream or window with the same schema as the data file.
Related concepts
Input and Output Adapters