Package org.camunda.bpm.engine.impl
Class ExternalTaskQueryImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.db.ListQueryParameterObject
-
- org.camunda.bpm.engine.impl.AbstractQuery<ExternalTaskQuery,ExternalTask>
-
- org.camunda.bpm.engine.impl.ExternalTaskQueryImpl
-
- All Implemented Interfaces:
java.io.Serializable
,ExternalTaskQuery
,Command<java.lang.Object>
,Query<ExternalTaskQuery,ExternalTask>
public class ExternalTaskQueryImpl extends AbstractQuery<ExternalTaskQuery,ExternalTask> implements ExternalTaskQuery
- Author:
- Thorben Lindhauer, Christopher Zell
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.camunda.bpm.engine.impl.AbstractQuery
AbstractQuery.ResultType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
activityId
protected java.lang.String[]
activityIdIn
protected java.lang.String
executionId
protected java.lang.String
externalTaskId
protected java.util.Set<java.lang.String>
externalTaskIds
protected java.lang.Boolean
locked
protected java.util.Date
lockExpirationAfter
protected java.util.Date
lockExpirationBefore
protected java.lang.Boolean
notLocked
protected java.lang.Long
priorityHigherThanOrEquals
protected java.lang.Long
priorityLowerThanOrEquals
protected java.lang.String
processDefinitionId
protected java.lang.String
processInstanceId
protected java.lang.String[]
processInstanceIdIn
protected java.lang.Boolean
retriesLeft
protected SuspensionState
suspensionState
protected java.lang.String[]
tenantIds
protected java.lang.String
topicName
protected java.lang.String
workerId
-
Fields inherited from class org.camunda.bpm.engine.impl.AbstractQuery
commandExecutor, expressions, maxResultsLimitEnabled, resultType, SORTORDER_ASC, SORTORDER_DESC, validators
-
Fields inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
authCheck, databaseType, firstResult, maxResults, orderingProperties, parameter, tenantCheck
-
-
Constructor Summary
Constructors Constructor Description ExternalTaskQueryImpl()
ExternalTaskQueryImpl(CommandExecutor commandExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExternalTaskQuery
active()
Only select external tasks that are currently not suspendedExternalTaskQuery
activityId(java.lang.String activityId)
Only select external tasks that belong to an instance of the given activityExternalTaskQuery
activityIdIn(java.lang.String... activityIdIn)
Only select external tasks that belong to an instances of the given activities.long
executeCount(CommandContext commandContext)
java.util.List<ImmutablePair<java.lang.String,java.lang.String>>
executeDeploymentIdMappingsList(CommandContext commandContext)
java.util.List<java.lang.String>
executeIdsList(CommandContext commandContext)
java.util.List<ExternalTask>
executeList(CommandContext commandContext, Page page)
Executes the actual query to retrieve the list of results.ExternalTaskQuery
executionId(java.lang.String executionId)
Only select external tasks created in the context of the given executionExternalTaskQuery
externalTaskId(java.lang.String externalTaskId)
Only select the external task with the given idExternalTaskQuery
externalTaskIdIn(java.util.Set<java.lang.String> externalTaskIds)
Only select external tasks with any of the given idsjava.lang.String
getActivityId()
java.lang.String
getExecutionId()
java.lang.String
getExternalTaskId()
java.lang.Boolean
getLocked()
java.util.Date
getLockExpirationAfter()
java.util.Date
getLockExpirationBefore()
java.lang.Boolean
getNotLocked()
java.util.Date
getNow()
java.lang.String
getProcessDefinitionId()
java.lang.String
getProcessInstanceId()
java.lang.Boolean
getRetriesLeft()
SuspensionState
getSuspensionState()
java.lang.String
getTopicName()
java.lang.String
getWorkerId()
protected boolean
hasExcludingConditions()
Whether or not the query has excluding conditions.ExternalTaskQuery
locked()
Only select external tasks that are currently locked, i.e.ExternalTaskQuery
lockExpirationAfter(java.util.Date lockExpirationDate)
Only select external tasks that have a lock expiring after the given dateExternalTaskQuery
lockExpirationBefore(java.util.Date lockExpirationDate)
Only select external tasks that have a lock expiring before the given dateExternalTaskQuery
noRetriesLeft()
Only select external tasks that have retries = 0ExternalTaskQuery
notLocked()
Only select external tasks that are not currently locked, i.e.ExternalTaskQuery
orderById()
Order by external task id (needs to be followed byQuery.asc()
orQuery.desc()
).ExternalTaskQuery
orderByLockExpirationTime()
Order by lock expiration time (needs to be followed byQuery.asc()
orQuery.desc()
).ExternalTaskQuery
orderByPriority()
Order by priority (needs to be followed byQuery.asc()
orQuery.desc()
).ExternalTaskQuery
orderByProcessDefinitionId()
Order by process definition id (needs to be followed byQuery.asc()
orQuery.desc()
).ExternalTaskQuery
orderByProcessDefinitionKey()
Order by process definition key (needs to be followed byQuery.asc()
orQuery.desc()
).ExternalTaskQuery
orderByProcessInstanceId()
Order by process instance id (needs to be followed byQuery.asc()
orQuery.desc()
).ExternalTaskQuery
orderByTenantId()
Order by tenant id (needs to be followed byQuery.asc()
orQuery.desc()
).ExternalTaskQuery
priorityHigherThanOrEquals(long priority)
Only select external tasks with a priority that is higher than or equal to the given priority.ExternalTaskQuery
priorityLowerThanOrEquals(long priority)
Only select external tasks with a priority that is lower than or equal to the given priority.ExternalTaskQuery
processDefinitionId(java.lang.String processDefinitionId)
Only select external tasks that belong to an instance of the given process definitionExternalTaskQuery
processInstanceId(java.lang.String processInstanceId)
Only select external tasks created in the context of the given process instanceExternalTaskQuery
processInstanceIdIn(java.lang.String... processInstanceIdIn)
Only select external tasks created in the context of the given process instancesExternalTaskQuery
suspended()
Only select external tasks that are currently suspendedExternalTaskQuery
tenantIdIn(java.lang.String... tenantIds)
Only select external tasks that belong to one of the given tenant ids.ExternalTaskQuery
topicName(java.lang.String topicName)
Only select external tasks of the given topicExternalTaskQuery
withRetriesLeft()
Only select external tasks that have retries > 0ExternalTaskQuery
workerId(java.lang.String workerId)
Only select external tasks that was most recently locked by the given worker-
Methods inherited from class org.camunda.bpm.engine.impl.AbstractQuery
addExpression, addValidator, asc, checkMaxResultsLimit, checkQueryOk, count, desc, direction, disableMaxResultsLimit, enableMaxResultsLimit, evaluateExpressions, evaluateExpressionsAndExecuteCount, evaluateExpressionsAndExecuteDeploymentIdMappingsList, evaluateExpressionsAndExecuteIdsList, evaluateExpressionsAndExecuteList, execute, executeResult, executeSingleResult, extend, getExpressions, getMethod, list, listDeploymentIdMappings, listIds, listPage, mergeExpressions, mergeOrdering, orderBy, orderBy, removeValidator, setCommandExecutor, setExpressions, singleResult, unlimitedList, validate, validate
-
Methods inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
getAuthCheck, getDatabaseType, getFirstResult, getFirstRow, getLastRow, getMaxResults, getOrderingProperties, getParameter, getTenantCheck, setAuthCheck, setDatabaseType, setFirstResult, setMaxResults, setOrderingProperties, 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.impl.interceptor.Command
isRetryable
-
Methods inherited from interface org.camunda.bpm.engine.query.Query
asc, count, desc, list, listPage, singleResult, unlimitedList
-
-
-
-
Field Detail
-
externalTaskId
protected java.lang.String externalTaskId
-
externalTaskIds
protected java.util.Set<java.lang.String> externalTaskIds
-
workerId
protected java.lang.String workerId
-
lockExpirationBefore
protected java.util.Date lockExpirationBefore
-
lockExpirationAfter
protected java.util.Date lockExpirationAfter
-
topicName
protected java.lang.String topicName
-
locked
protected java.lang.Boolean locked
-
notLocked
protected java.lang.Boolean notLocked
-
executionId
protected java.lang.String executionId
-
processInstanceId
protected java.lang.String processInstanceId
-
processInstanceIdIn
protected java.lang.String[] processInstanceIdIn
-
processDefinitionId
protected java.lang.String processDefinitionId
-
activityId
protected java.lang.String activityId
-
activityIdIn
protected java.lang.String[] activityIdIn
-
suspensionState
protected SuspensionState suspensionState
-
priorityHigherThanOrEquals
protected java.lang.Long priorityHigherThanOrEquals
-
priorityLowerThanOrEquals
protected java.lang.Long priorityLowerThanOrEquals
-
retriesLeft
protected java.lang.Boolean retriesLeft
-
tenantIds
protected java.lang.String[] tenantIds
-
-
Constructor Detail
-
ExternalTaskQueryImpl
public ExternalTaskQueryImpl()
-
ExternalTaskQueryImpl
public ExternalTaskQueryImpl(CommandExecutor commandExecutor)
-
-
Method Detail
-
externalTaskId
public ExternalTaskQuery externalTaskId(java.lang.String externalTaskId)
Description copied from interface:ExternalTaskQuery
Only select the external task with the given id- Specified by:
externalTaskId
in interfaceExternalTaskQuery
-
externalTaskIdIn
public ExternalTaskQuery externalTaskIdIn(java.util.Set<java.lang.String> externalTaskIds)
Description copied from interface:ExternalTaskQuery
Only select external tasks with any of the given ids- Specified by:
externalTaskIdIn
in interfaceExternalTaskQuery
-
workerId
public ExternalTaskQuery workerId(java.lang.String workerId)
Description copied from interface:ExternalTaskQuery
Only select external tasks that was most recently locked by the given worker- Specified by:
workerId
in interfaceExternalTaskQuery
-
lockExpirationBefore
public ExternalTaskQuery lockExpirationBefore(java.util.Date lockExpirationDate)
Description copied from interface:ExternalTaskQuery
Only select external tasks that have a lock expiring before the given date- Specified by:
lockExpirationBefore
in interfaceExternalTaskQuery
-
lockExpirationAfter
public ExternalTaskQuery lockExpirationAfter(java.util.Date lockExpirationDate)
Description copied from interface:ExternalTaskQuery
Only select external tasks that have a lock expiring after the given date- Specified by:
lockExpirationAfter
in interfaceExternalTaskQuery
-
topicName
public ExternalTaskQuery topicName(java.lang.String topicName)
Description copied from interface:ExternalTaskQuery
Only select external tasks of the given topic- Specified by:
topicName
in interfaceExternalTaskQuery
-
locked
public ExternalTaskQuery locked()
Description copied from interface:ExternalTaskQuery
Only select external tasks that are currently locked, i.e. that have a lock expiration time that is in the future- Specified by:
locked
in interfaceExternalTaskQuery
-
notLocked
public ExternalTaskQuery notLocked()
Description copied from interface:ExternalTaskQuery
Only select external tasks that are not currently locked, i.e. that have no lock expiration time or one that is overdue- Specified by:
notLocked
in interfaceExternalTaskQuery
-
executionId
public ExternalTaskQuery executionId(java.lang.String executionId)
Description copied from interface:ExternalTaskQuery
Only select external tasks created in the context of the given execution- Specified by:
executionId
in interfaceExternalTaskQuery
-
processInstanceId
public ExternalTaskQuery processInstanceId(java.lang.String processInstanceId)
Description copied from interface:ExternalTaskQuery
Only select external tasks created in the context of the given process instance- Specified by:
processInstanceId
in interfaceExternalTaskQuery
-
processInstanceIdIn
public ExternalTaskQuery processInstanceIdIn(java.lang.String... processInstanceIdIn)
Description copied from interface:ExternalTaskQuery
Only select external tasks created in the context of the given process instances- Specified by:
processInstanceIdIn
in interfaceExternalTaskQuery
-
processDefinitionId
public ExternalTaskQuery processDefinitionId(java.lang.String processDefinitionId)
Description copied from interface:ExternalTaskQuery
Only select external tasks that belong to an instance of the given process definition- Specified by:
processDefinitionId
in interfaceExternalTaskQuery
-
activityId
public ExternalTaskQuery activityId(java.lang.String activityId)
Description copied from interface:ExternalTaskQuery
Only select external tasks that belong to an instance of the given activity- Specified by:
activityId
in interfaceExternalTaskQuery
-
activityIdIn
public ExternalTaskQuery activityIdIn(java.lang.String... activityIdIn)
Description copied from interface:ExternalTaskQuery
Only select external tasks that belong to an instances of the given activities.- Specified by:
activityIdIn
in interfaceExternalTaskQuery
-
priorityHigherThanOrEquals
public ExternalTaskQuery priorityHigherThanOrEquals(long priority)
Description copied from interface:ExternalTaskQuery
Only select external tasks with a priority that is higher than or equal to the given priority.- Specified by:
priorityHigherThanOrEquals
in interfaceExternalTaskQuery
- Parameters:
priority
- the priority which is used for the query- Returns:
- the builded external task query
-
priorityLowerThanOrEquals
public ExternalTaskQuery priorityLowerThanOrEquals(long priority)
Description copied from interface:ExternalTaskQuery
Only select external tasks with a priority that is lower than or equal to the given priority.- Specified by:
priorityLowerThanOrEquals
in interfaceExternalTaskQuery
- Parameters:
priority
- the priority which is used for the query- Returns:
- the builded external task query
-
suspended
public ExternalTaskQuery suspended()
Description copied from interface:ExternalTaskQuery
Only select external tasks that are currently suspended- Specified by:
suspended
in interfaceExternalTaskQuery
-
active
public ExternalTaskQuery active()
Description copied from interface:ExternalTaskQuery
Only select external tasks that are currently not suspended- Specified by:
active
in interfaceExternalTaskQuery
-
withRetriesLeft
public ExternalTaskQuery withRetriesLeft()
Description copied from interface:ExternalTaskQuery
Only select external tasks that have retries > 0- Specified by:
withRetriesLeft
in interfaceExternalTaskQuery
-
noRetriesLeft
public ExternalTaskQuery noRetriesLeft()
Description copied from interface:ExternalTaskQuery
Only select external tasks that have retries = 0- Specified by:
noRetriesLeft
in interfaceExternalTaskQuery
-
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 classAbstractQuery<ExternalTaskQuery,ExternalTask>
- Returns:
true
if the query does have excluding conditions,false
otherwise
-
tenantIdIn
public ExternalTaskQuery tenantIdIn(java.lang.String... tenantIds)
Description copied from interface:ExternalTaskQuery
Only select external tasks that belong to one of the given tenant ids.- Specified by:
tenantIdIn
in interfaceExternalTaskQuery
-
orderById
public ExternalTaskQuery orderById()
Description copied from interface:ExternalTaskQuery
Order by external task id (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderById
in interfaceExternalTaskQuery
-
orderByLockExpirationTime
public ExternalTaskQuery orderByLockExpirationTime()
Description copied from interface:ExternalTaskQuery
Order by lock expiration time (needs to be followed byQuery.asc()
orQuery.desc()
). Ordering of tasks with no lock expiration time is database-dependent.- Specified by:
orderByLockExpirationTime
in interfaceExternalTaskQuery
-
orderByProcessInstanceId
public ExternalTaskQuery orderByProcessInstanceId()
Description copied from interface:ExternalTaskQuery
Order by process instance id (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByProcessInstanceId
in interfaceExternalTaskQuery
-
orderByProcessDefinitionId
public ExternalTaskQuery orderByProcessDefinitionId()
Description copied from interface:ExternalTaskQuery
Order by process definition id (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByProcessDefinitionId
in interfaceExternalTaskQuery
-
orderByProcessDefinitionKey
public ExternalTaskQuery orderByProcessDefinitionKey()
Description copied from interface:ExternalTaskQuery
Order by process definition key (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByProcessDefinitionKey
in interfaceExternalTaskQuery
-
orderByTenantId
public ExternalTaskQuery orderByTenantId()
Description copied from interface:ExternalTaskQuery
Order by tenant id (needs to be followed byQuery.asc()
orQuery.desc()
). Note that the ordering of external tasks without tenant id is database-specific.- Specified by:
orderByTenantId
in interfaceExternalTaskQuery
-
orderByPriority
public ExternalTaskQuery orderByPriority()
Description copied from interface:ExternalTaskQuery
Order by priority (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByPriority
in interfaceExternalTaskQuery
-
executeCount
public long executeCount(CommandContext commandContext)
- Specified by:
executeCount
in classAbstractQuery<ExternalTaskQuery,ExternalTask>
-
executeList
public java.util.List<ExternalTask> executeList(CommandContext commandContext, Page page)
Description copied from class:AbstractQuery
Executes the actual query to retrieve the list of results.- Specified by:
executeList
in classAbstractQuery<ExternalTaskQuery,ExternalTask>
page
- used if the results must be paged. If null, no paging will be applied.
-
executeIdsList
public java.util.List<java.lang.String> executeIdsList(CommandContext commandContext)
- Overrides:
executeIdsList
in classAbstractQuery<ExternalTaskQuery,ExternalTask>
-
executeDeploymentIdMappingsList
public java.util.List<ImmutablePair<java.lang.String,java.lang.String>> executeDeploymentIdMappingsList(CommandContext commandContext)
- Overrides:
executeDeploymentIdMappingsList
in classAbstractQuery<ExternalTaskQuery,ExternalTask>
-
getExternalTaskId
public java.lang.String getExternalTaskId()
-
getWorkerId
public java.lang.String getWorkerId()
-
getLockExpirationBefore
public java.util.Date getLockExpirationBefore()
-
getLockExpirationAfter
public java.util.Date getLockExpirationAfter()
-
getTopicName
public java.lang.String getTopicName()
-
getLocked
public java.lang.Boolean getLocked()
-
getNotLocked
public java.lang.Boolean getNotLocked()
-
getExecutionId
public java.lang.String getExecutionId()
-
getProcessInstanceId
public java.lang.String getProcessInstanceId()
-
getProcessDefinitionId
public java.lang.String getProcessDefinitionId()
-
getActivityId
public java.lang.String getActivityId()
-
getSuspensionState
public SuspensionState getSuspensionState()
-
getRetriesLeft
public java.lang.Boolean getRetriesLeft()
-
getNow
public java.util.Date getNow()
-
-