Query

The Query activity is used to retrieve the entries that match the conditions you specified in the associated space.

General

In the General tab, you can specify the activity name and a space connection.

The following table describes the fields in the General tab of the Query activity:

Field Module Property? Description
Name No Specifies the name to be displayed as the label for the activity in the process.
Space Connection Yes Click the icon to select a space connection that defines how the application joins the space.

Tuples are retrieved in the space with the defined distribution role of the selected space connection.

If no matching space connections are found, click Create Shared Resource to create one. See Creating a Metaspace Connection for details.

Timeout(milliseconds) Yes Specifies the amount of time in milliseconds that you have to wait before the Query activity returns results.
Note: The default value is 60000 milliseconds. If the value is -1 or smaller than -1, it indicates waiting indefinitely.

If the field is blank, the value of the field is -1. If the value is 0, an error message is displayed.

Description

In the Description tab, you can enter a short description for the Query activity.

Advanced

In the Advanced tab, you can specify the advanced configurations, such as entries retrieval and the number of tuples returned from a Query operation.

The following table describes the fields in the Advanced tab of the Query activity:

Field Module Property? Description
DistributionScope Yes Select a distribution scope to narrow down the set of entries to be browsed:
  • ALL: retrieves all the entries in the space. By default, this option is selected.
  • SEEDED: retrieves only the entries actually distributed to the member when this activity is invoked.
BrowserType Yes Select a browser type from the following options:
  • GET: retrieves the matched entries. By default, this option is selected.
  • TAKE: retrieves the matched entries and removes them.
  • LOCK: retrieves the matched entries and locks them.
Note: Only the GET option is available when you select CURRENT from the TimeScope list.
Prefetch Yes Specifies the number of records that are prefetched for each seeder in parallel with the processing of the result tuples.

The default value is 1000. The special value of -1 indicates that the entire result set is pushed to the client at once.

TimeScope Yes Select a time scope to narrow down the period of time of interest:
  • SNAPSHOT: the browser starts with all the tuples in the space when the browser is created, instead of being updated with new tuples that are put into the space.
  • CURRENT: the client applications create queries that return large result sets using less resources. By default, this option is selected.
QueryLimit Yes Specifies the number of tuples returned from a query operation.

The value of -2 indicates that the value specified in the Query Limit field in the Advanced tab of the Space shared resource is used.

The value of -1 indicates that all the matched tuples are retrieved.

This field is displayed only when you select SNAPSHOT from the TimeScope list in the Advanced tab.

Input

In the Input tab, you can specify the filter and the number of tuples returned from a query operation in the following items:

Input Item Data Type Description
Filter String Specifies a filter string.

A filtered query only returns the entries that match the specified filter.

The way filters work in the plug-in is similar to the way message selectors work in JMS.
Note: Ensure that the filter syntax is correct according to the TIBCO ActiveSpaces documentation. If an invalid filter is given, no results are reported.

See TIBCO ActiveSpaces Developer’s Guide for detailed information on how to use filters.

DistributionScope String Specifies the type of the distribution scope to narrow down the set of entries being browsed.
TimeScope String Specifies a time scope to narrow down the set of entries being browsed.
BrowserType String Specifies a browser type.
Prefetch Integer Specifies the number of records that are prefetched for each seeder in parallel with the processing of the result tuples.
QueryLimit Integer Specifies the number of tuples returned from a query operation.

The value of -2 indicates that the value specified in the Query Limit field in the Advanced tab of the Space shared resource is used.

The value of -1 indicates that all the matched tuples are retrieved.

Output

In the Output tab, you can find the operation results.

The following table describes the fields in the Output tab of the Query activity:

Output Item Data Type Description
Tuple String Indicates the matched tuple in the associated space.
TotalCount Long Indicates the number of returned tuples.
IsPartialResult String Indicates whether the returned tuples are partial.
  • The value of true indicates that the returned tuples are partial.
  • The value of false indicates that the returned tuples are not partial.
Note: If you select CURRENT from the TimeScope list, IsPartialResult is displayed as a dash (--).

Fault

In the Fault tab, you can find the error code and error message of the Query activity. See Error Codes for more detailed explanation of the errors.

The following table describes the errors in the Fault tab of the Query activity:

Error Schema Element Data Type Description
msg String The TIBCO ActiveMatrix BusinessWorks Plug-in for ActiveSpaces error message.
msgCode String The TIBCO ActiveMatrix BusinessWorks Plug-in for ActiveSpaces error code.
ASStatus String The status code returned by TIBCO ActiveSpaces functions.

See TIBCO ActiveSpaces Java API Reference for more information.