Package org.camunda.bpm.engine.impl
Class JobQueryImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.db.ListQueryParameterObject
-
- org.camunda.bpm.engine.impl.AbstractQuery<JobQuery,Job>
-
- org.camunda.bpm.engine.impl.JobQueryImpl
-
public class JobQueryImpl extends AbstractQuery<JobQuery,Job> implements JobQuery, Serializable
- Author:
- Joram Barrez, Tom Baeyens, Falko Menge
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.camunda.bpm.engine.impl.AbstractQuery
AbstractQuery.ResultType
-
-
Field Summary
-
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 JobQueryImpl()
JobQueryImpl(CommandExecutor commandExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JobQuery
active()
Only select jobs that are not suspended.JobQuery
activityId(String activityId)
Only select jobs which are defined on an activity with the given id.JobQuery
createdAfter(Date date)
Only select jobs created after the given date.JobQuery
createdBefore(Date date)
Only select jobs created before the given date.JobQuery
duedateHigherThan(Date date)
Only select jobs where the duedate is higher then the given date.JobQuery
duedateHigherThen(Date date)
Only select jobs where the duedate is higher then the given date.JobQuery
duedateHigherThenOrEquals(Date date)
Only select jobs where the duedate is higher then or equals the given date.JobQuery
duedateLowerThan(Date date)
Only select jobs where the duedate is lower than the given date.JobQuery
duedateLowerThen(Date date)
Only select jobs where the duedate is lower then the given date.JobQuery
duedateLowerThenOrEquals(Date date)
Only select jobs where the duedate is lower then or equals the given date.JobQuery
exceptionMessage(String exceptionMessage)
Only select jobs that failed due to an exception with the given message.JobQuery
executable()
Only select jobs which are executable, ie.long
executeCount(CommandContext commandContext)
List<ImmutablePair<String,String>>
executeDeploymentIdMappingsList(CommandContext commandContext)
List<Job>
executeList(CommandContext commandContext, Page page)
Executes the actual query to retrieve the list of results.JobQueryImpl
executionId(String executionId)
Only select jobs which exist for the given executionJobQuery
failedActivityId(String activityId)
Only select jobs that failed due to an exception at an activity with the given id.String
getExceptionMessage()
boolean
getExecutable()
String
getExecutionId()
Set<String>
getIds()
Date
getNow()
String
getProcessInstanceId()
Set<String>
getProcessInstanceIds()
boolean
getRetriesLeft()
protected boolean
hasExcludingConditions()
Whether or not the query has excluding conditions.JobQuery
includeJobsWithoutTenantId()
Select jobs which have no tenant id.boolean
isWithException()
JobQuery
jobDefinitionId(String jobDefinitionId)
Only select jobs which exist for the given job definition id.JobQuery
jobId(String jobId)
Only select jobs with the given idJobQuery
jobIds(Set<String> ids)
Only select jobs whose id is in the given set of idsJobQuery
messages()
Only select jobs that are messages.JobQuery
noRetriesLeft()
Only select jobs which have no retries leftJobQuery
orderByExecutionId()
Order by execution id (needs to be followed byQuery.asc()
orQuery.desc()
).JobQuery
orderByJobDuedate()
Order by duedate (needs to be followed byQuery.asc()
orQuery.desc()
).JobQuery
orderByJobId()
Order by job id (needs to be followed byQuery.asc()
orQuery.desc()
).JobQuery
orderByJobPriority()
Order by priority for execution (needs to be followed byQuery.asc()
orQuery.desc()
).JobQuery
orderByJobRetries()
Order by retries (needs to be followed byQuery.asc()
orQuery.desc()
).JobQuery
orderByProcessDefinitionId()
Order by process definition id (needs to be followed byQuery.asc()
orQuery.desc()
).JobQuery
orderByProcessDefinitionKey()
Order by process definition key (needs to be followed byQuery.asc()
orQuery.desc()
).JobQuery
orderByProcessInstanceId()
Order by process instance id (needs to be followed byQuery.asc()
orQuery.desc()
).JobQuery
orderByTenantId()
Order by tenant id (needs to be followed byQuery.asc()
orQuery.desc()
).JobQuery
priorityHigherThanOrEquals(long priority)
Only select jobs with a priority that is higher than or equal to the given priority.JobQuery
priorityLowerThanOrEquals(long priority)
Only select jobs with a priority that is lower than or equal to the given priority.JobQuery
processDefinitionId(String processDefinitionId)
Only select jobs which exist for the given process definition id.JobQuery
processDefinitionKey(String processDefinitionKey)
Only select jobs which exist for the given process definition key.JobQueryImpl
processInstanceId(String processInstanceId)
Only select jobs which exist for the given process instance.JobQuery
processInstanceIds(Set<String> processInstanceIds)
Only select jobs which exist for any of the given process instance idsJobQuery
suspended()
Only select jobs that are suspended.JobQuery
tenantIdIn(String... tenantIds)
Only select jobs that belong to one of the given tenant ids.JobQuery
timers()
Only select jobs that are timers.JobQuery
withException()
Only select jobs that failed due to an exception.JobQuery
withoutTenantId()
Only select jobs which have no tenant id.JobQuery
withRetriesLeft()
Only select jobs which have retries left-
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, executeIdsList, 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
-
activityId
protected String activityId
-
id
protected String id
-
jobDefinitionId
protected String jobDefinitionId
-
processInstanceId
protected String processInstanceId
-
executionId
protected String executionId
-
processDefinitionId
protected String processDefinitionId
-
processDefinitionKey
protected String processDefinitionKey
-
retriesLeft
protected boolean retriesLeft
-
executable
protected boolean executable
-
onlyTimers
protected boolean onlyTimers
-
onlyMessages
protected boolean onlyMessages
-
duedateHigherThan
protected Date duedateHigherThan
-
duedateLowerThan
protected Date duedateLowerThan
-
duedateHigherThanOrEqual
protected Date duedateHigherThanOrEqual
-
duedateLowerThanOrEqual
protected Date duedateLowerThanOrEqual
-
createdBefore
protected Date createdBefore
-
createdAfter
protected Date createdAfter
-
priorityHigherThanOrEqual
protected Long priorityHigherThanOrEqual
-
priorityLowerThanOrEqual
protected Long priorityLowerThanOrEqual
-
withException
protected boolean withException
-
exceptionMessage
protected String exceptionMessage
-
failedActivityId
protected String failedActivityId
-
noRetriesLeft
protected boolean noRetriesLeft
-
suspensionState
protected SuspensionState suspensionState
-
isTenantIdSet
protected boolean isTenantIdSet
-
tenantIds
protected String[] tenantIds
-
includeJobsWithoutTenantId
protected boolean includeJobsWithoutTenantId
-
-
Constructor Detail
-
JobQueryImpl
public JobQueryImpl()
-
JobQueryImpl
public JobQueryImpl(CommandExecutor commandExecutor)
-
-
Method Detail
-
jobId
public JobQuery jobId(String jobId)
Description copied from interface:JobQuery
Only select jobs with the given id
-
jobIds
public JobQuery jobIds(Set<String> ids)
Description copied from interface:JobQuery
Only select jobs whose id is in the given set of ids
-
jobDefinitionId
public JobQuery jobDefinitionId(String jobDefinitionId)
Description copied from interface:JobQuery
Only select jobs which exist for the given job definition id.- Specified by:
jobDefinitionId
in interfaceJobQuery
-
processInstanceId
public JobQueryImpl processInstanceId(String processInstanceId)
Description copied from interface:JobQuery
Only select jobs which exist for the given process instance.- Specified by:
processInstanceId
in interfaceJobQuery
-
processInstanceIds
public JobQuery processInstanceIds(Set<String> processInstanceIds)
Description copied from interface:JobQuery
Only select jobs which exist for any of the given process instance ids- Specified by:
processInstanceIds
in interfaceJobQuery
-
executionId
public JobQueryImpl executionId(String executionId)
Description copied from interface:JobQuery
Only select jobs which exist for the given execution- Specified by:
executionId
in interfaceJobQuery
-
processDefinitionId
public JobQuery processDefinitionId(String processDefinitionId)
Description copied from interface:JobQuery
Only select jobs which exist for the given process definition id.- Specified by:
processDefinitionId
in interfaceJobQuery
-
processDefinitionKey
public JobQuery processDefinitionKey(String processDefinitionKey)
Description copied from interface:JobQuery
Only select jobs which exist for the given process definition key.- Specified by:
processDefinitionKey
in interfaceJobQuery
-
activityId
public JobQuery activityId(String activityId)
Description copied from interface:JobQuery
Only select jobs which are defined on an activity with the given id.- Specified by:
activityId
in interfaceJobQuery
-
withRetriesLeft
public JobQuery withRetriesLeft()
Description copied from interface:JobQuery
Only select jobs which have retries left- Specified by:
withRetriesLeft
in interfaceJobQuery
-
executable
public JobQuery executable()
Description copied from interface:JobQuery
Only select jobs which are executable, ie. retries > 0 and duedate is null or duedate is in the past- Specified by:
executable
in interfaceJobQuery
-
timers
public JobQuery timers()
Description copied from interface:JobQuery
Only select jobs that are timers. Cannot be used together withJobQuery.messages()
-
messages
public JobQuery messages()
Description copied from interface:JobQuery
Only select jobs that are messages. Cannot be used together withJobQuery.timers()
-
duedateHigherThan
public JobQuery duedateHigherThan(Date date)
Description copied from interface:JobQuery
Only select jobs where the duedate is higher then the given date.- Specified by:
duedateHigherThan
in interfaceJobQuery
-
duedateLowerThan
public JobQuery duedateLowerThan(Date date)
Description copied from interface:JobQuery
Only select jobs where the duedate is lower than the given date.- Specified by:
duedateLowerThan
in interfaceJobQuery
-
duedateHigherThen
public JobQuery duedateHigherThen(Date date)
Description copied from interface:JobQuery
Only select jobs where the duedate is higher then the given date.- Specified by:
duedateHigherThen
in interfaceJobQuery
-
duedateHigherThenOrEquals
public JobQuery duedateHigherThenOrEquals(Date date)
Description copied from interface:JobQuery
Only select jobs where the duedate is higher then or equals the given date.- Specified by:
duedateHigherThenOrEquals
in interfaceJobQuery
-
duedateLowerThen
public JobQuery duedateLowerThen(Date date)
Description copied from interface:JobQuery
Only select jobs where the duedate is lower then the given date.- Specified by:
duedateLowerThen
in interfaceJobQuery
-
duedateLowerThenOrEquals
public JobQuery duedateLowerThenOrEquals(Date date)
Description copied from interface:JobQuery
Only select jobs where the duedate is lower then or equals the given date.- Specified by:
duedateLowerThenOrEquals
in interfaceJobQuery
-
createdBefore
public JobQuery createdBefore(Date date)
Description copied from interface:JobQuery
Only select jobs created before the given date.- Specified by:
createdBefore
in interfaceJobQuery
-
createdAfter
public JobQuery createdAfter(Date date)
Description copied from interface:JobQuery
Only select jobs created after the given date.- Specified by:
createdAfter
in interfaceJobQuery
-
priorityHigherThanOrEquals
public JobQuery priorityHigherThanOrEquals(long priority)
Description copied from interface:JobQuery
Only select jobs with a priority that is higher than or equal to the given priority.- Specified by:
priorityHigherThanOrEquals
in interfaceJobQuery
-
priorityLowerThanOrEquals
public JobQuery priorityLowerThanOrEquals(long priority)
Description copied from interface:JobQuery
Only select jobs with a priority that is lower than or equal to the given priority.- Specified by:
priorityLowerThanOrEquals
in interfaceJobQuery
-
withException
public JobQuery withException()
Description copied from interface:JobQuery
Only select jobs that failed due to an exception.- Specified by:
withException
in interfaceJobQuery
-
exceptionMessage
public JobQuery exceptionMessage(String exceptionMessage)
Description copied from interface:JobQuery
Only select jobs that failed due to an exception with the given message.- Specified by:
exceptionMessage
in interfaceJobQuery
-
failedActivityId
public JobQuery failedActivityId(String activityId)
Description copied from interface:JobQuery
Only select jobs that failed due to an exception at an activity with the given id.- Specified by:
failedActivityId
in interfaceJobQuery
-
noRetriesLeft
public JobQuery noRetriesLeft()
Description copied from interface:JobQuery
Only select jobs which have no retries left- Specified by:
noRetriesLeft
in interfaceJobQuery
-
active
public JobQuery active()
Description copied from interface:JobQuery
Only select jobs that are not suspended.
-
suspended
public JobQuery suspended()
Description copied from interface:JobQuery
Only select jobs that are suspended.
-
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<JobQuery,Job>
- Returns:
true
if the query does have excluding conditions,false
otherwise
-
tenantIdIn
public JobQuery tenantIdIn(String... tenantIds)
Description copied from interface:JobQuery
Only select jobs that belong to one of the given tenant ids.- Specified by:
tenantIdIn
in interfaceJobQuery
-
withoutTenantId
public JobQuery withoutTenantId()
Description copied from interface:JobQuery
Only select jobs which have no tenant id.- Specified by:
withoutTenantId
in interfaceJobQuery
-
includeJobsWithoutTenantId
public JobQuery includeJobsWithoutTenantId()
Description copied from interface:JobQuery
Select jobs which have no tenant id. Can be used in combination withJobQuery.tenantIdIn(String...)
.- Specified by:
includeJobsWithoutTenantId
in interfaceJobQuery
-
orderByJobDuedate
public JobQuery orderByJobDuedate()
Description copied from interface:JobQuery
Order by duedate (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByJobDuedate
in interfaceJobQuery
-
orderByExecutionId
public JobQuery orderByExecutionId()
Description copied from interface:JobQuery
Order by execution id (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByExecutionId
in interfaceJobQuery
-
orderByJobId
public JobQuery orderByJobId()
Description copied from interface:JobQuery
Order by job id (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByJobId
in interfaceJobQuery
-
orderByProcessInstanceId
public JobQuery orderByProcessInstanceId()
Description copied from interface:JobQuery
Order by process instance id (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByProcessInstanceId
in interfaceJobQuery
-
orderByProcessDefinitionId
public JobQuery orderByProcessDefinitionId()
Description copied from interface:JobQuery
Order by process definition id (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByProcessDefinitionId
in interfaceJobQuery
-
orderByProcessDefinitionKey
public JobQuery orderByProcessDefinitionKey()
Description copied from interface:JobQuery
Order by process definition key (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByProcessDefinitionKey
in interfaceJobQuery
-
orderByJobRetries
public JobQuery orderByJobRetries()
Description copied from interface:JobQuery
Order by retries (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByJobRetries
in interfaceJobQuery
-
orderByJobPriority
public JobQuery orderByJobPriority()
Description copied from interface:JobQuery
Order by priority for execution (needs to be followed byQuery.asc()
orQuery.desc()
).- Specified by:
orderByJobPriority
in interfaceJobQuery
-
orderByTenantId
public JobQuery orderByTenantId()
Description copied from interface:JobQuery
Order by tenant id (needs to be followed byQuery.asc()
orQuery.desc()
). Note that the ordering of job without tenant id is database-specific.- Specified by:
orderByTenantId
in interfaceJobQuery
-
executeCount
public long executeCount(CommandContext commandContext)
- Specified by:
executeCount
in classAbstractQuery<JobQuery,Job>
-
executeList
public List<Job> 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<JobQuery,Job>
page
- used if the results must be paged. If null, no paging will be applied.
-
executeDeploymentIdMappingsList
public List<ImmutablePair<String,String>> executeDeploymentIdMappingsList(CommandContext commandContext)
- Overrides:
executeDeploymentIdMappingsList
in classAbstractQuery<JobQuery,Job>
-
getProcessInstanceId
public String getProcessInstanceId()
-
getExecutionId
public String getExecutionId()
-
getRetriesLeft
public boolean getRetriesLeft()
-
getExecutable
public boolean getExecutable()
-
getNow
public Date getNow()
-
isWithException
public boolean isWithException()
-
getExceptionMessage
public String getExceptionMessage()
-
-