curl --request PUT \
--url http://{host}:{port}/{contextPath}/task/{id}/variables/{varName} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "someValue",
"type": "String"
}
'{
"type": "<string>",
"message": "<string>",
"code": 123
}{
"type": "<string>",
"message": "<string>",
"code": 123
}任务变量
更新任务变量
Updates a process variable that is visible from the Task scope. A variable is visible from the task if it is a local task variable, or declared in a parent scope of the task. See the documentation on variable scopes and visibility.
Note: If a variable doesn’t exist, the variable is created in the top-most scope visible from the task.
PUT
/
task
/
{id}
/
variables
/
{varName}
curl --request PUT \
--url http://{host}:{port}/{contextPath}/task/{id}/variables/{varName} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "someValue",
"type": "String"
}
'{
"type": "<string>",
"message": "<string>",
"code": 123
}{
"type": "<string>",
"message": "<string>",
"code": 123
}Authorizations
Path Parameters
Body
application/json
A JSON object containing additional, value-type-dependent properties. For serialized variables of type Object, the following properties can be provided:
objectTypeName: A string representation of the object's type name.serializationDataFormat: The serialization format used to store the variable.
For serialized variables of type File, the following properties can be provided:
filename: The name of the file. This is not the variable name but the name that will be used when downloading the file again.mimetype: The MIME type of the file that is being uploaded.encoding: The encoding of the file that is being uploaded.
The following property can be provided for all value types:
transient: Indicates whether the variable should be transient or not. See documentation for more informations. (Not applicable fordecision-definition,/process-instance/variables-async, and/migration/executeAsyncendpoints)
Response
Request successful.