Class ExecutionQueryImpl

  • All Implemented Interfaces:
    Serializable, org.flowable.common.engine.api.query.CacheAwareQuery<org.flowable.engine.impl.persistence.entity.ExecutionEntity>, org.flowable.common.engine.api.query.Query<ExecutionQuery,​Execution>, org.flowable.common.engine.impl.interceptor.Command<Object>, ExecutionQuery

    public class ExecutionQueryImpl
    extends org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
    implements ExecutionQuery, org.flowable.common.engine.api.query.CacheAwareQuery<org.flowable.engine.impl.persistence.entity.ExecutionEntity>
    Author:
    Joram Barrez, Frederik Heremans, Daniel Meyer
    See Also:
    Serialized Form
    • Field Detail

      • processEngineConfiguration

        protected org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl processEngineConfiguration
      • processDefinitionId

        protected String processDefinitionId
      • processDefinitionKey

        protected String processDefinitionKey
      • processDefinitionCategory

        protected String processDefinitionCategory
      • processDefinitionName

        protected String processDefinitionName
      • processDefinitionVersion

        protected Integer processDefinitionVersion
      • processDefinitionEngineVersion

        protected String processDefinitionEngineVersion
      • activityId

        protected String activityId
      • executionId

        protected String executionId
      • parentId

        protected String parentId
      • onlyChildExecutions

        protected boolean onlyChildExecutions
      • onlySubProcessExecutions

        protected boolean onlySubProcessExecutions
      • onlyProcessInstanceExecutions

        protected boolean onlyProcessInstanceExecutions
      • processInstanceId

        protected String processInstanceId
      • rootProcessInstanceId

        protected String rootProcessInstanceId
      • eventSubscriptions

        protected List<org.flowable.eventsubscription.service.impl.EventSubscriptionQueryValue> eventSubscriptions
      • tenantId

        protected String tenantId
      • tenantIdLike

        protected String tenantIdLike
      • withoutTenantId

        protected boolean withoutTenantId
      • locale

        protected String locale
      • withLocalizationFallback

        protected boolean withLocalizationFallback
      • startedBefore

        protected Date startedBefore
      • startedAfter

        protected Date startedAfter
      • startedBy

        protected String startedBy
      • superProcessInstanceId

        protected String superProcessInstanceId
      • subProcessInstanceId

        protected String subProcessInstanceId
      • excludeSubprocesses

        protected boolean excludeSubprocesses
      • suspensionState

        protected org.flowable.common.engine.impl.db.SuspensionState suspensionState
      • businessKey

        protected String businessKey
      • businessKeyLike

        protected String businessKeyLike
      • includeChildExecutionsWithBusinessKeyQuery

        protected boolean includeChildExecutionsWithBusinessKeyQuery
      • isActive

        protected boolean isActive
      • involvedUser

        protected String involvedUser
      • involvedGroups

        protected Set<String> involvedGroups
      • processDefinitionKeys

        protected Set<String> processDefinitionKeys
      • processDefinitionIds

        protected Set<String> processDefinitionIds
      • nameLike

        protected String nameLike
      • nameLikeIgnoreCase

        protected String nameLikeIgnoreCase
      • deploymentId

        protected String deploymentId
      • deploymentIds

        protected List<String> deploymentIds
      • activeActivityId

        protected String activeActivityId
      • activeActivityIds

        protected Set<String> activeActivityIds
      • callbackId

        protected String callbackId
      • callbackType

        protected String callbackType
      • referenceId

        protected String referenceId
      • referenceType

        protected String referenceType
      • inOrStatement

        protected boolean inOrStatement
    • Constructor Detail

      • ExecutionQueryImpl

        public ExecutionQueryImpl()
      • ExecutionQueryImpl

        public ExecutionQueryImpl​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext,
                                  org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl processEngineConfiguration)
      • ExecutionQueryImpl

        public ExecutionQueryImpl​(org.flowable.common.engine.impl.interceptor.CommandExecutor commandExecutor,
                                  org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl processEngineConfiguration)
    • Method Detail

      • isProcessInstancesOnly

        public boolean isProcessInstancesOnly()
      • signalEventSubscriptionName

        public ExecutionQuery signalEventSubscriptionName​(String signalName)
        Description copied from interface: ExecutionQuery
        Only select executions which have a signal event subscription for the given signal name. (The signalName is specified using the 'name' attribute of the signal element in the BPMN 2.0 XML.)
        Specified by:
        signalEventSubscriptionName in interface ExecutionQuery
        Parameters:
        signalName - the name of the signal the execution has subscribed to
      • messageEventSubscriptionName

        public ExecutionQuery messageEventSubscriptionName​(String messageName)
        Description copied from interface: ExecutionQuery
        Only select executions which have a message event subscription for the given messageName. (The messageName is specified using the 'name' attribute of the message element in the BPMN 2.0 XML.)
        Specified by:
        messageEventSubscriptionName in interface ExecutionQuery
        Parameters:
        messageName - the name of the message the execution has subscribed to
      • processVariableValueEquals

        public ExecutionQuery processVariableValueEquals​(String variableName,
                                                         Object variableValue)
        Description copied from interface: ExecutionQuery
        Only select executions which are part of a process that have a variable with the given name set to the given value. Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
        Specified by:
        processVariableValueEquals in interface ExecutionQuery
      • processVariableValueNotEquals

        public ExecutionQuery processVariableValueNotEquals​(String variableName,
                                                            Object variableValue)
        Description copied from interface: ExecutionQuery
        Only select executions which are part of a process that have a variable with the given name, but with a different value than the passed value. Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
        Specified by:
        processVariableValueNotEquals in interface ExecutionQuery
      • processVariableValueEqualsIgnoreCase

        public ExecutionQuery processVariableValueEqualsIgnoreCase​(String name,
                                                                   String value)
        Description copied from interface: ExecutionQuery
        Only select executions which are part of a process that have a local string variable with the given value, case insensitive.

        This method only works if your database has encoding/collation that supports case-sensitive queries. For example, use "collate UTF-8" on MySQL and for MSSQL, select one of the case-sensitive Collations available (MSDN Server Collation Reference).

        Specified by:
        processVariableValueEqualsIgnoreCase in interface ExecutionQuery
        Parameters:
        name - name of the variable, cannot be null.
        value - value of the variable, cannot be null.
      • processVariableValueNotEqualsIgnoreCase

        public ExecutionQuery processVariableValueNotEqualsIgnoreCase​(String name,
                                                                      String value)
        Description copied from interface: ExecutionQuery
        Only select executions which are part of a process that have a local string variable which is not the given value, case insensitive.

        This method only works if your database has encoding/collation that supports case-sensitive queries. For example, use "collate UTF-8" on MySQL and for MSSQL, select one of the case-sensitive Collations available (MSDN Server Collation Reference).

        Specified by:
        processVariableValueNotEqualsIgnoreCase in interface ExecutionQuery
        Parameters:
        name - name of the variable, cannot be null.
        value - value of the variable, cannot be null.
      • processVariableValueGreaterThan

        public ExecutionQuery processVariableValueGreaterThan​(String name,
                                                              Object value)
        Description copied from interface: ExecutionQuery
        Only select executions which have a process instance variable value greater than the passed value. Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
        Specified by:
        processVariableValueGreaterThan in interface ExecutionQuery
        Parameters:
        name - variable name, cannot be null.
        value - variable value, cannot be null.
      • processVariableValueGreaterThanOrEqual

        public ExecutionQuery processVariableValueGreaterThanOrEqual​(String name,
                                                                     Object value)
        Description copied from interface: ExecutionQuery
        Only select executions which have a process instance variable value greater than or equal to the passed value. Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
        Specified by:
        processVariableValueGreaterThanOrEqual in interface ExecutionQuery
        Parameters:
        name - variable name, cannot be null.
        value - variable value, cannot be null.
      • processVariableValueLessThan

        public ExecutionQuery processVariableValueLessThan​(String name,
                                                           Object value)
        Description copied from interface: ExecutionQuery
        Only select executions which have a process instance variable value less than the passed value. Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
        Specified by:
        processVariableValueLessThan in interface ExecutionQuery
        Parameters:
        name - variable name, cannot be null.
        value - variable value, cannot be null.
      • processVariableValueLessThanOrEqual

        public ExecutionQuery processVariableValueLessThanOrEqual​(String name,
                                                                  Object value)
        Description copied from interface: ExecutionQuery
        Only select executions which have a process instance variable value less than or equal to the passed value. Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
        Specified by:
        processVariableValueLessThanOrEqual in interface ExecutionQuery
        Parameters:
        name - variable name, cannot be null.
        value - variable value, cannot be null.
      • variableValueEquals

        public ExecutionQuery variableValueEquals​(String variableName,
                                                  Object variableValue)
        Description copied from interface: ExecutionQuery
        Only select executions which have a local variable with the given value. The type of variable is determined based on the value, using types configured in ProcessEngineConfigurationImpl.getVariableTypes(). Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
        Specified by:
        variableValueEquals in interface ExecutionQuery
        Overrides:
        variableValueEquals in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
        Parameters:
        variableName - name of the variable, cannot be null.
      • variableValueEquals

        public ExecutionQuery variableValueEquals​(Object variableValue)
        Description copied from interface: ExecutionQuery
        Only select executions which have at least one local variable with the given value. The type of variable is determined based on the value, using types configured in ProcessEngineConfigurationImpl.getVariableTypes(). Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
        Specified by:
        variableValueEquals in interface ExecutionQuery
        Overrides:
        variableValueEquals in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
      • variableValueNotEquals

        public ExecutionQuery variableValueNotEquals​(String variableName,
                                                     Object variableValue)
        Description copied from interface: ExecutionQuery
        Only select executions which have a local variable with the given name, but with a different value than the passed value. Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
        Specified by:
        variableValueNotEquals in interface ExecutionQuery
        Overrides:
        variableValueNotEquals in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
        Parameters:
        variableName - name of the variable, cannot be null.
      • variableValueEqualsIgnoreCase

        public ExecutionQuery variableValueEqualsIgnoreCase​(String name,
                                                            String value)
        Description copied from interface: ExecutionQuery
        Only select executions which have a local string variable with the given value, case insensitive.

        This method only works if your database has encoding/collation that supports case-sensitive queries. For example, use "collate UTF-8" on MySQL and for MSSQL, select one of the case-sensitive Collations available (MSDN Server Collation Reference).

        Specified by:
        variableValueEqualsIgnoreCase in interface ExecutionQuery
        Overrides:
        variableValueEqualsIgnoreCase in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
        Parameters:
        name - name of the variable, cannot be null.
        value - value of the variable, cannot be null.
      • variableValueNotEqualsIgnoreCase

        public ExecutionQuery variableValueNotEqualsIgnoreCase​(String name,
                                                               String value)
        Description copied from interface: ExecutionQuery
        Only select executions which have a local string variable which is not the given value, case insensitive.

        This method only works if your database has encoding/collation that supports case-sensitive queries. For example, use "collate UTF-8" on MySQL and for MSSQL, select one of the case-sensitive Collations available (MSDN Server Collation Reference).

        Specified by:
        variableValueNotEqualsIgnoreCase in interface ExecutionQuery
        Overrides:
        variableValueNotEqualsIgnoreCase in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
        Parameters:
        name - name of the variable, cannot be null.
        value - value of the variable, cannot be null.
      • variableValueLike

        public ExecutionQuery variableValueLike​(String name,
                                                String value)
        Description copied from interface: ExecutionQuery
        Only select executions which have a local variable value like the given value. This be used on string variables only.
        Specified by:
        variableValueLike in interface ExecutionQuery
        Overrides:
        variableValueLike in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
        Parameters:
        name - variable name, cannot be null.
        value - variable value, cannot be null. The string can include the wildcard character '%' to express like-strategy: starts with (string%), ends with (%string) or contains (%string%).
      • variableValueLikeIgnoreCase

        public ExecutionQuery variableValueLikeIgnoreCase​(String name,
                                                          String value)
        Description copied from interface: ExecutionQuery
        Only select executions which have a local variable value like the given value (case insensitive). This be used on string variables only.
        Specified by:
        variableValueLikeIgnoreCase in interface ExecutionQuery
        Overrides:
        variableValueLikeIgnoreCase in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
        Parameters:
        name - variable name, cannot be null.
        value - variable value, cannot be null. The string can include the wildcard character '%' to express like-strategy: starts with (string%), ends with (%string) or contains (%string%).
      • variableValueGreaterThan

        public ExecutionQuery variableValueGreaterThan​(String name,
                                                       Object value)
        Description copied from interface: ExecutionQuery
        Only select executions which have a local variable value greater than the passed value. Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
        Specified by:
        variableValueGreaterThan in interface ExecutionQuery
        Overrides:
        variableValueGreaterThan in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
        Parameters:
        name - variable name, cannot be null.
        value - variable value, cannot be null.
      • variableValueGreaterThanOrEqual

        public ExecutionQuery variableValueGreaterThanOrEqual​(String name,
                                                              Object value)
        Description copied from interface: ExecutionQuery
        Only select executions which have a local variable value greater than or equal to the passed value. Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
        Specified by:
        variableValueGreaterThanOrEqual in interface ExecutionQuery
        Overrides:
        variableValueGreaterThanOrEqual in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
        Parameters:
        name - variable name, cannot be null.
        value - variable value, cannot be null.
      • variableValueLessThan

        public ExecutionQuery variableValueLessThan​(String name,
                                                    Object value)
        Description copied from interface: ExecutionQuery
        Only select executions which have a local variable value less than the passed value. Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
        Specified by:
        variableValueLessThan in interface ExecutionQuery
        Overrides:
        variableValueLessThan in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
        Parameters:
        name - variable name, cannot be null.
        value - variable value, cannot be null.
      • variableValueLessThanOrEqual

        public ExecutionQuery variableValueLessThanOrEqual​(String name,
                                                           Object value)
        Description copied from interface: ExecutionQuery
        Only select executions which have a local variable value less than or equal to the passed value. Booleans, Byte-arrays and Serializable objects (which are not primitive type wrappers) are not supported.
        Specified by:
        variableValueLessThanOrEqual in interface ExecutionQuery
        Overrides:
        variableValueLessThanOrEqual in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
        Parameters:
        name - variable name, cannot be null.
        value - variable value, cannot be null.
      • withLocalizationFallback

        public ExecutionQuery withLocalizationFallback()
        Description copied from interface: ExecutionQuery
        Instruct localization to fallback to more general locales including the default locale of the JVM if the specified locale is not found.
        Specified by:
        withLocalizationFallback in interface ExecutionQuery
      • startedBefore

        public ExecutionQuery startedBefore​(Date beforeTime)
        Description copied from interface: ExecutionQuery
        Only select executions that were started before the given start time.
        Specified by:
        startedBefore in interface ExecutionQuery
        Parameters:
        beforeTime - executions started before this time will be returned (cannot be null)
      • startedAfter

        public ExecutionQuery startedAfter​(Date afterTime)
        Description copied from interface: ExecutionQuery
        Only select executions that were started after the given start time.
        Specified by:
        startedAfter in interface ExecutionQuery
        Parameters:
        afterTime - executions started after this time will be returned (cannot be null)
      • startedBy

        public ExecutionQuery startedBy​(String userId)
        Description copied from interface: ExecutionQuery
        Only select executions that were started after by the given user id.
        Specified by:
        startedBy in interface ExecutionQuery
        Parameters:
        userId - the user id of the authenticated user that started the execution (cannot be null)
      • or

        public ExecutionQuery or()
        Description copied from interface: ExecutionQuery
        Begin an OR statement. Make sure you invoke the endOr method at the end of your OR statement. Only one OR statement is allowed, for the second call to this method an exception will be thrown.
        Specified by:
        or in interface ExecutionQuery
      • endOr

        public ExecutionQuery endOr()
        Description copied from interface: ExecutionQuery
        End an OR statement. Only one OR statement is allowed, for the second call to this method an exception will be thrown.
        Specified by:
        endOr in interface ExecutionQuery
      • executeCount

        public long executeCount​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
        Specified by:
        executeCount in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
      • executeList

        public List<Execution> executeList​(org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
        Specified by:
        executeList in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
      • localize

        protected void localize​(Execution execution,
                                String activityId)
      • ensureVariablesInitialized

        protected void ensureVariablesInitialized()
        Overrides:
        ensureVariablesInitialized in class org.flowable.variable.service.impl.AbstractVariableQueryImpl<ExecutionQuery,​Execution>
      • getOnlyProcessInstances

        public boolean getOnlyProcessInstances()
      • getProcessDefinitionKey

        public String getProcessDefinitionKey()
      • getProcessDefinitionId

        public String getProcessDefinitionId()
      • getProcessDefinitionCategory

        public String getProcessDefinitionCategory()
      • getProcessDefinitionName

        public String getProcessDefinitionName()
      • getProcessDefinitionVersion

        public Integer getProcessDefinitionVersion()
      • getProcessDefinitionEngineVersion

        public String getProcessDefinitionEngineVersion()
      • getActivityId

        public String getActivityId()
      • getProcessInstanceId

        public String getProcessInstanceId()
      • getRootProcessInstanceId

        public String getRootProcessInstanceId()
      • getProcessInstanceIds

        public String getProcessInstanceIds()
      • getBusinessKey

        public String getBusinessKey()
      • getBusinessKeyLike

        public String getBusinessKeyLike()
      • getExecutionId

        public String getExecutionId()
      • getId

        public String getId()
        Specified by:
        getId in interface org.flowable.common.engine.api.query.CacheAwareQuery<org.flowable.engine.impl.persistence.entity.ExecutionEntity>
      • getSuperProcessInstanceId

        public String getSuperProcessInstanceId()
      • getSubProcessInstanceId

        public String getSubProcessInstanceId()
      • isExcludeSubprocesses

        public boolean isExcludeSubprocesses()
      • getSuspensionState

        public org.flowable.common.engine.impl.db.SuspensionState getSuspensionState()
      • setSuspensionState

        public void setSuspensionState​(org.flowable.common.engine.impl.db.SuspensionState suspensionState)
      • getEventSubscriptions

        public List<org.flowable.eventsubscription.service.impl.EventSubscriptionQueryValue> getEventSubscriptions()
      • isIncludeChildExecutionsWithBusinessKeyQuery

        public boolean isIncludeChildExecutionsWithBusinessKeyQuery()
      • setEventSubscriptions

        public void setEventSubscriptions​(List<org.flowable.eventsubscription.service.impl.EventSubscriptionQueryValue> eventSubscriptions)
      • isActive

        public boolean isActive()
      • getInvolvedUser

        public String getInvolvedUser()
      • setInvolvedUser

        public void setInvolvedUser​(String involvedUser)
      • getInvolvedGroups

        public Set<String> getInvolvedGroups()
      • setInvolvedGroups

        public void setInvolvedGroups​(Set<String> involvedGroups)
      • getProcessDefinitionIds

        public Set<String> getProcessDefinitionIds()
      • getProcessDefinitionKeys

        public Set<String> getProcessDefinitionKeys()
      • getParentId

        public String getParentId()
      • isOnlyChildExecutions

        public boolean isOnlyChildExecutions()
      • isOnlySubProcessExecutions

        public boolean isOnlySubProcessExecutions()
      • isOnlyProcessInstanceExecutions

        public boolean isOnlyProcessInstanceExecutions()
      • getTenantId

        public String getTenantId()
      • getTenantIdLike

        public String getTenantIdLike()
      • isWithoutTenantId

        public boolean isWithoutTenantId()
      • getReferenceId

        public String getReferenceId()
      • getReferenceType

        public String getReferenceType()
      • getName

        public String getName()
      • getNameLike

        public String getNameLike()
      • setName

        public void setName​(String name)
      • setNameLike

        public void setNameLike​(String nameLike)
      • getNameLikeIgnoreCase

        public String getNameLikeIgnoreCase()
      • setNameLikeIgnoreCase

        public void setNameLikeIgnoreCase​(String nameLikeIgnoreCase)
      • getDeploymentId

        public String getDeploymentId()
      • setDeploymentId

        public void setDeploymentId​(String deploymentId)
      • getDeploymentIds

        public List<String> getDeploymentIds()
      • setDeploymentIds

        public void setDeploymentIds​(List<String> deploymentIds)
      • getActiveActivityId

        public String getActiveActivityId()
      • setActiveActivityId

        public void setActiveActivityId​(String activeActivityId)
      • getActiveActivityIds

        public Set<String> getActiveActivityIds()
      • setActiveActivityIds

        public void setActiveActivityIds​(Set<String> activeActivityIds)
      • getStartedBefore

        public Date getStartedBefore()
      • setStartedBefore

        public void setStartedBefore​(Date startedBefore)
      • getStartedAfter

        public Date getStartedAfter()
      • setStartedAfter

        public void setStartedAfter​(Date startedAfter)
      • getStartedBy

        public String getStartedBy()
      • setStartedBy

        public void setStartedBy​(String startedBy)
      • getLocale

        public String getLocale()
      • isWithLocalizationFallback

        public boolean isWithLocalizationFallback()
      • getCallbackId

        public String getCallbackId()
      • getCallbackType

        public String getCallbackType()
      • getSafeInvolvedGroups

        public List<List<String>> getSafeInvolvedGroups()
      • setSafeInvolvedGroups

        public void setSafeInvolvedGroups​(List<List<String>> safeInvolvedGroups)