- TIBCO BusinessEvents®
- CEP Query
- Query
- Util

# Query.Util

## Description

Query utility functions.

## Functions

Name | Signature and Synopsis
--- | ---
`addToList` | `int addToList(Object list, Object item)` Adds the given item into the list.
`clearList` | `void clearList(Object list)` Removes all the elements in the list.
`executeInDynamicQuerySession` | `Object executeInDynamicQuerySession(String sqlString, Object mapOfParameters, boolean reuse, long timeout,boolean isNativeQueryRawResults)` Executes the sql string in the collocated, dynamic query session. Obviously the session should've been started beforehand.
`executeInQuerySession` | `Object executeInQuerySession(String querySessionName, String sqlString, Object mapOfParameters, boolean reuse, long timeout,boolean isNativeQueryRawResults)` Executes the sql string synchronously in a collocated query agent and returns the results.
`getDynamicQuerySessionName` | `String getDynamicQuerySessionName()` Returns the name of the collocated query agent that can be started dynamically. This method does not require the session to be running.
`invokeFunctionInQuerySession` | `Object invokeFunctionInQuerySession(String querySessionName, String queryRuleFunctionUri, Object[] parameters)` Invokes a rule function in another query session/agent whose name is given along with the parameters.
`listToArray` | `Object[] listToArray(Object list)` Copies the list contents by reference to a new array.
`newArray` | `Object[] newArray(int length)` Creates an Object array.
`newList` | `Object newList()` Creates a new List.
`removeFromList` | `Object removeFromList(Object list, int index)` Removes the element at the given position in the list.
`sizeOfList` | `int sizeOfList(Object list)` Returns the size/length of the given list.
`startDynamicQuerySession` | `void startDynamicQuerySession()` Starts a collocated query session, dynamically. The name is always fixed. Only 1 such session can be started per JVM.