diff --git a/engine-rest/engine-rest-openapi/src/main/templates/lib/commons/historic-external-task-log-query-params.ftl b/engine-rest/engine-rest-openapi/src/main/templates/lib/commons/historic-external-task-log-query-params.ftl new file mode 100644 index 00000000000..8b6a06c0fe5 --- /dev/null +++ b/engine-rest/engine-rest-openapi/src/main/templates/lib/commons/historic-external-task-log-query-params.ftl @@ -0,0 +1,107 @@ +<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/external-task-log/get-external-task-log-query/index.html --> + +<#assign sortByValues = [ + '"timestamp"', + '"externalTaskId"', + '"topicName"', + '"workerId"', + '"retries"', + '"priority"', + '"activityId"', + '"activityInstanceId"', + '"executionId"', + '"processInstanceId"', + '"processDefinitionId"', + '"processDefinitionKey"', + '"tenantId"' +]> + +<#assign params = { + "logId": { + "type": "string", + "desc": "Filter by historic external task log id." + }, + "externalTaskId": { + "type": "string", + "desc": "Filter by external task id." + }, + "topicName": { + "type": "string", + "desc": "Filter by an external task topic." + }, + "workerId": { + "type": "string", + "desc": "Filter by the id of the worker that the task was most recently locked by." + }, + "errorMessage": { + "type": "string", + "desc": "Filter by external task exception message." + }, + "activityIdIn": { + "type": "array", + "itemType": "string", + "desc": "Only include historic external task logs which belong to one of the passed activity ids." + }, + "activityInstanceIdIn": { + "type": "array", + "itemType": "string", + "desc": "Only include historic external task logs which belong to one of the passed activity + instance ids." + }, + "executionIdIn": { + "type": "array", + "itemType": "string", + "desc": "Only include historic external task logs which belong to one of the passed execution ids." + }, + "processInstanceId": { + "type": "string", + "desc": "Filter by process instance id." + }, + "processDefinitionId": { + "type": "string", + "desc": "Filter by process definition id." + }, + "processDefinitionKey": { + "type": "string", + "desc": "Filter by process definition key." + }, + "tenantIdIn": { + "type": "array", + "itemType": "string", + "desc": "Only include historic external task log entries which belong to one of the passed and + comma-separated tenant ids." + }, + "withoutTenantId": { + "type": "boolean", + "desc": "Only include historic external task log entries that belong to no tenant. Value may only + be `true`, as `false` is the default behavior." + }, + "priorityLowerThanOrEquals": { + "type": "integer", + "format": "int64", + "desc": "Only include logs for which the associated external task had a priority lower than or + equal to the given value. Value must be a valid `long` value." + }, + "priorityHigherThanOrEquals": { + "type": "integer", + "format": "int64", + "desc": "Only include logs for which the associated external task had a priority higher than or + equal to the given value. Value must be a valid `long` value." + }, + "creationLog": { + "type": "boolean", + "desc": "Only include creation logs. Value may only be `true`, as `false` is the default behavior." + }, + "failureLog": { + "type": "boolean", + "desc": "Only include failure logs. Value may only be `true`, as `false` is the default behavior." + }, + "successLog": { + "type": "boolean", + "desc": "Only include success logs. Value may only be `true`, as `false` is the default behavior." + }, + "deletionLog": { + "type": "boolean", + "desc": "Only include deletion logs. Value may only be `true`, as `false` is the default behavior." + } +}> diff --git a/engine-rest/engine-rest-openapi/src/main/templates/main.ftl b/engine-rest/engine-rest-openapi/src/main/templates/main.ftl index a375cfafc4a..de7eb17048f 100644 --- a/engine-rest/engine-rest-openapi/src/main/templates/main.ftl +++ b/engine-rest/engine-rest-openapi/src/main/templates/main.ftl @@ -52,6 +52,7 @@ {"name": "Historic Decision Definition"}, {"name": "Historic Decision Instance"}, {"name": "Historic Decision Requirements Definition"}, + {"name": "Historic External Task Log"}, {"name": "Historic Incident"}, {"name": "Historic Job Log"}, {"name": "Historic Process Definition"}, diff --git a/engine-rest/engine-rest-openapi/src/main/templates/models/org/camunda/bpm/engine/rest/dto/history/HistoricExternalTaskLogDto.ftl b/engine-rest/engine-rest-openapi/src/main/templates/models/org/camunda/bpm/engine/rest/dto/history/HistoricExternalTaskLogDto.ftl new file mode 100644 index 00000000000..64872bec767 --- /dev/null +++ b/engine-rest/engine-rest-openapi/src/main/templates/models/org/camunda/bpm/engine/rest/dto/history/HistoricExternalTaskLogDto.ftl @@ -0,0 +1,143 @@ +<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/external-task-log/get-external-task-log-query/index.html --> +<#macro dto_macro docsUrl=""> +<@lib.dto > + + <@lib.property + name = "id" + type = "string" + desc = "The id of the log entry." + /> + + <@lib.property + name = "externalTaskId" + type = "string" + desc = "The id of the external task." + /> + + <@lib.property + name = "timestamp" + type = "string" + format = "date-time" + desc = "The time when the log entry has been written." + /> + + <@lib.property + name = "topicName" + type = "string" + desc = "The topic name of the associated external task." + /> + + <@lib.property + name = "workerId" + type = "string" + desc = "The id of the worker that posessed the most recent lock." + /> + + <@lib.property + name = "retries" + type = "integer" + format = "int32" + desc = "The number of retries the associated external task has left." + /> + + <@lib.property + name = "priority" + type = "integer" + format = "int64" + desc = "The execution priority the external task had when the log entry was created." + /> + + <@lib.property + name = "errorMessage" + type = "string" + desc = "The message of the error that occurred by executing the associated external task." + /> + + <@lib.property + name = "activityId" + type = "string" + desc = "The id of the activity on which the associated external task was created." + /> + + <@lib.property + name = "activityInstanceId" + type = "string" + desc = "The id of the activity instance on which the associated external task was created." + /> + + <@lib.property + name = "executionId" + type = "string" + desc = "The execution id on which the associated external task was created." + /> + + <@lib.property + name = "processInstanceId" + type = "string" + desc = "The id of the process instance on which the associated external task was created." + /> + + <@lib.property + name = "processDefinitionId" + type = "string" + desc = "The id of the process definition which the associated external task belongs to." + /> + + <@lib.property + name = "processDefinitionKey" + type = "string" + desc = "The key of the process definition which the associated external task belongs to." + /> + + <@lib.property + name = "tenantId" + type = "string" + desc = "The id of the tenant that this historic external task log entry belongs to." + /> + + <@lib.property + name = "creationLog" + type = "boolean" + desc = "A flag indicating whether this log represents the creation of the associated + external task." + /> + + <@lib.property + name = "failureLog" + type = "boolean" + desc = "A flag indicating whether this log represents the failed execution of the + associated external task." + /> + + <@lib.property + name = "successLog" + type = "boolean" + desc = "A flag indicating whether this log represents the successful execution of the + associated external task." + /> + + <@lib.property + name = "deletionLog" + type = "boolean" + desc = "A flag indicating whether this log represents the deletion of the associated + external task." + /> + + <@lib.property + name = "removalTime" + type = "string" + format = "date-time" + desc = "The time after which this log should be removed by the History Cleanup job. Default + format `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. For further information, please see the [documentation](${docsUrl}/reference/rest/overview/date-format/)" + /> + + <@lib.property + name = "rootProcessInstanceId" + type = "string" + desc = "The process instance id of the root process instance that initiated the process + containing this log." + last = true + /> + + + \ No newline at end of file diff --git a/engine-rest/engine-rest-openapi/src/main/templates/models/org/camunda/bpm/engine/rest/dto/history/HistoricExternalTaskLogQueryDto.ftl b/engine-rest/engine-rest-openapi/src/main/templates/models/org/camunda/bpm/engine/rest/dto/history/HistoricExternalTaskLogQueryDto.ftl new file mode 100644 index 00000000000..985ab10d1d1 --- /dev/null +++ b/engine-rest/engine-rest-openapi/src/main/templates/models/org/camunda/bpm/engine/rest/dto/history/HistoricExternalTaskLogQueryDto.ftl @@ -0,0 +1,19 @@ +<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/external-task-log/post-external-task-log-query/index.html --> +<#macro dto_macro docsUrl=""> +<@lib.dto desc = "A Historic External Task Log instance query which defines a list of Historic External Task Log instances"> + + <#include "/lib/commons/historic-external-task-log-query-params.ftl"> + <@lib.properties params/> + "sorting": { + "type": "array", + "description": "An array of criteria to sort the result by. Each element of the array is + an object that specifies one ordering. The position in the array + identifies the rank of an ordering, i.e., whether it is primary, secondary, + etc. Sorting has no effect for `count` endpoints.", + "items": + <#assign last = true> + <#include "/lib/commons/sort-props.ftl"> + } + + + \ No newline at end of file diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/count/get.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/count/get.ftl new file mode 100644 index 00000000000..0c13e8f1f8e --- /dev/null +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/count/get.ftl @@ -0,0 +1,51 @@ +<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/external-task-log/get-external-task-log-query-count/index.html --> +<#macro endpoint_macro docsUrl=""> +{ + <@lib.endpointInfo + id = "getHistoricExternalTaskLogsCount" + tag = "Historic External Task Log" + summary = "Get External Task Log Count" + desc = "Queries for the number of historic external task logs that fulfill the given + parameters. + Takes the same parameters as the + [Get External Task Logs](${docsUrl}/reference/rest/history/external-task-log/get-external-task-log-query/) + method." + /> + + "parameters" : [ + + <#assign last = true > + <#include "/lib/commons/historic-external-task-log-query-params.ftl" > + <@lib.parameters + object = params + last = last + /> + + ], + + "responses": { + + <@lib.response + code = "200" + dto = "CountResultDto" + desc = "Request successful." + examples = ['"example-1": { + "summary": "GET `/history/external-task-log/count?externalTaskId=anExternalTaskId`", + "description": "GET `/history/external-task-log/count?externalTaskId=anExternalTaskId`", + "value": { + "count": 1 + } + }'] + /> + + <@lib.response + code = "400" + dto = "ExceptionDto" + desc = "Returned if some of the query parameters are invalid." + last = true + /> + + } + +} + \ No newline at end of file diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/count/post.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/count/post.ftl new file mode 100644 index 00000000000..cd15e122088 --- /dev/null +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/count/post.ftl @@ -0,0 +1,55 @@ +<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/external-task-log/post-external-task-log-query-count/index.html --> +<#macro endpoint_macro docsUrl=""> +{ + <@lib.endpointInfo + id = "queryHistoricExternalTaskLogsCount" + tag = "Historic External Task Log" + summary = "Get External Task Log Count (POST)" + desc = "Queries for the number of historic external task logs that fulfill the given + parameters. + This method takes the same message body as the + [Get External Task Logs (POST)](${docsUrl}/reference/rest/history/external-task-log/post-external-task-log-query/) + method and therefore it is slightly more powerful than the + [Get External Task Log Count](${docsUrl}/reference/rest/history/external-task-log/get-external-task-log-query-count/) + method." + /> + + <@lib.requestBody + mediaType = "application/json" + dto = "HistoricExternalTaskLogQueryDto" + examples = ['"example-1": { + "summary": "POST `/history/external-task-log/count`", + "value": { + "externalTaskId": "anExternalTaskId" + } + }'] + /> + + "responses": { + + <@lib.response + code = "200" + dto = "CountResultDto" + desc = "Request successful." + examples = ['"example-1": { + "summary": "POST `/history/external-task-log/count`", + "description": "POST `/history/external-task-log/count`", + "value": { + "count": 1 + } + }'] + /> + + <@lib.response + code = "400" + dto = "ExceptionDto" + desc = "Returned if some of the query parameters are invalid. See the + [Introduction](${docsUrl}/reference/rest/overview/#error-handling) + for the error response format." + last = true + /> + + } + +} + \ No newline at end of file diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/get.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/get.ftl new file mode 100644 index 00000000000..5a570815e22 --- /dev/null +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/get.ftl @@ -0,0 +1,79 @@ +<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/external-task-log/get-external-task-log-query/index.html --> +<#macro endpoint_macro docsUrl=""> +{ + <@lib.endpointInfo + id = "getHistoricExternalTaskLogs" + tag = "Historic External Task Log" + summary = "Get External Task Logs" + desc = "Queries for historic external task logs that fulfill the given parameters. + The size of the result set can be retrieved by using the + [Get External Task Log Count](${docsUrl}/reference/rest/history/external-task-log/get-external-task-log-query-count/) + method." + /> + + "parameters" : [ + + <#assign last = false > + <#include "/lib/commons/historic-external-task-log-query-params.ftl"> + <@lib.parameters + object = params + last = last + /> + <#include "/lib/commons/sort-params.ftl"> + <#assign last = true > + <#include "/lib/commons/pagination-params.ftl"> + + ], + + "responses": { + + <@lib.response + code = "200" + dto = "HistoricExternalTaskLogDto" + array = true + desc = "Request successful." + examples = ['"example-1": { + "summary": "GET `/history/external-task-log?externalTaskId=anExternalTaskId`", + "description": "GET `/history/external-task-log?externalTaskId=anExternalTaskId`", + "value": [ + { + "id": "someId", + "timestamp": "2017-01-15T15:22:20.000+0200", + "externalTaskId": "anExternalTaskId", + "topicName": "aTopicName", + "workerId": "aWorkerId", + "retries": 3, + "priority": 5, + "errorMessage": "An error occured!", + "activityId": "externalServiceTask", + "activityInstanceId": "externalServiceTask:15", + "executionId": "anExecutionId", + "processInstanceId": "aProcessInstanceId", + "processDefinitionId": "aProcessDefinitionId", + "processDefinitionKey": "aProcessDefinitionKey", + "tenantId": null, + "creationLog": false, + "failureLog": true, + "successLog": false, + "deletionLog": false, + "removalTime": "2018-02-10T14:33:19.000+0200", + "rootProcessInstanceId": "aRootProcessInstanceId" + } + ] + }'] + /> + + <@lib.response + code = "400" + dto = "ExceptionDto" + desc = "Returned if some of the query parameters are invalid, for example if a `sortOrder` + parameter is supplied, but no `sortBy`. See the + [Introduction](${docsUrl}/reference/rest/overview/#error-handling) + for the error response format." + last = true + /> + + } + +} + \ No newline at end of file diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/post.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/post.ftl new file mode 100644 index 00000000000..93068a527dd --- /dev/null +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/post.ftl @@ -0,0 +1,77 @@ +<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/external-task-log/post-external-task-log-query/index.html --> +<#macro endpoint_macro docsUrl=""> +{ + <@lib.endpointInfo + id = "queryHistoricExternalTaskLogs" + tag = "Historic External Task Log" + summary = "Get External Task Logs (POST)" + desc = "Queries for historic external task logs that fulfill the given parameters. + This method is slightly more powerful than the + [Get External Task Logs](${docsUrl}/reference/rest/history/external-task-log/get-external-task-log-query/) + method because it allows filtering by historic external task logs + values of the different types `String`, `Number` or `Boolean`." + /> + + <@lib.requestBody + mediaType = "application/json" + dto = "HistoricExternalTaskLogQueryDto" + examples = ['"example-1": { + "summary": "POST `/history/external-task-log`", + "value": { + "externalTaskId": "anExternalTaskId" + } + }'] + /> + + "responses": { + + <@lib.response + code = "200" + dto = "HistoricExternalTaskLogDto" + array = true + desc = "Request successful." + examples = ['"example-1": { + "summary": "POST `/history/external-task-log`", + "description": "POST `/history/external-task-log`", + "value": [ + { + "id": "someId", + "timestamp": "2017-01-15T15:22:20.000+0200", + "externalTaskId": "anExternalTaskId", + "topicName": "aTopicName", + "workerId": "aWorkerId", + "retries": 3, + "priority": 5, + "errorMessage": "An error occured!", + "activityId": "externalServiceTask", + "activityInstanceId": "externalServiceTask:15", + "executionId": "anExecutionId", + "processInstanceId": "aProcessInstanceId", + "processDefinitionId": "aProcessDefinitionId", + "processDefinitionKey": "aProcessDefinitionKey", + "tenantId": null, + "creationLog": false, + "failureLog": true, + "successLog": false, + "deletionLog": false, + "removalTime": "2018-02-10T14:33:19.000+0200", + "rootProcessInstanceId": "aRootProcessInstanceId" + } + ] + }'] + /> + + <@lib.response + code = "400" + dto = "ExceptionDto" + desc = "Returned if some of the query parameters are invalid, for example if a `sortOrder` + parameter is supplied, but no `sortBy`. See the + [Introduction](${docsUrl}/reference/rest/overview/#error-handling) + for the error response format." + last = true + /> + + } + +} + \ No newline at end of file diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/{id}/error-details/get.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/{id}/error-details/get.ftl new file mode 100644 index 00000000000..83c5ef865b3 --- /dev/null +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/{id}/error-details/get.ftl @@ -0,0 +1,54 @@ +<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/external-task-log/get-external-task-log-error-details/index.html --> +<#macro endpoint_macro docsUrl=""> +{ + <@lib.endpointInfo + id = "getErrorDetailsHistoricExternalTaskLog" + tag = "Historic External Task Log" + summary = "Get External Task Log Error Details" + desc = "Retrieves the corresponding error details of the passed historic external task log + by id." + /> + + "parameters" : [ + + <@lib.parameter + name = "id" + location = "path" + type = "string" + required = true + desc = "The id of the historic external task log to get the error details for." + last = true + /> + + ], + + "responses": { + + <@lib.response + code = "200" + mediaType= "text/plain" + desc = "Request successful." + examples = ['"example-1": { + "summary": "GET `history/external-task-log/someId/error-details`", + "description": "GET `history/external-task-log/someId/error-details`", + "value": "java.lang.RuntimeException: A exception message! + at org.camunda.bpm.pa.service.FailingDelegate.execute(FailingDelegate.java:10) + at org.camunda.bpm.engine.impl.delegate.JavaDelegateInvocation.invoke(JavaDelegateInvocation.java:34) + at org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37) + ..." + }'] + /> + + <@lib.response + code = "404" + dto = "ExceptionDto" + desc = "Historic external task log with given id does not exist. See the + [Introduction](${docsUrl}/reference/rest/overview/#error-handling) + for the error response format." + last = true + /> + + } + +} + \ No newline at end of file diff --git a/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/{id}/get.ftl b/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/{id}/get.ftl new file mode 100644 index 00000000000..3cb2df18f44 --- /dev/null +++ b/engine-rest/engine-rest-openapi/src/main/templates/paths/history/external-task-log/{id}/get.ftl @@ -0,0 +1,71 @@ +<#-- Generated From File: camunda-docs-manual/public/reference/rest/history/external-task-log/get-external-task-log/index.html --> +<#macro endpoint_macro docsUrl=""> +{ + <@lib.endpointInfo + id = "getHistoricExternalTaskLog" + tag = "Historic External Task Log" + summary = "Get External Task Log" + desc = "Retrieves a historic external task log by id." + /> + + "parameters" : [ + + <@lib.parameter + name = "id" + location = "path" + type = "string" + required = true + desc = "The id of the log entry." + last = true + /> + + ], + + "responses": { + + <@lib.response + code = "200" + dto = "HistoricExternalTaskLogDto" + desc = "Request successful." + examples = ['"example-1": { + "summary": "Status 200.", + "description": "GET `/history/external-task-log/someId`", + "value": { + "id": "someId", + "timestamp": "2017-01-15T15:22:20.000+0200", + "externalTaskId": "anExternalTaskId", + "topicName": "aTopicName", + "workerId": "aWorkerId", + "retries": 3, + "priority": 5, + "errorMessage": "An error occured!", + "activityId": "externalServiceTask", + "activityInstanceId": "externalServiceTask:15", + "executionId": "anExecutionId", + "processInstanceId": "aProcessInstanceId", + "processDefinitionId": "aProcessDefinitionId", + "processDefinitionKey": "aProcessDefinitionKey", + "tenantId": null, + "creationLog": false, + "failureLog": true, + "successLog": false, + "deletionLog": false, + "removalTime": "2018-02-10T14:33:19.000+0200", + "rootProcessInstanceId": "aRootProcessInstanceId" + } + }'] + /> + + <@lib.response + code = "404" + dto = "ExceptionDto" + desc = "Historic external task log with given id does not exist. See the + [Introduction](${docsUrl}/reference/rest/overview/#error-handling) + for the error response format." + last = true + /> + + } + +} + \ No newline at end of file