Contents
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.
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
. This generates the schema required for the query. -
Click the Query operator.
In StreamBase Studio, import this sample with the following steps:
-
From the top-level menu, select
> . -
Enter
loglogic
to narrow the list of options. -
Select TIBCO LogLogic Unity Query from the Other TIBCO Product Connectivity category.
-
Click
.
StreamBase Studio creates a single project for the LogLogic Query sample in your current Studio workspace.
This sample demonstrates how to run a cached query on the server and poll for the results until complete using event flow.
Run this sample in Studio as follows:
-
In the Project Explorer, double-click to open the
CachedQueryFullResults.sbapp
application. -
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.
-
In the Manual Input view, select the
QueryIn
input stream.Enter an EQL or SQL query string.
-
Click
. 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.
-
In the Output Streams view look over the results of the
QueryResults
andQueryStatus
streams. -
When done, press F9 or click the Terminate EventFlow Fragment button.
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.
Run this sample in Studio as follows:
-
In the Project Explorer, double-click to open the
LogLogicUnity.sbapp
application. -
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.
-
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 theGetResultsIn
input stream. -
Click
. This triggers the adapter to send data to the LogLogic server. -
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.
-
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). -
Click
, which tells the adapter to get the first result set for the query. -
In the Output Streams view, find the QueryResults message, which contains the query results.
-
In the Manual Input view, select the
DeleteQueryIn
stream. Enter the query ID from the status port mentioned above.Click
, which tells the adapter to delete the query from the server. -
Click
, which tells the adapter to delete the query from the server. -
When done, press F9 or click the Terminate EventFlow Fragment button.
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.