Try OpenEdge Now
skip to main content
BP Server Developer's Guide
Query service : Query service results

Query service results

Every request to the QueryService library returns QSResult that wraps the BP Server SVO. There are three types of QSResult:
*QSWorkItemRS — WorkItem requests.
*QSWorkStepInstanceRS — WorkStepInstance requests.
*QSProcessInstanceRS — ProcessInstance requests.
The type of SVO returned depends on the type of QSResult as described in Table 11.
Table 11. QSResult and SVOs
SVO type
The size of SVO can be controlled from the QSResult, for the full list, a particular index, or a range of indices.
*QSResult.getSVOList() returns the complete list, and empty java.util.Vector if the size is 0.
*QSResult.getSVOList(from, to) returns a portion of the list between the specified from Index and to Index. The returned list includes the from Index, but excludes the to Index. If the from Index and the to Index are the same, then the returned list is empty. The returned list is backed by the complete list, so that changes in the returned list are reflected in the complete list, and vice versa. The returned list supports all of the optional list operations supported by the complete list. If the to Index is greater than the actual size of the complete list, then the to Index is equal to the size of the complete retrieved list.
It throws an exception for an illegal endpoint index value, such as from Index being less than to Index. Refer to java.util.List for more details.
*QSResult.getSVO(index) returns the SVO if the index is valid. Otherwise, an exception is raised. Note that the exception is raised if the index is out of range.
Note: The getSVOList returns a list of SVOs. The value of each Index must be cast to the appropriate SVO type before any operation is requested. Similarly, getSVO returns BLProcess but must be cast to the appropriate SVO type before any operation is requested.
The index passed should follow the Java array syntax, where the index starts from 0 and not 1. If the size is 10, then the last index is 9.
If additional columns are specified in the filter, then getAdditionalColumn() returns a HashMap, with keys as column names (alias names if specified), and values as:
*OBJECT, if the dataslot type is object / collection type. The object can be retrieved based on the Alias mentioned, or on the collection dataslot in the column definition of the Filter, and can be cast into the appropriate object type.
*String for all other types.
*For LOGICAL dataslots, the value is 1 for true and 0 for false.
    String boolValue = (String)hm.get("BOOLDS");
    boolean bool = (Boolean.valueOf(boolValue)).booleanValue();
*For INTEGER dataslots, the Decimal SVO can be constructed as follows:
    String decimalValue = (String)hm.get("DECIMALDS");
    Decimal decimal = new Decimal(decimalValue);
*The DATETIME-TZ SVO can be constructed as follows:
    String datevalue = (String)hm.get(DATETIMEDS");
    DateTime dt = new DateTime(datevalue);
Note: A valid BP Server session should be passed if the SVO obtained has to communicate with BP Server.