Adding an Input Adapter

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

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 creating a schema when using an adapter that supports schema discovery.

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.

  1. Open the Input Adapters compartment in the Palette (to the right of the diagram) and locate the adapter you want.
    For this example, choose the adapter_in File XML Input adapter, which reads data from an XML file.
  2. Click the adapter in the Palette, then click in the diagram.
    Do not try to drag-and-drop from the Palette into 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. Configure the adapter for schema discovery:
    Required properties are in red.
    Note: Leave Use named property set unchecked, as this option does not allow you to discover the schema for this adapter.
    1. Click in the Value column for Directory and click the Browse button (browse button).
    2. Click the Browse button in the Directory dialog to select the folder with the data files you want the adapter to read. Click OK.
      For this example, specify the absolute 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.1\workspace\exampledata

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

      Note: The file property is set automatically in the next task, when you select a file for schema discovery.
  6. Click OK, then press Ctrl+S to save.
Next
Import the schema and create a connected input stream or window with the same schema as the data file.
Related concepts
Schema Discovery Using Input Adapters