XML File Writer Output Adapter Sample

This sample demonstrates the usage of the embedded XMLFileWriter adapter.

Importing This Sample into StreamBase Studio

In StreamBase Studio, import this sample with the following steps:

  • From the top menu, click FileLoad StreamBase Sample.

  • Select this sample from the Embedded Adapters list.

  • Click OK.

StreamBase Studio creates a single project containing the sample files.

Installed Sample File Locations

By default, the sample files are installed in:

On Windows

C:\Program Files\StreamBase Systems\StreamBase.n.m\sample\adapter\embedded\xmlfilewriter\

On UNIX

/opt/streambase/sample/adapter/embedded/xmlfilewriter/

Running the XMLFileWriter Sample in StreamBase Studio

  1. Open the XMLFileWriterTest.sbapp sample.

  2. In the EventFlow editor click the XMLFileWriter adapter icon to open its Properties view.

  3. In the Adapter Settings tab, change File Name to point to a location on your machine where you want the log to be written when the application is run.

  4. Make sure the application is the currently active tab in the EventFlow Editor.

    Click the Run StreamBase Application (Default Launch) button. (Not the Run button.) This opens the Test/Debug perspective and starts the application.

  5. Select the Manual Input tab.

  6. Enter a valid integer for a and press Send Data.

  7. Click RunStop StreamBase Application (F9).

  8. The file specified in File Name should now contain tuples formatted as follows:

    <tuple>
    <a>2</a>
    </tuple>

Running the XMLFileWriter Sample in Terminal Windows

  1. Change the current working directory to where the sample is installed.

  2. Run sbd XMLFileWriterTest.sbapp.

  3. In another window, run sbc enqueue InputStream1 < inputstream.dat.

  4. Run sbadmin shutdown to exit sbd.

  5. The file specified in File Name should now contain a log of tuples.