TIBCO LogLogic Query Adapter Samples

This topic describes how to run the TIBCO LogLogic Query Adapter sample applications, which illustrate how to use the operator with a TIBCO LogLogic server. For more information on this adapter, see TIBCO LogLogic Query Input Adapter.

Samples Setup in StreamBase Studio

Before running either of the following applications, you must configure your LogLogic server connection. Do the following:

  • Open the engine.conf file.

  • Edit the operatorParameters property for your LogLogic server.

Before running either sample, do the following:

  • Open the sbapp specified by the sample.

  • Locate the Query operator and open its StreamBase Properties page and select the Edit Schema tab.

  • Click the Generate schema from query hyperlink and enter the query you intend to run into the dialog that appears and click OK. This generates the schema required for the query.

  • Click the Query operator.

Importing This Sample into StreamBase Studio

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

  • From the top-level menu, select File>Import Samples and Community Content.

  • Enter loglogic to narrow the list of options.

  • Select TIBCO LogLogic Unity Query from the Other TIBCO Product Connectivity category.

  • Click Import Now.

StreamBase Studio creates a single project for the LogLogic Query sample in your current Studio workspace.

Cached Query Full Results Sample

Sample Overview

This sample demonstrates how to run a cached query on the server and poll for the results until complete using event flow.

Running the Sample in StreamBase Studio

Run this sample in Studio as follows:

  1. In the Project Explorer, double-click to open the CachedQueryFullResults.sbapp application.

  2. Make sure the application is the currently active tab in the EventFlow editor, then click the Run button. This opens the SB Test/Debug perspective and starts the module.

  3. In the Manual Input view, select the QueryIn input stream.

    Enter an EQL or SQL query string.

  4. Click Send Data. This triggers the adapter to connect to the LogLogic server and start the query.

    The event flow is set up to watch the QueryStatus for a Query Start status message containing the query ID as the object, then in turn start a getresults command to pull the query results.

    The QueryResults display the results and feed back into the adapter a new query to get the next set of results if required.

    When the query is complete a delete query command is sent to remove the query from the server.

  5. In the Output Streams view look over the results of the QueryResults and QueryStatus streams.

  6. When done, press F9 or click the Terminate EventFlow Fragment button.

LogLogic Unity Sample

Sample Overview

This sample contains an input stream for the various command types that the adapter can perform. The QueryIn stream can be used for any command and holds all possible input parameters for any parameter. Parameters that are not used for a particular command are ignored.

Running the Sample in StreamBase Studio

Run this sample in Studio as follows:

  1. In the Project Explorer, double-click to open the LogLogicUnity.sbapp application.

  2. Make sure the application is the currently active tab in the EventFlow editor, then click the Run button. This opens the SB Test/Debug perspective and starts the module.

  3. In the Manual Input view, select the CachedQueryIn stream to start a query. Enter a value in the query field. Optionally you can set the pollUntilComplete to true if you want all results to be processed and output. If the value is false you must manually trigger a getresults command by using the GetResultsIn input stream.

  4. Click Send Data. This triggers the adapter to send data to the LogLogic server.

  5. In the Output Streams view, find the Status message which will have an action of Query Started. The object field of the status contains the queryId.

  6. In the Manual Input view, select the GetResultsIn input stream. Enter the query ID from the status port mentioned above. The resultSetId field can be null and defaults to 0 (the first result).

  7. Click Send Data, which tells the adapter to get the first result set for the query.

  8. In the Output Streams view, find the QueryResults message, which contains the query results.

  9. In the Manual Input view, select the DeleteQueryIn stream. Enter the query ID from the status port mentioned above.

    Click Send Data, which tells the adapter to delete the query from the server.

  10. Click Send Data, which tells the adapter to delete the query from the server.

  11. When done, press F9 or click the Terminate EventFlow Fragment button.

Sample Location

When you load the sample into StreamBase Studio, Studio copies the sample project's files to your Studio workspace, which is normally part of your home directory, with full access rights.

Important

Load this sample in StreamBase Studio, and thereafter use the Studio workspace copy of the sample to run and test it, even when running from the command prompt.

Using the workspace copy of the sample avoids permission problems. The default workspace location for this sample is:

studio-workspace/sample_adapter_embedded_tibco-loglogic-unity

See Default Installation Directories for the default location of studio-workspace on your system.