Get Job Definitions
Queries for job definitions that fulfill given parameters. The size of the result set can be retrieved by using the Get Job Definition Count method.
Method
GET /job-definition
Parameters
Query Parameters
| Name | Description |
|---|---|
| jobDefinitionId | Filter by job definition id. |
| activityIdIn | Only include job definitions which belong to one of the passed and comma-separated activity ids. |
| processDefinitionId | Only include job definitions which exist for the given process definition id. |
| processDefinitionKey | Only include job definitions which exist for the given process definition key. |
| jobType | Only include job definitions which exist for the given job type. See the User Guide for more information about job types. |
| jobConfiguration | Only include job definitions which exist for the given job configuration. For example: for timer jobs it is the timer configuration. |
| active | Only include active job definitions. Value may only be true, as false is the default behavior. |
| suspended | Only include suspended job definitions. Value may only be true, as false is the default behavior. |
| withOverridingJobPriority | Only include job definitions that have an overriding job priority defined. The only effective value is true. If set to false, this filter is not applied. |
| tenantIdIn | Only include job definitions which belong to one of the passed and comma-separated tenant ids. |
| withoutTenantId | Only include job definitions which belong to no tenant. Value may only be true, as false is the default behavior. |
| includeJobDefinitionsWithoutTenantId | Include job definitions which belong to no tenant. Can be used in combination with tenantIdIn. Value may only be true, as false is the default behavior. |
| sortBy | Sort the results lexicographically by a given criterion. Valid values are
jobDefinitionId, activityId, processDefinitionId, processDefinitionKey, jobType, jobConfiguration and tenantId.
Must be used in conjunction with the sortOrder parameter. |
| sortOrder | Sort the results in a given order. Values may be asc for ascending order or desc for descending order.
Must be used in conjunction with the sortBy parameter. |
| firstResult | Pagination of results. Specifies the index of the first result to return. |
| maxResults | Pagination of results. Specifies the maximum number of results to return. Will return less results if there are no more results left. |
Result
A JSON array of job definition objects. Each job definition object has the following properties:
| Name | Value | Description |
|---|---|---|
| id | String | The id of the job definition. |
| processDefinitionId | String | The id of the process definition this job definition is associated with. |
| processDefinitionKey | String | The key of the process definition this job definition is associated with. |
| activityId | String | The id of the activity this job definition is associated with. |
| jobType | String | The type of the job which is running for this job definition. See the User Guide for more information about job types. |
| jobConfiguration | String | The configuration of a job definition provides details about the jobs which will be created. For example: for timer jobs it is the timer configuration. |
| overridingJobPriority | Number | The execution priority defined for jobs that are created based on this definition. May be null when the priority has not been overridden on the job definition level. |
| suspended | Boolean | Indicates whether this job definition is suspended or not. |
| tenantId | String | The id of the tenant this job definition is associated with. |
| deploymentId | String | The id of the deployment this job definition is related to. In a deployment-aware setup, this leads to all jobs of the same definition being executed on the same node. |
Response Codes
| Code | Media type | Description |
|---|---|---|
| 200 | application/json | Request successful. |
| 400 | application/json | Returned if some of the query parameters are invalid, for example if a sortOrder parameter is supplied, but no sortBy. See the Introduction for the error response format. |
Example
Request
GET /job-definition?activityIdIn=ServiceTask1,ServiceTask2
Response
[
{
"id": "aJobDefId",
"processDefinitionId": "aProcDefId",
"processDefinitionKey": "aProcDefKey",
"activityId": "ServiceTask1",
"jobType": "asynchronous-continuation",
"jobConfiguration": "",
"suspended": false,
"overridingJobPriority": 15,
"tenantId": null,
"deploymentId": "aDeploymentId"
},
{
"id": "aJobDefId",
"processDefinitionId": "aProcDefId",
"processDefinitionKey": "aProcDefKey",
"activityId": "ServiceTask2",
"jobType": "asynchronous-continuation",
"jobConfiguration": "",
"suspended": true,
"overridingJobPriority": null,
"tenantId": null,
"deploymentId": "aDeploymentId"
}
]