Class QueryWorkflowInstances.Builder

  • Enclosing class:
    QueryWorkflowInstances

    public static class QueryWorkflowInstances.Builder
    extends Object
    Builder for workflow instance queries.
    • Constructor Detail

      • Builder

        public Builder()
        Create a workflow instance query builder.
    • Method Detail

      • addTypes

        public QueryWorkflowInstances.Builder addTypes​(String... newTypes)
        Add workflow definitions types to query parameters.
        Parameters:
        newTypes - The types.
        Returns:
        this.
      • setParentWorkflowId

        public QueryWorkflowInstances.Builder setParentWorkflowId​(Long parentWorkflowId)
        Set parent workflow instance id to query parameters.
        Parameters:
        parentWorkflowId - The parent workflow instance id.
        Returns:
        this.
      • setParentActionId

        public QueryWorkflowInstances.Builder setParentActionId​(Long parentActionId)
        Set parent action id to query parameters.
        Parameters:
        parentActionId - The parent action id.
        Returns:
        this.
      • addStates

        public QueryWorkflowInstances.Builder addStates​(String... newStates)
        Add workflow states to query parameters.
        Parameters:
        newStates - The state names.
        Returns:
        this.
      • setBusinessKey

        public QueryWorkflowInstances.Builder setBusinessKey​(String businessKey)
        Set business key to query parameters.
        Parameters:
        businessKey - The business key.
        Returns:
        this.
      • setExternalId

        public QueryWorkflowInstances.Builder setExternalId​(String externalId)
        Set external identifier to query parameters.
        Parameters:
        externalId - The external identifier.
        Returns:
        this.
      • setStateVariable

        public QueryWorkflowInstances.Builder setStateVariable​(String stateVariableKey,
                                                               String stateVariableValue)
        Set state variable key and value to query parameters.
        Parameters:
        stateVariableKey - State variable key.
        stateVariableValue - State variable vaue.
        Returns:
        this.
      • setIncludeActions

        public QueryWorkflowInstances.Builder setIncludeActions​(boolean includeActions)
        Set whether workflow actions should be included in the results. Default is `false`.
        Parameters:
        includeActions - True to include actions, false otherwise.
        Returns:
        this.
      • setIncludeCurrentStateVariables

        public QueryWorkflowInstances.Builder setIncludeCurrentStateVariables​(boolean includeCurrentStateVariables)
        Set whether current workflow state variables should be included in the results. Default is `false`
        Parameters:
        includeCurrentStateVariables - True to include state variables, false otherwise.
        Returns:
        this.
      • setIncludeActionStateVariables

        public QueryWorkflowInstances.Builder setIncludeActionStateVariables​(boolean includeActionStateVariables)
        Set whether state variables for workflow actions should be included in the results. Default is `false`.
        Parameters:
        includeActionStateVariables - True to include state variables, false otherwise.
        Returns:
        this.
      • setIncludeChildWorkflows

        public QueryWorkflowInstances.Builder setIncludeChildWorkflows​(boolean includeChildWorkflows)
        Set whether child workflow IDs created by this instance should be included in the results. Default is `false`.
        Parameters:
        includeChildWorkflows - True to include child workflows, false otherwise.
        Returns:
        this.
      • setMaxResults

        public QueryWorkflowInstances.Builder setMaxResults​(Long maxResults)
        Set the maximum number of instances to be returned. The maximum value is limited by `nflow.workflow.instance.query.max.results` configuration property. If the value is not set, the value of `nflow.workflow.instance.query.max.results.default` configuration property is used instead.
        Parameters:
        maxResults - The maximum number of instances to be returned.
        Returns:
        this.
      • setMaxActions

        public QueryWorkflowInstances.Builder setMaxActions​(Long maxActions)
        Set the maximum number of actions returned for each instance. The maximum value is limited by `nflow.workflow.instance.query.max.actions` configuration property. If the value is not set, the value of `nflow.workflow.instance.query.max.actions.default` configuration property is used instead.
        Parameters:
        maxActions - The maximum number of actions to be returned.
        Returns:
        this.
      • setQueryArchive

        public QueryWorkflowInstances.Builder setQueryArchive​(boolean queryArchive)
        If true, query also the archive tables if not enough results are found from the main tables.
        Parameters:
        queryArchive - True if archive tables should also be queried.
        Returns:
        this.
      • build

        public QueryWorkflowInstances build()
        Create the workflow instance query object.
        Returns:
        Workflow instance query.