org.camunda.bpm.engine.impl
Class ProcessDefinitionQueryImpl

java.lang.Object
  extended by org.camunda.bpm.engine.impl.db.ListQueryParameterObject
      extended by org.camunda.bpm.engine.impl.AbstractQuery<ProcessDefinitionQuery,ProcessDefinition>
          extended by org.camunda.bpm.engine.impl.ProcessDefinitionQueryImpl
All Implemented Interfaces:
Serializable, Command<Object>, Query<ProcessDefinitionQuery,ProcessDefinition>, ProcessDefinitionQuery

public class ProcessDefinitionQueryImpl
extends AbstractQuery<ProcessDefinitionQuery,ProcessDefinition>
implements ProcessDefinitionQuery

Author:
Tom Baeyens, Joram Barrez, Daniel Meyer, Saeid Mirzaei
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.camunda.bpm.engine.impl.AbstractQuery
AbstractQuery.ResultType
 
Field Summary
protected  String authorizationUserId
           
protected  String category
           
protected  String categoryLike
           
protected  String deploymentId
           
protected  String eventSubscriptionName
           
protected  String eventSubscriptionType
           
protected  String id
           
protected  String[] ids
           
protected  String incidentId
           
protected  String incidentMessage
           
protected  String incidentMessageLike
           
protected  String incidentType
           
protected  boolean includeDefinitionsWithoutTenantId
           
protected  boolean isTenantIdSet
           
protected  String key
           
protected  String keyLike
           
protected  boolean latest
           
protected  String name
           
protected  String nameLike
           
protected  String procDefId
           
protected  String resourceName
           
protected  String resourceNameLike
           
protected  SuspensionState suspensionState
           
protected  String[] tenantIds
           
protected  Integer version
           
protected  String versionTag
           
protected  String versionTagLike
           
 
Fields inherited from class org.camunda.bpm.engine.impl.AbstractQuery
commandExecutor, expressions, orderingProperties, resultType, SORTORDER_ASC, SORTORDER_DESC, validators
 
Fields inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
authCheck, databaseType, DEFAULT_ORDER_BY, firstResult, maxResults, orderBy, parameter, tenantCheck
 
Constructor Summary
ProcessDefinitionQueryImpl()
           
ProcessDefinitionQueryImpl(CommandExecutor commandExecutor)
           
 
Method Summary
 ProcessDefinitionQuery active()
          Only selects process definitions which are active
 void checkQueryOk()
           
 ProcessDefinitionQueryImpl deploymentId(String deploymentId)
          Only select process definitions that are deployed in a deployment with the given deployment id
 ProcessDefinitionQuery eventSubscription(String eventType, String eventName)
           
 long executeCount(CommandContext commandContext)
           
 List<ProcessDefinition> executeList(CommandContext commandContext, Page page)
          Executes the actual query to retrieve the list of results.
 String getCategory()
           
 String getCategoryLike()
           
 String getDeploymentId()
           
 String getId()
           
 String[] getIds()
           
 String getIncidentId()
           
 String getIncidentMessage()
           
 String getIncidentMessageLike()
           
 String getIncidentType()
           
 String getKey()
           
 String getKeyLike()
           
 String getName()
           
 String getNameLike()
           
 String getResourceName()
           
 String getResourceNameLike()
           
 SuspensionState getSuspensionState()
           
 Integer getVersion()
           
 String getVersionTag()
           
protected  boolean hasExcludingConditions()
          Whether or not the query has excluding conditions.
 ProcessDefinitionQuery incidentId(String incidentId)
          Only selects process definitions with the given incident id.
 ProcessDefinitionQuery incidentMessage(String incidentMessage)
          Only selects process definitions with the given incident message.
 ProcessDefinitionQuery incidentMessageLike(String incidentMessageLike)
          Only selects process definitions with an incident message like the given.
 ProcessDefinitionQuery incidentType(String incidentType)
          Only selects process definitions with the given incident type.
 ProcessDefinitionQuery includeProcessDefinitionsWithoutTenantId()
          Select process definitions which have no tenant id.
 boolean isLatest()
           
 ProcessDefinitionQueryImpl latestVersion()
           Only select the process definitions which are the latest deployed (ie.
 ProcessDefinitionQuery messageEventSubscription(String messageName)
           
 ProcessDefinitionQuery messageEventSubscriptionName(String messageName)
          Selects the single process definition which has a start message event with the messageName.
 ProcessDefinitionQuery orderByDeploymentId()
          Order by deployment id (needs to be followed by Query.asc() or Query.desc()).
 ProcessDefinitionQuery orderByProcessDefinitionCategory()
          Order by the category of the process definitions (needs to be followed by Query.asc() or Query.desc()).
 ProcessDefinitionQuery orderByProcessDefinitionId()
          Order by the id of the process definitions (needs to be followed by Query.asc() or Query.desc()).
 ProcessDefinitionQuery orderByProcessDefinitionKey()
          Order by process definition key (needs to be followed by Query.asc() or Query.desc()).
 ProcessDefinitionQuery orderByProcessDefinitionName()
          Order by the name of the process definitions (needs to be followed by Query.asc() or Query.desc()).
 ProcessDefinitionQuery orderByProcessDefinitionVersion()
          Order by the version of the process definitions (needs to be followed by Query.asc() or Query.desc()).
 ProcessDefinitionQuery orderByTenantId()
          Order by tenant id (needs to be followed by Query.asc() or Query.desc()).
 ProcessDefinitionQuery orderByVersionTag()
          Order by version tag (needs to be followed by Query.asc() or Query.desc()).
 ProcessDefinitionQueryImpl processDefinitionCategory(String category)
          Only select process definitions with the given category.
 ProcessDefinitionQueryImpl processDefinitionCategoryLike(String categoryLike)
          Only select process definitions where the category matches the given parameter.
 ProcessDefinitionQueryImpl processDefinitionId(String processDefinitionId)
          Only select process definiton with the given id.
 ProcessDefinitionQueryImpl processDefinitionIdIn(String... ids)
          Only select process definiton with the given id.
 ProcessDefinitionQueryImpl processDefinitionKey(String key)
          Only select process definition with the given key.
 ProcessDefinitionQueryImpl processDefinitionKeyLike(String keyLike)
          Only select process definitions where the key matches the given parameter.
 ProcessDefinitionQueryImpl processDefinitionName(String name)
          Only select process definitions with the given name.
 ProcessDefinitionQueryImpl processDefinitionNameLike(String nameLike)
          Only select process definitions where the name matches the given parameter.
 ProcessDefinitionQueryImpl processDefinitionResourceName(String resourceName)
          Only select process definition with the given resource name.
 ProcessDefinitionQueryImpl processDefinitionResourceNameLike(String resourceNameLike)
          Only select process definition with a resource name like the given .
 ProcessDefinitionQuery processDefinitionStarter(String procDefId)
           
 ProcessDefinitionQueryImpl processDefinitionVersion(Integer version)
          Only select process definition with a certain version.
 void setSuspensionState(SuspensionState suspensionState)
           
 ProcessDefinitionQueryImpl startableByUser(String userId)
          Only selects process definitions which given userId is authorized to start
 ProcessDefinitionQuery suspended()
          Only selects process definitions which are suspended
 ProcessDefinitionQueryImpl tenantIdIn(String... tenantIds)
          Only select process definitions with one of the given tenant ids.
 ProcessDefinitionQuery versionTag(String versionTag)
          Only selects process definitions with a specific version tag
 ProcessDefinitionQuery versionTagLike(String versionTagLike)
          Only selects process definitions with a version tag like the given
 ProcessDefinitionQuery withoutTenantId()
          Only select process definitions which have no tenant id.
 
Methods inherited from class org.camunda.bpm.engine.impl.AbstractQuery
addExpression, addValidator, asc, count, desc, direction, evaluateExpressions, evaluateExpressionsAndExecuteCount, evaluateExpressionsAndExecuteList, execute, executeSingleResult, extend, getExpressions, getMethod, getOrderBy, getOrderingProperties, list, listPage, mergeExpressions, mergeOrdering, orderBy, orderBy, removeValidator, setCommandExecutor, setExpressions, setOrderingProperties, singleResult, validate, validate
 
Methods inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
getAuthCheck, getDatabaseType, getFirstResult, getFirstRow, getLastRow, getMaxResults, getParameter, getTenantCheck, setAuthCheck, setDatabaseType, setFirstResult, setMaxResults, setOrderBy, setParameter, setTenantCheck
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.camunda.bpm.engine.query.Query
asc, count, desc, list, listPage, singleResult
 

Field Detail

id

protected String id

ids

protected String[] ids

category

protected String category

categoryLike

protected String categoryLike

name

protected String name

nameLike

protected String nameLike

deploymentId

protected String deploymentId

key

protected String key

keyLike

protected String keyLike

resourceName

protected String resourceName

resourceNameLike

protected String resourceNameLike

version

protected Integer version

latest

protected boolean latest

suspensionState

protected SuspensionState suspensionState

authorizationUserId

protected String authorizationUserId

procDefId

protected String procDefId

incidentType

protected String incidentType

incidentId

protected String incidentId

incidentMessage

protected String incidentMessage

incidentMessageLike

protected String incidentMessageLike

eventSubscriptionName

protected String eventSubscriptionName

eventSubscriptionType

protected String eventSubscriptionType

isTenantIdSet

protected boolean isTenantIdSet

tenantIds

protected String[] tenantIds

includeDefinitionsWithoutTenantId

protected boolean includeDefinitionsWithoutTenantId

versionTag

protected String versionTag

versionTagLike

protected String versionTagLike
Constructor Detail

ProcessDefinitionQueryImpl

public ProcessDefinitionQueryImpl()

ProcessDefinitionQueryImpl

public ProcessDefinitionQueryImpl(CommandExecutor commandExecutor)
Method Detail

processDefinitionId

public ProcessDefinitionQueryImpl processDefinitionId(String processDefinitionId)
Description copied from interface: ProcessDefinitionQuery
Only select process definiton with the given id.

Specified by:
processDefinitionId in interface ProcessDefinitionQuery

processDefinitionIdIn

public ProcessDefinitionQueryImpl processDefinitionIdIn(String... ids)
Description copied from interface: ProcessDefinitionQuery
Only select process definiton with the given id.

Specified by:
processDefinitionIdIn in interface ProcessDefinitionQuery

processDefinitionCategory

public ProcessDefinitionQueryImpl processDefinitionCategory(String category)
Description copied from interface: ProcessDefinitionQuery
Only select process definitions with the given category.

Specified by:
processDefinitionCategory in interface ProcessDefinitionQuery

processDefinitionCategoryLike

public ProcessDefinitionQueryImpl processDefinitionCategoryLike(String categoryLike)
Description copied from interface: ProcessDefinitionQuery
Only select process definitions where the category matches the given parameter. The syntax that should be used is the same as in SQL, eg. %activiti%

Specified by:
processDefinitionCategoryLike in interface ProcessDefinitionQuery

processDefinitionName

public ProcessDefinitionQueryImpl processDefinitionName(String name)
Description copied from interface: ProcessDefinitionQuery
Only select process definitions with the given name.

Specified by:
processDefinitionName in interface ProcessDefinitionQuery

processDefinitionNameLike

public ProcessDefinitionQueryImpl processDefinitionNameLike(String nameLike)
Description copied from interface: ProcessDefinitionQuery
Only select process definitions where the name matches the given parameter. The syntax that should be used is the same as in SQL, eg. %activiti%

Specified by:
processDefinitionNameLike in interface ProcessDefinitionQuery

deploymentId

public ProcessDefinitionQueryImpl deploymentId(String deploymentId)
Description copied from interface: ProcessDefinitionQuery
Only select process definitions that are deployed in a deployment with the given deployment id

Specified by:
deploymentId in interface ProcessDefinitionQuery

processDefinitionKey

public ProcessDefinitionQueryImpl processDefinitionKey(String key)
Description copied from interface: ProcessDefinitionQuery
Only select process definition with the given key.

Specified by:
processDefinitionKey in interface ProcessDefinitionQuery

processDefinitionKeyLike

public ProcessDefinitionQueryImpl processDefinitionKeyLike(String keyLike)
Description copied from interface: ProcessDefinitionQuery
Only select process definitions where the key matches the given parameter. The syntax that should be used is the same as in SQL, eg. %activiti%

Specified by:
processDefinitionKeyLike in interface ProcessDefinitionQuery

processDefinitionResourceName

public ProcessDefinitionQueryImpl processDefinitionResourceName(String resourceName)
Description copied from interface: ProcessDefinitionQuery
Only select process definition with the given resource name.

Specified by:
processDefinitionResourceName in interface ProcessDefinitionQuery

processDefinitionResourceNameLike

public ProcessDefinitionQueryImpl processDefinitionResourceNameLike(String resourceNameLike)
Description copied from interface: ProcessDefinitionQuery
Only select process definition with a resource name like the given .

Specified by:
processDefinitionResourceNameLike in interface ProcessDefinitionQuery

processDefinitionVersion

public ProcessDefinitionQueryImpl processDefinitionVersion(Integer version)
Description copied from interface: ProcessDefinitionQuery
Only select process definition with a certain version. Particulary useful when used in combination with ProcessDefinitionQuery.processDefinitionKey(String)

Specified by:
processDefinitionVersion in interface ProcessDefinitionQuery

latestVersion

public ProcessDefinitionQueryImpl latestVersion()
Description copied from interface: ProcessDefinitionQuery

Only select the process definitions which are the latest deployed (ie. which have the highest version number for the given key).

Can only be used in combination with ProcessDefinitionQuery.processDefinitionKey(String) of ProcessDefinitionQuery.processDefinitionKeyLike(String). Can also be used without any other criteria (ie. query.latest().list()), which will then give all the latest versions of all the deployed process definitions.

For multi-tenancy: select the latest deployed process definitions for each tenant. If a process definition is deployed for multiple tenants then all process definitions are selected.

Specified by:
latestVersion in interface ProcessDefinitionQuery

active

public ProcessDefinitionQuery active()
Description copied from interface: ProcessDefinitionQuery
Only selects process definitions which are active

Specified by:
active in interface ProcessDefinitionQuery

suspended

public ProcessDefinitionQuery suspended()
Description copied from interface: ProcessDefinitionQuery
Only selects process definitions which are suspended

Specified by:
suspended in interface ProcessDefinitionQuery

messageEventSubscription

public ProcessDefinitionQuery messageEventSubscription(String messageName)
Specified by:
messageEventSubscription in interface ProcessDefinitionQuery
See Also:
ProcessDefinitionQuery.messageEventSubscriptionName(String)

messageEventSubscriptionName

public ProcessDefinitionQuery messageEventSubscriptionName(String messageName)
Description copied from interface: ProcessDefinitionQuery
Selects the single process definition which has a start message event with the messageName.

Specified by:
messageEventSubscriptionName in interface ProcessDefinitionQuery

processDefinitionStarter

public ProcessDefinitionQuery processDefinitionStarter(String procDefId)

eventSubscription

public ProcessDefinitionQuery eventSubscription(String eventType,
                                                String eventName)

incidentType

public ProcessDefinitionQuery incidentType(String incidentType)
Description copied from interface: ProcessDefinitionQuery
Only selects process definitions with the given incident type.

Specified by:
incidentType in interface ProcessDefinitionQuery

incidentId

public ProcessDefinitionQuery incidentId(String incidentId)
Description copied from interface: ProcessDefinitionQuery
Only selects process definitions with the given incident id.

Specified by:
incidentId in interface ProcessDefinitionQuery

incidentMessage

public ProcessDefinitionQuery incidentMessage(String incidentMessage)
Description copied from interface: ProcessDefinitionQuery
Only selects process definitions with the given incident message.

Specified by:
incidentMessage in interface ProcessDefinitionQuery

incidentMessageLike

public ProcessDefinitionQuery incidentMessageLike(String incidentMessageLike)
Description copied from interface: ProcessDefinitionQuery
Only selects process definitions with an incident message like the given.

Specified by:
incidentMessageLike in interface ProcessDefinitionQuery

hasExcludingConditions

protected boolean hasExcludingConditions()
Description copied from class: AbstractQuery
Whether or not the query has excluding conditions. If the query has excluding conditions, (e.g. task due date before and after are excluding), the SQL query is avoided and a default result is returned. The returned result is the same as if the SQL was executed and there were no entries.

Overrides:
hasExcludingConditions in class AbstractQuery<ProcessDefinitionQuery,ProcessDefinition>
Returns:
true if the query does have excluding conditions, false otherwise

tenantIdIn

public ProcessDefinitionQueryImpl tenantIdIn(String... tenantIds)
Description copied from interface: ProcessDefinitionQuery
Only select process definitions with one of the given tenant ids.

Specified by:
tenantIdIn in interface ProcessDefinitionQuery

withoutTenantId

public ProcessDefinitionQuery withoutTenantId()
Description copied from interface: ProcessDefinitionQuery
Only select process definitions which have no tenant id.

Specified by:
withoutTenantId in interface ProcessDefinitionQuery

includeProcessDefinitionsWithoutTenantId

public ProcessDefinitionQuery includeProcessDefinitionsWithoutTenantId()
Description copied from interface: ProcessDefinitionQuery
Select process definitions which have no tenant id. Can be used in combination with ProcessDefinitionQuery.tenantIdIn(String...).

Specified by:
includeProcessDefinitionsWithoutTenantId in interface ProcessDefinitionQuery

versionTag

public ProcessDefinitionQuery versionTag(String versionTag)
Description copied from interface: ProcessDefinitionQuery
Only selects process definitions with a specific version tag

Specified by:
versionTag in interface ProcessDefinitionQuery

versionTagLike

public ProcessDefinitionQuery versionTagLike(String versionTagLike)
Description copied from interface: ProcessDefinitionQuery
Only selects process definitions with a version tag like the given

Specified by:
versionTagLike in interface ProcessDefinitionQuery

orderByDeploymentId

public ProcessDefinitionQuery orderByDeploymentId()
Description copied from interface: ProcessDefinitionQuery
Order by deployment id (needs to be followed by Query.asc() or Query.desc()).

Specified by:
orderByDeploymentId in interface ProcessDefinitionQuery

orderByProcessDefinitionKey

public ProcessDefinitionQuery orderByProcessDefinitionKey()
Description copied from interface: ProcessDefinitionQuery
Order by process definition key (needs to be followed by Query.asc() or Query.desc()).

Specified by:
orderByProcessDefinitionKey in interface ProcessDefinitionQuery

orderByProcessDefinitionCategory

public ProcessDefinitionQuery orderByProcessDefinitionCategory()
Description copied from interface: ProcessDefinitionQuery
Order by the category of the process definitions (needs to be followed by Query.asc() or Query.desc()).

Specified by:
orderByProcessDefinitionCategory in interface ProcessDefinitionQuery

orderByProcessDefinitionId

public ProcessDefinitionQuery orderByProcessDefinitionId()
Description copied from interface: ProcessDefinitionQuery
Order by the id of the process definitions (needs to be followed by Query.asc() or Query.desc()).

Specified by:
orderByProcessDefinitionId in interface ProcessDefinitionQuery

orderByProcessDefinitionVersion

public ProcessDefinitionQuery orderByProcessDefinitionVersion()
Description copied from interface: ProcessDefinitionQuery
Order by the version of the process definitions (needs to be followed by Query.asc() or Query.desc()).

Specified by:
orderByProcessDefinitionVersion in interface ProcessDefinitionQuery

orderByProcessDefinitionName

public ProcessDefinitionQuery orderByProcessDefinitionName()
Description copied from interface: ProcessDefinitionQuery
Order by the name of the process definitions (needs to be followed by Query.asc() or Query.desc()).

Specified by:
orderByProcessDefinitionName in interface ProcessDefinitionQuery

orderByTenantId

public ProcessDefinitionQuery orderByTenantId()
Description copied from interface: ProcessDefinitionQuery
Order by tenant id (needs to be followed by Query.asc() or Query.desc()). Note that the ordering of process instances without tenant id is database-specific.

Specified by:
orderByTenantId in interface ProcessDefinitionQuery

orderByVersionTag

public ProcessDefinitionQuery orderByVersionTag()
Description copied from interface: ProcessDefinitionQuery
Order by version tag (needs to be followed by Query.asc() or Query.desc()). Note: sorting by versionTag is a string based sort. There is no interpretation of the version which can lead to a sorting like: v0.1.0 v0.10.0 v0.2.0.

Specified by:
orderByVersionTag in interface ProcessDefinitionQuery

executeCount

public long executeCount(CommandContext commandContext)
Specified by:
executeCount in class AbstractQuery<ProcessDefinitionQuery,ProcessDefinition>

executeList

public List<ProcessDefinition> executeList(CommandContext commandContext,
                                           Page page)
Description copied from class: AbstractQuery
Executes the actual query to retrieve the list of results.

Specified by:
executeList in class AbstractQuery<ProcessDefinitionQuery,ProcessDefinition>
page - used if the results must be paged. If null, no paging will be applied.

checkQueryOk

public void checkQueryOk()
Overrides:
checkQueryOk in class AbstractQuery<ProcessDefinitionQuery,ProcessDefinition>

getDeploymentId

public String getDeploymentId()

getId

public String getId()

getIds

public String[] getIds()

getName

public String getName()

getNameLike

public String getNameLike()

getKey

public String getKey()

getKeyLike

public String getKeyLike()

getVersion

public Integer getVersion()

isLatest

public boolean isLatest()

getCategory

public String getCategory()

getCategoryLike

public String getCategoryLike()

getResourceName

public String getResourceName()

getResourceNameLike

public String getResourceNameLike()

getSuspensionState

public SuspensionState getSuspensionState()

setSuspensionState

public void setSuspensionState(SuspensionState suspensionState)

getIncidentId

public String getIncidentId()

getIncidentType

public String getIncidentType()

getIncidentMessage

public String getIncidentMessage()

getIncidentMessageLike

public String getIncidentMessageLike()

getVersionTag

public String getVersionTag()

startableByUser

public ProcessDefinitionQueryImpl startableByUser(String userId)
Description copied from interface: ProcessDefinitionQuery
Only selects process definitions which given userId is authorized to start

Specified by:
startableByUser in interface ProcessDefinitionQuery


Copyright © 2016 camunda services GmbH. All rights reserved.