This function is a variation of FlexQuery() function.

It also creates a reference to the subquery specified in the form of a single FlexQuery statement or statement block embedded as the function parameter.

The difference is that this particular function ensures that the specified subquery always returns boolean type.

A lot of other FlexQuery functions, which use the subqueries as their parameters, expect them to return boolean values. When the passed subquery actually returns a non-boolean result, such a function would raise an error during its execution. The BooleanQuery() function was introduced to move the type control from the execution time to the time of designing templates.

The 'BooleanQuery' type returned by this function is a subclass of the 'FlexQuery' type (or more precisely, com.docflex.api.flexquery.FlexQuery class) returned by FlexQuery() function. That means, for instance, that the expression


execFlexQuery(BooleanQuery({ ... }))
will be valid as well.

See Also:

execBooleanQuery(), parseBooleanQuery(), FlexQuery()