- 1. 简介
- 2. 开始
- 3. 配置
- 4. Flowable API
- 5. 集成 Spring
- 6. 部署
- 7. BPMN 2.0 介绍
- 8. BPMN 2.0 结构
- 9. 表单
- 10. JPA
- 11. 历史
- 12. 身份管理
- 13. Eclipse Designer
- 14. Flowable UI 应用
- 15. REST API
- 16. 集成 CDI
- 17. 集成 LDAP
- 18. 高级
- 19. 工具
15.7. Tasks
15.7.1. Get a task
GET runtime/tasks/{taskId}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to get. |
Response code | Description |
---|---|
200 | Indicates the task was found and returned. |
404 | Indicates the requested task was not found. |
Success response body:
{
"assignee" : "kermit",
"createTime" : "2013-04-17T10:17:43.902+0000",
"delegationState" : "pending",
"description" : "Task description",
"dueDate" : "2013-04-17T10:17:43.902+0000",
"execution" : "http://localhost:8182/runtime/executions/5",
"id" : "8",
"name" : "My task",
"owner" : "owner",
"parentTask" : "http://localhost:8182/runtime/tasks/9",
"priority" : 50,
"processDefinition" : "http://localhost:8182/repository/process-definitions/oneTaskProcess%3A1%3A4",
"processInstance" : "http://localhost:8182/runtime/process-instances/5",
"suspended" : false,
"taskDefinitionKey" : "theTask",
"url" : "http://localhost:8182/runtime/tasks/8",
"tenantId" : null
}
delegationState
: Delegation-state of the task, can benull
,"pending"
or"resolved".
15.7.2. List of tasks
GET runtime/tasks
Parameter | Required | Value | Description |
---|---|---|---|
name | No | String | Only return tasks with the given name. |
nameLike | No | String | Only return tasks with a name like the given name. |
description | No | String | Only return tasks with the given description. |
priority | No | Integer | Only return tasks with the given priority. |
minimumPriority | No | Integer | Only return tasks with a priority greater than the given value. |
maximumPriority | No | Integer | Only return tasks with a priority lower than the given value. |
assignee | No | String | Only return tasks assigned to the given user. |
assigneeLike | No | String | Only return tasks assigned with an assignee like the given value. |
owner | No | String | Only return tasks owned by the given user. |
ownerLike | No | String | Only return tasks assigned with an owner like the given value. |
unassigned | No | Boolean | Only return tasks that are not assigned to anyone. If false is passed, the value is ignored. |
delegationState | No | String | Only return tasks that have the given delegation state. Possible values are pending and resolved . |
candidateUser | No | String | Only return tasks that can be claimed by the given user. This includes both tasks where the user is an explicit candidate for and task that are claimable by a group that the user is a member of. |
candidateGroup | No | String | Only return tasks that can be claimed by a user in the given group. |
candidateGroups | No | String | Only return tasks that can be claimed by a user in the given groups. Values split by comma. |
involvedUser | No | String | Only return tasks in which the given user is involved. |
taskDefinitionKey | No | String | Only return tasks with the given task definition id. |
taskDefinitionKeyLike | No | String | Only return tasks with a given task definition id like the given value. |
processInstanceId | No | String | Only return tasks which are part of the process instance with the given id. |
processInstanceBusinessKey | No | String | Only return tasks which are part of the process instance with the given business key. |
processInstanceBusinessKeyLike | No | String | Only return tasks which are part of the process instance which has a business key like the given value. |
processDefinitionId | No | String | Only return tasks which are part of a process instance which has a process definition with the given id. |
processDefinitionKey | No | String | Only return tasks which are part of a process instance which has a process definition with the given key. |
processDefinitionKeyLike | No | String | Only return tasks which are part of a process instance which has a process definition with a key like the given value. |
processDefinitionName | No | String | Only return tasks which are part of a process instance which has a process definition with the given name. |
processDefinitionNameLike | No | String | Only return tasks which are part of a process instance which has a process definition with a name like the given value. |
executionId | No | String | Only return tasks which are part of the execution with the given id. |
createdOn | No | ISO Date | Only return tasks which are created on the given date. |
createdBefore | No | ISO Date | Only return tasks which are created before the given date. |
createdAfter | No | ISO Date | Only return tasks which are created after the given date. |
dueOn | No | ISO Date | Only return tasks which are due on the given date. |
dueBefore | No | ISO Date | Only return tasks which are due before the given date. |
dueAfter | No | ISO Date | Only return tasks which are due after the given date. |
withoutDueDate | No | boolean | Only return tasks which don’t have a due date. The property is ignored if the value is false . |
excludeSubTasks | No | Boolean | Only return tasks that are not a subtask of another task. |
active | No | Boolean | If true , only return tasks that are not suspended (either part of a process that is not suspended or not part of a process at all). If false, only tasks that are part of suspended process instances are returned. |
includeTaskLocalVariables | No | Boolean | Indication to include task local variables in the result. |
includeProcessVariables | No | Boolean | Indication to include process variables in the result. |
tenantId | No | String | Only return tasks with the given tenantId. |
tenantIdLike | No | String | Only return tasks with a tenantId like the given value. |
withoutTenantId | No | Boolean | If true , only returns tasks without a tenantId set. If false , the withoutTenantId parameter is ignored. |
candidateOrAssigned | No | String | Select tasks that has been claimed or assigned to user or waiting to claim by user (candidate user or groups). |
category | No | string | Select tasks with the given category. Note that this is the task category, not the category of the process definition (namespace within the BPMN Xml). |
Response code | Description |
---|---|
200 | Indicates request was successful and the tasks are returned |
400 | Indicates a parameter was passed in the wrong format or that delegationState has an invalid value (other than pending and resolved). The status-message contains additional information. |
Success response body:
{
"data": [
{
"assignee" : "kermit",
"createTime" : "2013-04-17T10:17:43.902+0000",
"delegationState" : "pending",
"description" : "Task description",
"dueDate" : "2013-04-17T10:17:43.902+0000",
"execution" : "http://localhost:8182/runtime/executions/5",
"id" : "8",
"name" : "My task",
"owner" : "owner",
"parentTask" : "http://localhost:8182/runtime/tasks/9",
"priority" : 50,
"processDefinition" : "http://localhost:8182/repository/process-definitions/oneTaskProcess%3A1%3A4",
"processInstance" : "http://localhost:8182/runtime/process-instances/5",
"suspended" : false,
"taskDefinitionKey" : "theTask",
"url" : "http://localhost:8182/runtime/tasks/8",
"tenantId" : null
}
],
"total": 1,
"start": 0,
"sort": "name",
"order": "asc",
"size": 1
}
15.7.3. Query for tasks
POST query/tasks
Request body:
{
"name" : "My task",
"description" : "The task description",
...
"taskVariables" : [
{
"name" : "myVariable",
"value" : 1234,
"operation" : "equals",
"type" : "long"
}
],
"processInstanceVariables" : [
{
...
}
]
]
}
All supported JSON parameter fields allowed are exactly the same as the parameters found for getting a collection of tasks (except for candidateGroupIn which is only available in this POST task query REST service), but passed in as JSON-body arguments rather than URL-parameters to allow for more advanced querying and preventing errors with request-uri’s that are too long. On top of that, the query allows for filtering based on task and process variables. The taskVariables
and processInstanceVariables
are both JSON-arrays containing objects with the format as described here.
Response code | Description |
---|---|
200 | Indicates request was successful and the tasks are returned |
400 | Indicates a parameter was passed in the wrong format or that delegationState has an invalid value (other than pending and resolved). The status-message contains additional information. |
Success response body:
{
"data": [
{
"assignee" : "kermit",
"createTime" : "2013-04-17T10:17:43.902+0000",
"delegationState" : "pending",
"description" : "Task description",
"dueDate" : "2013-04-17T10:17:43.902+0000",
"execution" : "http://localhost:8182/runtime/executions/5",
"id" : "8",
"name" : "My task",
"owner" : "owner",
"parentTask" : "http://localhost:8182/runtime/tasks/9",
"priority" : 50,
"processDefinition" : "http://localhost:8182/repository/process-definitions/oneTaskProcess%3A1%3A4",
"processInstance" : "http://localhost:8182/runtime/process-instances/5",
"suspended" : false,
"taskDefinitionKey" : "theTask",
"url" : "http://localhost:8182/runtime/tasks/8",
"tenantId" : null
}
],
"total": 1,
"start": 0,
"sort": "name",
"order": "asc",
"size": 1
}
15.7.4. Update a task
PUT runtime/tasks/{taskId}
Body JSON:
{
"assignee" : "assignee",
"delegationState" : "resolved",
"description" : "New task description",
"dueDate" : "2013-04-17T13:06:02.438+02:00",
"name" : "New task name",
"owner" : "owner",
"parentTaskId" : "3",
"priority" : 20
}
All request values are optional. For example, you can only include the assignee attribute in the request body JSON-object, only updating the assignee of the task, leaving all other fields unaffected. When an attribute is explicitly included and is set to null, the task-value will be updated to null. Example: {"dueDate" : null}
will clear the duedate of the task).
Response code | Description |
---|---|
200 | Indicates the task was updated. |
404 | Indicates the requested task was not found. |
409 | Indicates the requested task was updated simultaneously. |
Success response body: see response for runtime/tasks/{taskId}
.
15.7.5. Task actions
POST runtime/tasks/{taskId}
Complete a task - Body JSON:
{
"action" : "complete",
"variables" : []
}
Completes the task. Optional variable array can be passed in using the variables
property. More information about the variable format can be found in the REST variables section. Note that the variable-scope that is supplied is ignored and the variables are set on the parent-scope unless a variable exists in a local scope, which is overridden in this case. This is the same behavior as the TaskService.completeTask(taskId, variables)
invocation.
Note that also a transientVariables property is accepted as part of this json, that follows the same structure as the variables property.
Claim a task - Body JSON:
{
"action" : "claim",
"assignee" : "userWhoClaims"
}
Claims the task by the given assignee. If the assignee is null
, the task is assigned to no-one, claimable again.
Delegate a task - Body JSON:
{
"action" : "delegate",
"assignee" : "userToDelegateTo"
}
Delegates the task to the given assignee. The assignee is required.
Resolve a task - Body JSON:
{
"action" : "resolve"
}
Resolves the task delegation. The task is assigned back to the task owner (if any).
Response code | Description |
---|---|
200 | Indicates the action was executed. |
400 | When the body contains an invalid value or when the assignee is missing when the action requires it. |
404 | Indicates the requested task was not found. |
409 | Indicates the action cannot be performed due to a conflict. Either the task was updates simultaneously or the task was claimed by another user, in case of the claim action. |
Success response body: see response for runtime/tasks/{taskId}
.
15.7.6. Delete a task
DELETE runtime/tasks/{taskId}?cascadeHistory={cascadeHistory}&deleteReason={deleteReason}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to delete. |
cascadeHistory | False | Boolean | Whether or not to delete the HistoricTask instance when deleting the task (if applicable). If not provided, this value defaults to false. |
deleteReason | False | String | Reason why the task is deleted. This value is ignored when cascadeHistory is true. |
Response code | Description |
---|---|
204 | Indicates the task was found and has been deleted. Response-body is intentionally empty. |
403 | Indicates the requested task cannot be deleted because it’s part of a workflow. |
404 | Indicates the requested task was not found. |
15.7.7. Get all variables for a task
GET runtime/tasks/{taskId}/variables?scope={scope}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to get variables for. |
scope | False | String | Scope of variables to be returned. When local , only task-local variables are returned. When global , only variables from the task’s parent execution-hierarchy are returned. When the parameter is omitted, both local and global variables are returned. |
Response code | Description |
---|---|
200 | Indicates the task was found and the requested variables are returned. |
404 | Indicates the requested task was not found. |
Success response body:
[
{
"name" : "doubleTaskVar",
"scope" : "local",
"type" : "double",
"value" : 99.99
},
{
"name" : "stringProcVar",
"scope" : "global",
"type" : "string",
"value" : "This is a ProcVariable"
}
]
The variables are returned as a JSON array. Full response description can be found in the general REST-variables section.
15.7.8. Get a variable from a task
GET runtime/tasks/{taskId}/variables/{variableName}?scope={scope}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to get a variable for. |
variableName | Yes | String | The name of the variable to get. |
scope | False | String | Scope of variable to be returned. When local , only task-local variable value is returned. When global , only variable value from the task’s parent execution-hierarchy are returned. When the parameter is omitted, a local variable will be returned if it exists, otherwise a global variable. |
Response code | Description |
---|---|
200 | Indicates the task was found and the requested variables are returned. |
404 | Indicates the requested task was not found or the task doesn’t have a variable with the given name (in the given scope). Status message provides additional information. |
Success response body:
{
"name" : "myTaskVariable",
"scope" : "local",
"type" : "string",
"value" : "Hello my friend"
}
Full response body description can be found in the general REST-variables section.
15.7.9. Get the binary data for a variable
GET runtime/tasks/{taskId}/variables/{variableName}/data?scope={scope}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to get a variable data for. |
variableName | Yes | String | The name of the variable to get data for. Only variables of type binary and serializable can be used. If any other type of variable is used, a 404 is returned. |
scope | False | String | Scope of variable to be returned. When local , only task-local variable value is returned. When global , only variable value from the task’s parent execution-hierarchy are returned. When the parameter is omitted, a local variable will be returned if it exists, otherwise a global variable. |
Response code | Description |
---|---|
200 | Indicates the task was found and the requested variables are returned. |
404 | Indicates the requested task was not found or the task doesn’t have a variable with the given name (in the given scope) or the variable doesn’t have a binary stream available. Status message provides additional information. |
Success response body:
The response body contains the binary value of the variable. When the variable is of type binary
, the content-type of the response is set to application/octet-stream
, regardless of the content of the variable or the request accept-type header. In case of serializable
, application/x-java-serialized-object
is used as content-type.
15.7.10. Create new variables on a task
POST runtime/tasks/{taskId}/variables
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to create the new variable for. |
Request body for creating simple (non-binary) variables:
[
{
"name" : "myTaskVariable",
"scope" : "local",
"type" : "string",
"value" : "Hello my friend"
},
{
}
]
The request body should be an array containing one or more JSON-objects representing the variables that should be created.
name
: Required name of the variablescope
: Scope of variable that is created. If omitted,local
is assumed.type
: Type of variable that is created. If omitted, reverts to raw JSON-value type (string, boolean, integer or double).value
: Variable value.
More information about the variable format can be found in the REST variables section.
Success response body:
[
{
"name" : "myTaskVariable",
"scope" : "local",
"type" : "string",
"value" : "Hello my friend"
},
{
}
]
Response code | Description |
---|---|
201 | Indicates the variables were created and the result is returned. |
400 | Indicates the name of a variable to create was missing or that an attempt is done to create a variable on a standalone task (without a process associated) with scope global or an empty array of variables was included in the request or request did not contain an array of variables. Status message provides additional information. |
404 | Indicates the requested task was not found. |
409 | Indicates the task already has a variable with the given name. Use the PUT method to update the task variable instead. |
15.7.11. Create a new binary variable on a task
POST runtime/tasks/{taskId}/variables
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to create the new variable for. |
Request body:
The request should be of type multipart/form-data
. There should be a single file-part included with the binary value of the variable. On top of that, the following additional form-fields can be present:
name
: Required name of the variable.scope
: Scope of variable that is created. If omitted,local
is assumed.type
: Type of variable that is created. If omitted,binary
is assumed and the binary data in the request will be stored as an array of bytes.
Success response body:
{
"name" : "binaryVariable",
"scope" : "local",
"type" : "binary",
"value" : null,
"valueUrl" : "http://.../runtime/tasks/123/variables/binaryVariable/data"
}
Response code | Description |
---|---|
201 | Indicates the variable was created and the result is returned. |
400 | Indicates the name of the variable to create was missing or that an attempt is done to create a variable on a standalone task (without a process associated) with scope global . Status message provides additional information. |
404 | Indicates the requested task was not found. |
409 | Indicates the task already has a variable with the given name. Use the PUT method to update the task variable instead. |
415 | Indicates the serializable data contains an object for which no class is present in the JVM running the Flowable engine and therefore cannot be deserialized. |
15.7.12. Update an existing variable on a task
PUT runtime/tasks/{taskId}/variables/{variableName}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to update the variable for. |
variableName | Yes | String | The name of the variable to update. |
Request body for updating simple (non-binary) variables:
{
"name" : "myTaskVariable",
"scope" : "local",
"type" : "string",
"value" : "Hello my friend"
}
name
: Required name of the variablescope
: Scope of variable that is updated. If omitted,local
is assumed.type
: Type of variable that is updated. If omitted, reverts to raw JSON-value type (string, boolean, integer or double).value
: Variable value.
More information about the variable format can be found in the REST variables section.
Success response body:
{
"name" : "myTaskVariable",
"scope" : "local",
"type" : "string",
"value" : "Hello my friend"
}
Response code | Description |
---|---|
200 | Indicates the variables was updated and the result is returned. |
400 | Indicates the name of a variable to update was missing or that an attempt is done to update a variable on a standalone task (without a process associated) with scope global . Status message provides additional information. |
404 | Indicates the requested task was not found or the task doesn’t have a variable with the given name in the given scope. Status message contains additional information about the error. |
15.7.13. Updating a binary variable on a task
PUT runtime/tasks/{taskId}/variables/{variableName}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to update the variable for. |
variableName | Yes | String | The name of the variable to update. |
Request body:
The request should be of type multipart/form-data
. There should be a single file-part included with the binary value of the variable. On top of that, the following additional form-fields can be present:
name
: Required name of the variable.scope
: Scope of variable that is updated. If omitted,local
is assumed.type
: Type of variable that is updated. If omitted,binary
is assumed and the binary data in the request will be stored as an array of bytes.
Success response body:
{
"name" : "binaryVariable",
"scope" : "local",
"type" : "binary",
"value" : null,
"valueUrl" : "http://.../runtime/tasks/123/variables/binaryVariable/data"
}
Response code | Description |
---|---|
200 | Indicates the variable was updated and the result is returned. |
400 | Indicates the name of the variable to update was missing or that an attempt is done to update a variable on a standalone task (without a process associated) with scope global . Status message provides additional information. |
404 | Indicates the requested task was not found or the variable to update doesn’t exist for the given task in the given scope. |
415 | Indicates the serializable data contains an object for which no class is present in the JVM running the Flowable engine and therefore cannot be deserialized. |
15.7.14. Delete a variable on a task
DELETE runtime/tasks/{taskId}/variables/{variableName}?scope={scope}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task the variable to delete belongs to. |
variableName | Yes | String | The name of the variable to delete. |
scope | No | String | Scope of variable to delete in. Can be either local or global . If omitted, local is assumed. |
Response code | Description |
---|---|
204 | Indicates the task variable was found and has been deleted. Response-body is intentionally empty. |
404 | Indicates the requested task was not found or the task doesn’t have a variable with the given name. Status message contains additional information about the error. |
15.7.15. Delete all local variables on a task
DELETE runtime/tasks/{taskId}/variables
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task the variable to delete belongs to. |
Response code | Description |
---|---|
204 | Indicates all local task variables have been deleted. Response-body is intentionally empty. |
404 | Indicates the requested task was not found. |
15.7.16. Get all identity links for a task
GET runtime/tasks/{taskId}/identitylinks
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to get the identity links for. |
Response code | Description |
---|---|
200 | Indicates the task was found and the requested identity links are returned. |
404 | Indicates the requested task was not found. |
Success response body:
[
{
"userId" : "kermit",
"groupId" : null,
"type" : "candidate",
"url" : "http://localhost:8081/flowable-rest/service/runtime/tasks/100/identitylinks/users/kermit/candidate"
},
{
"userId" : null,
"groupId" : "sales",
"type" : "candidate",
"url" : "http://localhost:8081/flowable-rest/service/runtime/tasks/100/identitylinks/groups/sales/candidate"
},
...
]
15.7.17. Get all identitylinks for a task for either groups or users
GET runtime/tasks/{taskId}/identitylinks/users GET runtime/tasks/{taskId}/identitylinks/groups
Returns only identity links targeting either users or groups. Response body and status-codes are exactly the same as when getting the full list of identity links for a task.
15.7.18. Get a single identity link on a task
GET runtime/tasks/{taskId}/identitylinks/{family}/{identityId}/{type}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task . |
family | Yes | String | Either groups or users , depending on what kind of identity is targeted. |
identityId | Yes | String | The id of the identity. |
type | Yes | String | The type of identity link. |
Response code | Description |
---|---|
200 | Indicates the task and identity link was found and returned. |
404 | Indicates the requested task was not found or the task doesn’t have the requested identityLink. The status contains additional information about this error. |
Success response body:
{
"userId" : null,
"groupId" : "sales",
"type" : "candidate",
"url" : "http://localhost:8081/flowable-rest/service/runtime/tasks/100/identitylinks/groups/sales/candidate"
}
15.7.19. Create an identity link on a task
POST runtime/tasks/{taskId}/identitylinks
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task . |
Request body (user):
{
"userId" : "kermit",
"type" : "candidate",
}
Request body (group):
{
"groupId" : "sales",
"type" : "candidate",
}
Response code | Description |
---|---|
201 | Indicates the task was found and the identity link was created. |
404 | Indicates the requested task was not found or the task doesn’t have the requested identityLink. The status contains additional information about this error. |
Success response body:
{
"userId" : null,
"groupId" : "sales",
"type" : "candidate",
"url" : "http://localhost:8081/flowable-rest/service/runtime/tasks/100/identitylinks/groups/sales/candidate"
}
15.7.20. Delete an identity link on a task
DELETE runtime/tasks/{taskId}/identitylinks/{family}/{identityId}/{type}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task. |
family | Yes | String | Either groups or users , depending on what kind of identity is targeted. |
identityId | Yes | String | The id of the identity. |
type | Yes | String | The type of identity link. |
Response code | Description |
---|---|
204 | Indicates the task and identity link were found and the link has been deleted. Response-body is intentionally empty. |
404 | Indicates the requested task was not found or the task doesn’t have the requested identityLink. The status contains additional information about this error. |
15.7.21. Create a new comment on a task
POST runtime/tasks/{taskId}/comments
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to create the comment for. |
Request body:
{
"message" : "This is a comment on the task.",
"saveProcessInstanceId" : true
}
Parameter saveProcessInstanceId
is optional, if true
save process instance id of task with comment.
Success response body:
{
"id" : "123",
"taskUrl" : "http://localhost:8081/flowable-rest/service/runtime/tasks/101/comments/123",
"processInstanceUrl" : "http://localhost:8081/flowable-rest/service/history/historic-process-instances/100/comments/123",
"message" : "This is a comment on the task.",
"author" : "kermit",
"time" : "2014-07-13T13:13:52.232+08:00"
"taskId" : "101",
"processInstanceId" : "100"
}
Response code | Description |
---|---|
201 | Indicates the comment was created and the result is returned. |
400 | Indicates the comment is missing from the request. |
404 | Indicates the requested task was not found. |
15.7.22. Get all comments on a task
GET runtime/tasks/{taskId}/comments
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to get the comments for. |
Success response body:
[
{
"id" : "123",
"taskUrl" : "http://localhost:8081/flowable-rest/service/runtime/tasks/101/comments/123",
"processInstanceUrl" : "http://localhost:8081/flowable-rest/service/history/historic-process-instances/100/comments/123",
"message" : "This is a comment on the task.",
"author" : "kermit"
"time" : "2014-07-13T13:13:52.232+08:00"
"taskId" : "101",
"processInstanceId" : "100"
},
{
"id" : "456",
"taskUrl" : "http://localhost:8081/flowable-rest/service/runtime/tasks/101/comments/456",
"processInstanceUrl" : "http://localhost:8081/flowable-rest/service/history/historic-process-instances/100/comments/456",
"message" : "This is another comment on the task.",
"author" : "gonzo",
"time" : "2014-07-13T13:13:52.232+08:00"
"taskId" : "101",
"processInstanceId" : "100"
}
]
Response code | Description |
---|---|
200 | Indicates the task was found and the comments are returned. |
404 | Indicates the requested task was not found. |
15.7.23. Get a comment on a task
GET runtime/tasks/{taskId}/comments/{commentId}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to get the comment for. |
commentId | Yes | String | The id of the comment. |
Success response body:
{
"id" : "123",
"taskUrl" : "http://localhost:8081/flowable-rest/service/runtime/tasks/101/comments/123",
"processInstanceUrl" : "http://localhost:8081/flowable-rest/service/history/historic-process-instances/100/comments/123",
"message" : "This is a comment on the task.",
"author" : "kermit",
"time" : "2014-07-13T13:13:52.232+08:00"
"taskId" : "101",
"processInstanceId" : "100"
}
Response code | Description |
---|---|
200 | Indicates the task and comment were found and the comment is returned. |
404 | Indicates the requested task was not found or the tasks doesn’t have a comment with the given ID. |
15.7.24. Delete a comment on a task
DELETE runtime/tasks/{taskId}/comments/{commentId}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to delete the comment for. |
commentId | Yes | String | The id of the comment. |
Response code | Description |
---|---|
204 | Indicates the task and comment were found and the comment is deleted. Response body is left empty intentionally. |
404 | Indicates the requested task was not found or the tasks doesn’t have a comment with the given ID. |
15.7.25. Get all events for a task
GET runtime/tasks/{taskId}/events
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to get the events for. |
Success response body:
[
{
"action" : "AddUserLink",
"id" : "4",
"message" : [ "gonzo", "contributor" ],
"taskUrl" : "http://localhost:8182/runtime/tasks/2",
"time" : "2013-05-17T11:50:50.000+0000",
"url" : "http://localhost:8182/runtime/tasks/2/events/4",
"userId" : null
}
]
Response code | Description |
---|---|
200 | Indicates the task was found and the events are returned. |
404 | Indicates the requested task was not found. |
15.7.26. Get an event on a task
GET runtime/tasks/{taskId}/events/{eventId}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to get the event for. |
eventId | Yes | String | The id of the event. |
Success response body:
{
"action" : "AddUserLink",
"id" : "4",
"message" : [ "gonzo", "contributor" ],
"taskUrl" : "http://localhost:8182/runtime/tasks/2",
"time" : "2013-05-17T11:50:50.000+0000",
"url" : "http://localhost:8182/runtime/tasks/2/events/4",
"userId" : null
}
Response code | Description |
---|---|
200 | Indicates the task and event were found and the event is returned. |
404 | Indicates the requested task was not found or the tasks doesn’t have an event with the given ID. |
15.7.27. Create a new attachment on a task, containing a link to an external resource
POST runtime/tasks/{taskId}/attachments
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to create the attachment for. |
Request body:
{
"name":"Simple attachment",
"description":"Simple attachment description",
"type":"simpleType",
"externalUrl":"http://flowable.org"
}
Only the attachment name is required to create a new attachment.
Success response body:
{
"id":"3",
"url":"http://localhost:8182/runtime/tasks/2/attachments/3",
"name":"Simple attachment",
"description":"Simple attachment description",
"type":"simpleType",
"taskUrl":"http://localhost:8182/runtime/tasks/2",
"processInstanceUrl":null,
"externalUrl":"http://flowable.org",
"contentUrl":null
}
Response code | Description |
---|---|
201 | Indicates the attachment was created and the result is returned. |
400 | Indicates the attachment name is missing from the request. |
404 | Indicates the requested task was not found. |
15.7.28. Create a new attachment on a task, with an attached file
POST runtime/tasks/{taskId}/attachments
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to create the attachment for. |
Request body:
The request should be of type multipart/form-data
. There should be a single file-part included with the binary value of the variable. On top of that, the following additional form-fields can be present:
name
: Required name of the variable.description
: Description of the attachment, optional.type
: Type of attachment, optional. Supports any arbitrary string or a valid HTTP content-type.
Success response body:
{
"id":"5",
"url":"http://localhost:8182/runtime/tasks/2/attachments/5",
"name":"Binary attachment",
"description":"Binary attachment description",
"type":"binaryType",
"taskUrl":"http://localhost:8182/runtime/tasks/2",
"processInstanceUrl":null,
"externalUrl":null,
"contentUrl":"http://localhost:8182/runtime/tasks/2/attachments/5/content"
}
Response code | Description |
---|---|
201 | Indicates the attachment was created and the result is returned. |
400 | Indicates the attachment name is missing from the request or no file was present in the request. The error-message contains additional information. |
404 | Indicates the requested task was not found. |
15.7.29. Get all attachments on a task
GET runtime/tasks/{taskId}/attachments
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to get the attachments for. |
Success response body:
[
{
"id":"3",
"url":"http://localhost:8182/runtime/tasks/2/attachments/3",
"name":"Simple attachment",
"description":"Simple attachment description",
"type":"simpleType",
"taskUrl":"http://localhost:8182/runtime/tasks/2",
"processInstanceUrl":null,
"externalUrl":"http://flowable.org",
"contentUrl":null
},
{
"id":"5",
"url":"http://localhost:8182/runtime/tasks/2/attachments/5",
"name":"Binary attachment",
"description":"Binary attachment description",
"type":"binaryType",
"taskUrl":"http://localhost:8182/runtime/tasks/2",
"processInstanceUrl":null,
"externalUrl":null,
"contentUrl":"http://localhost:8182/runtime/tasks/2/attachments/5/content"
}
]
Response code | Description |
---|---|
200 | Indicates the task was found and the attachments are returned. |
404 | Indicates the requested task was not found. |
15.7.30. Get an attachment on a task
GET runtime/tasks/{taskId}/attachments/{attachmentId}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to get the attachment for. |
attachmentId | Yes | String | The id of the attachment. |
Success response body:
{
"id":"5",
"url":"http://localhost:8182/runtime/tasks/2/attachments/5",
"name":"Binary attachment",
"description":"Binary attachment description",
"type":"binaryType",
"taskUrl":"http://localhost:8182/runtime/tasks/2",
"processInstanceUrl":null,
"externalUrl":null,
"contentUrl":"http://localhost:8182/runtime/tasks/2/attachments/5/content"
}
externalUrl - contentUrl:
In case the attachment is a link to an external resource, theexternalUrl
contains the URL to the external content. If the attachment content is present in the Flowable engine, thecontentUrl
will contain an URL where the binary content can be streamed from.type:
Can be any arbitrary value. When a valid formatted media-type (e.g. application/xml, text/plain) is included, the binary content HTTP response content-type will be set the the given value.
Response code | Description |
---|---|
200 | Indicates the task and attachment were found and the attachment is returned. |
404 | Indicates the requested task was not found or the tasks doesn’t have a attachment with the given ID. |
15.7.31. Get the content for an attachment
GET runtime/tasks/{taskId}/attachment/{attachmentId}/content
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to get a variable data for. |
attachmentId | Yes | String | The id of the attachment, a 404 is returned when the attachment points to an external URL rather than content attached in Flowable. |
Response code | Description |
---|---|
200 | Indicates the task and attachment was found and the requested content is returned. |
404 | Indicates the requested task was not found or the task doesn’t have an attachment with the given id or the attachment doesn’t have a binary stream available. Status message provides additional information. |
Success response body:
The response body contains the binary content. By default, the content-type of the response is set to application/octet-stream
unless the attachment type contains a valid Content-type.
15.7.32. Delete an attachment on a task
DELETE runtime/tasks/{taskId}/attachments/{attachmentId}
Parameter | Required | Value | Description |
---|---|---|---|
taskId | Yes | String | The id of the task to delete the attachment for. |
attachmentId | Yes | String | The id of the attachment. |
Response code | Description |
---|---|
204 | Indicates the task and attachment were found and the attachment is deleted. Response body is left empty intentionally. |
404 | Indicates the requested task was not found or the tasks doesn’t have a attachment with the given ID. |
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论