Interface StandardDataQueryBuilder

All Known Implementing Classes:
StandardDataQueryBuilderImpl

public interface StandardDataQueryBuilder
A "standard Flowable query" in this context is a query that queries a certain index with typical 'standard' Flowable concepts such as process/cases definitions, variables, etc.

The alternative is using a custom query template using Freemarker, but this builder is more maintainable when the query becomes larger.

This query is meant for Elasticsearch queries that consist of a query part to filter down data in a bool query that chains AND's and OR's together, and an optional aggregations part to aggregate the filtered data.

  • Method Details

    • returnResults

      StandardDataQueryBuilder returnResults()
      The query won't return any results, which is useful if only the aggregation is relevant.
    • returnNoAggregations

      StandardDataQueryBuilder returnNoAggregations()
      The query won't do any aggregations, even if they are configured. This is useful when reusing a query for e.g. CSV export, where the agregation are irrelevant.
    • forceSourceToBeReturned

      StandardDataQueryBuilder forceSourceToBeReturned()
      By default, when setting a size, the source won't be returned. If this method is called, this forces that the source is returned in the hits. It means no 'fields' will be returned though.
    • start

      StandardDataQueryBuilder start(int start)
      When using paging, this sets the start number of the page.
    • pageSize

      StandardDataQueryBuilder pageSize(int size)
      When using paging, this sets the size of the page.
    • fields

      StandardDataQueryBuilder fields(List<String> hitFields)
      When results are returned, this will make sure only the fields in the passed list are returned. By default, all fields are returned.
    • variables

      StandardDataQueryBuilder variables(List<org.apache.commons.lang3.tuple.Pair<String,String>> variableNameAndTypes)
      When the results are returned, also these variables will be fetched.
    • tenantId

      StandardDataQueryBuilder tenantId(String tenantId)
      Sets the tenantId, which will limit what results are returned from the query. If set, will add the tenantId as requirement and add an AND with any filter set on the root level of this query.
    • userIdentityLinks

      StandardDataQueryBuilder userIdentityLinks(Collection<String> userIds)
      If set, will limit the returned data to only return data that the users with given ids have access to. Flowable adds automatically the user identitylink for every type of user: assignee, owner, participant, watcher and candidate user to the index.
    • groupIdentityLinks

      StandardDataQueryBuilder groupIdentityLinks(Collection<String> groupIds)
      If set, will limit the returned data to only return data that the users with given groups have access to. Flowable adds automatically the group identitylink for every type of group: candidate group, watcher and participant group.
    • and

      Configures the root logical operator of the query to be AND.
    • or

      Configures the root logical operator of the query to be OR.
    • sort

      Sorts the results given the field names and asc/desc in the provided parameter.
    • searchAfter

      StandardDataQueryBuilder searchAfter(List<Object> searchAfter)
      Use for alternative paging by providing from where the querying should start.
    • aggregations

      Define one or more aggregations for the results of this query.
    • build

      com.fasterxml.jackson.databind.node.ObjectNode build()
      Generates the ES query based on the configuration of this builder.