28.2.3. Jobs (API requests)
All POST and DELETE requests in the Knowledge Store REST API return a job ID associated with each request, in addition to the returned request details. You can use a job ID to view the request status or delete a sent request.
Knowledge Store REST API requests, or jobs, can have the following statuses:
| Status | Description |
|---|---|
|
| The request was accepted and is being processed. |
|
| The request contained incorrect content and was not accepted. |
|
| The requested resource (path) does not exist. |
|
| The resource already exists. |
|
| An error occurred in KIE Server. |
|
| The request finished successfully. |
|
| The request failed. |
|
| The request was approved. |
|
| The request was denied. |
|
| The job ID for the request could not be found due to one of the following reasons:
|
The Knowledge Store REST API supports the following endpoints for retrieving or deleting sent API requests. The Knowledge Store REST API base URL is http://SERVER:PORT/decision-central/rest/. All requests require HTTP Basic authentication or token-based authentication for the rest-all user role.
- [GET] /jobs/{jobId}
Returns the status of a specified job (a previously sent API request).
Expand 表28.14 Request parameters Name Description Type Requirement jobIdID of the job to be retrieved (example:
1541010216919-1)String
Required
Example server response (JSON)
{ "status": "SUCCESS", "jobId": "1541010216919-1", "result": null, "lastModified": 1541010218352, "detailedResult": [ "level:INFO, path:null, text:Build of module 'Mortgage_Process' (requested by system) completed.\n Build: SUCCESSFUL" ] }- [DELETE] /jobs/{jobId}
Deletes a specified job (a previously sent API request). If the job is not being processed yet, this request removes the job from the job queue. This request does not cancel or stop an ongoing job.
Expand 表28.15 Request parameters Name Description Type Requirement jobIdID of the job to be deleted (example:
1541010216919-1)String
Required
Example server response (JSON)
{ "status": "GONE", "jobId": "1541010216919-1", "result": null, "lastModified": 1541132054916, "detailedResult": [ "level:INFO, path:null, text:Build of module 'Mortgage_Process' (requested by system) completed.\n Build: SUCCESSFUL" ] }