返回介绍

15.13. Jobs

发布于 2023-09-17 23:40:35 字数 8167 浏览 0 评论 0 收藏 0

15.13.1. Get a single job

GET management/jobs/{jobId}
Table 226. Get a single job - URL parameters
ParameterRequiredValueDescription
jobIdYesStringThe id of the job to get.

Success response body:

{
   "id":"8",
   "url":"http://localhost:8182/management/jobs/8",
   "processInstanceId":"5",
   "processInstanceUrl":"http://localhost:8182/runtime/process-instances/5",
   "processDefinitionId":"timerProcess:1:4",
   "processDefinitionUrl":"http://localhost:8182/repository/process-definitions/timerProcess%3A1%3A4",
   "executionId":"7",
   "executionUrl":"http://localhost:8182/runtime/executions/7",
   "retries":3,
   "exceptionMessage":null,
   "dueDate":"2013-06-04T22:05:05.474+0000",
   "tenantId":null
}
Table 227. Get a single job - Response codes
Response codeDescription
200Indicates the job exists and is returned.
404Indicates the requested job does not exist.

15.13.2. Delete a job

DELETE management/jobs/{jobId}
Table 228. Delete a job - URL parameters
ParameterRequiredValueDescription
jobIdYesStringThe id of the job to delete.
Table 229. Delete a job - Response codes
Response codeDescription
204Indicates the job was found and has been deleted. Response-body is intentionally empty.
404Indicates the requested job was not found.

15.13.3. Execute a single job

POST management/jobs/{jobId}

Body JSON:

{
  "action" : "execute"
}
Table 230. Execute a single job - JSON Body parameters
ParameterDescriptionRequired
actionAction to perform. Only execute is supported.Yes
Table 231. Execute a single job - Response codes
Response codeDescription
204Indicates the job was executed. Response-body is intentionally empty.
404Indicates the requested job was not found.
500Indicates the an exception occurred while executing the job. The status-description contains additional detail about the error. The full error-stacktrace can be fetched later on if needed.

15.13.4. Get the exception stacktrace for a job

GET management/jobs/{jobId}/exception-stacktrace
Table 232. Get the exception stacktrace for a job - URL parameters
ParameterDescriptionRequired
jobIdId of the job to get the stacktrace for.Yes
Table 233. Get the exception stacktrace for a job - Response codes
Response codeDescription
200Indicates the requested job was not found and the stacktrace has been returned. The response contains the raw stacktrace and always has a Content-type of text/plain.
404Indicates the requested job was not found or the job doesn’t have an exception stacktrace. Status-description contains additional information about the error.

15.13.5. Get a list of jobs

GET management/jobs
Table 234. Get a list of jobs - URL query parameters
ParameterDescriptionType
idOnly return job with the given idString
processInstanceIdOnly return jobs part of a process with the given idString
executionIdOnly return jobs part of an execution with the given idString
processDefinitionIdOnly return jobs with the given process definition idString
withRetriesLeftIf true, only return jobs with retries left. If false, this parameter is ignored.Boolean
executableIf true, only return jobs which are executable. If false, this parameter is ignored.Boolean
timersOnlyIf true, only return jobs which are timers. If false, this parameter is ignored. Cannot be used together with 'messagesOnly'.Boolean
messagesOnlyIf true, only return jobs which are messages. If false, this parameter is ignored. Cannot be used together with 'timersOnly'Boolean
withExceptionIf true, only return jobs for which an exception occurred while executing it. If false, this parameter is ignored.Boolean
dueBeforeOnly return jobs which are due to be executed before the given date. Jobs without duedate are never returned using this parameter.Date
dueAfterOnly return jobs which are due to be executed after the given date. Jobs without duedate are never returned using this parameter.Date
exceptionMessageOnly return jobs with the given exception messageString
tenantIdNoString
Only return jobs with the given tenantId.tenantIdLikeNo
StringOnly return jobs with a tenantId like the given value.withoutTenantId
NoBooleanIf true, only returns jobs without a tenantId set. If false, the withoutTenantId parameter is ignored.
sortField to sort results on, should be one of id, dueDate, executionId, processInstanceId, retries or tenantId.String

Success response body:

{
   "data":[
    {
     "id":"13",
     "url":"http://localhost:8182/management/jobs/13",
     "processInstanceId":"5",
     "processInstanceUrl":"http://localhost:8182/runtime/process-instances/5",
     "processDefinitionId":"timerProcess:1:4",
     "processDefinitionUrl":"http://localhost:8182/repository/process-definitions/timerProcess%3A1%3A4",
     "executionId":"12",
     "executionUrl":"http://localhost:8182/runtime/executions/12",
     "retries":0,
     "exceptionMessage":"Can't find scripting engine for 'unexistinglanguage'",
     "dueDate":"2013-06-07T10:00:24.653+0000",
     "tenantId":null
    }



   ],
   "total":2,
   "start":0,
   "sort":"id",
   "order":"asc",
   "size":2
}
Table 235. Get a list of jobs - Response codes
Response codeDescription
200Indicates the requested jobs were returned.
400Indicates an illegal value has been used in a url query parameter or the both 'messagesOnly' and 'timersOnly' are used as parameters. Status description contains additional details about the error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文