-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Description
This endpoint documentation seems incoherent :
"Nonexistent variables are created on the process-instance and existing ones are overridden without any error."
But error 404:
"Indicates the requested process instance was not found or the process instance does not have a variable with the given name. Status description contains additional information about the error."
So what is the exepected behavior if the variable doesn't exists yet: sucess or 404?
Actual test with a PUT gives me a 404
{
"message": "Not found",
"exception": "Execution 'ee2a8b4d-6e06-11f0-ac9e-0250f2b11700' does not have a variable with name: 'TOTO'."
}
@ApiOperation(value = "Update a single variable on a process instance", tags = { "Process Instance Variables" }, nickname = "updateProcessInstanceVariable",
notes = "This endpoint can be used in 2 ways: By passing a JSON Body (RestVariable) or by passing a multipart/form-data Object.\n"
+ "Nonexistent variables are created on the process-instance and existing ones are overridden without any error.\n"
+ "Note that scope is ignored, only local variables can be set in a process instance.\n"
+ "NB: Swagger V2 specification does not support this use case that is why this endpoint might be buggy/incomplete if used with other tools.")
@ApiImplicitParams({
@ApiImplicitParam(name = "body", type = "org.flowable.rest.service.api.engine.variable.RestVariable", value = "Create a variable on a process instance", paramType = "body", example = "{\n" +
" \"name\":\"intProcVar\"\n" +
" \"type\":\"integer\"\n" +
" \"value\":123,\n" +
" }"),
@ApiImplicitParam(name = "file", dataType = "file", paramType = "form"),
@ApiImplicitParam(name = "name", dataType = "string", paramType = "form", example = "Simple content item"),
@ApiImplicitParam(name = "type", dataType = "string", paramType = "form", example = "integer"),
})
@ApiResponses(value = {
@ApiResponse(code = 201, message = "Indicates both the process instance and variable were found and variable is updated."),
@ApiResponse(code = 404, message = "Indicates the requested process instance was not found or the process instance does not have a variable with the given name. Status description contains additional information about the error.")
})
@PutMapping(value = "/runtime/process-instances/{processInstanceId}/variables/{variableName}", produces = "application/json", consumes = {"application/json", "multipart/form-data"})
public RestVariable updateVariable(@ApiParam(name = "processInstanceId") @PathVariable("processInstanceId") String processInstanceId, @ApiParam(name = "variableName") @PathVariable("variableName") String variableName,
Metadata
Metadata
Assignees
Labels
No labels