Contents
This topic describes how to run the TIBCO LogLogic Unity Query Adapter sample applications, which illustrate how to use the operator with a TIBCO LogLogic Unity server. For more information on this adapter, see TIBCO LogLogic Unity Query Input Adapter.
You must configure the sbd.sbconf
file before running either of the following sample applications. The options in the sbd.sbconf
file configure the sample applications to connect to your LogLogic Unity server. Do the following:
-
Open the
sbd.sbconf
file. -
Edit the operator-parameter value fields for your LogLogic Unity 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.
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 Package 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 application.
-
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 Unity 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 Application Output view look over the results of the
QueryResults
andQueryStatus
streams. -
When done, press F9 or click the
Stop Running Application 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 Package 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 application.
-
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 Unity server. -
In the Application Output 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 Application Output 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
Stop Running Application button.
In StreamBase Studio, import this sample with the following steps:
-
From the top-level menu, select
→ . -
Type
active
to narrow the list of options. -
Select TIBCO LogLogic Unity Query from the Extending StreamBase category.
-
Click OK.
StreamBase Studio creates a single project for the LogLogic Unity Query sample in your current Studio workspace.
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 the permission problems that can occur when trying to work with the initially installed location of the sample. The default workspace location for this sample is:
studio-workspace
/sample_adapter_embedded_tibco-loglogic-unity
See Default Installation Directories for the location of studio-workspace
on your system.
In the default TIBCO StreamBase installation, this sample's files are initially installed in:
streambase-install-dir
/sample/adapter/embedded/tibco-loglogic-unity
See Default Installation Directories for the default location of studio-workspace
on your system.