Skip to content

Commit

Permalink
documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
WelschChristopher authored and filiphr committed Aug 28, 2024
1 parent 5e83258 commit c06a097
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
public class CaseInstanceVariableCollectionResource extends BaseVariableResource {

@ApiOperation(value = "List variables for a case instance", nickname="listCaseInstanceVariables", tags = {"Case Instance Variables" },
notes = "In case the variable is a binary variable or serializable, the valueUrl points to an URL to fetch the raw value. If it’s a plain variable, the value is present in the response. Note that only local scoped variables are returned, as there is no global scope for process-instance variables.")
notes = "In case the variable is a binary variable or serializable, the valueUrl points to an URL to fetch the raw value. If it’s a plain variable, the value is present in the response. Note that only local scoped variables are returned, as there is no global scope for case-instance variables.")
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Indicates the case instance was found and variables are returned."),
@ApiResponse(code = 400, message = "Indicates the requested case instance was not found.")
Expand All @@ -60,12 +60,12 @@ public List<RestVariable> getVariables(@ApiParam(name = "caseInstanceId") @PathV

@ApiOperation(value = "Update a multiple/single (non)binary variable on a case instance", tags = { "Case Instance Variables" }, nickname = "createOrUpdateCaseVariable",
notes = "This endpoint can be used in 2 ways: By passing a JSON Body (RestVariable or an array of 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"
+ "Nonexistent variables are created on the case-instance and existing ones are overridden without any error.\n"
+ "Any number of variables can be passed into the request body array.\n"
+ "Note that scope is ignored, only local variables can be set in a case instance.\n"
+ "Note that scope is ignored, only global variables can be set in a case instance.\n"
+ "NB: Swagger V2 specification doesn't 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.cmmn.service.api.engine.variable.RestVariable", value = "Create a variable on a process instance", paramType = "body", example = "{\n" +
@ApiImplicitParam(name = "body", type = "org.flowable.rest.cmmn.service.api.engine.variable.RestVariable", value = "Create a variable on a case instance", paramType = "body", example = "{\n" +
" \"name\":\"intProcVar\"\n" +
" \"type\":\"integer\"\n" +
" \"value\":123,\n" +
Expand All @@ -90,9 +90,9 @@ public Object createOrUpdateExecutionVariable(@ApiParam(name = "caseInstanceId")

@ApiOperation(value = "Create variables or new binary variable on a case instance", tags = { "Case Instance Variables" }, nickname = "createCaseInstanceVariable",
notes = "This endpoint can be used in 2 ways: By passing a JSON Body (RestVariable or an array of 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"
+ "Nonexistent variables are created on the case-instance and existing ones are overridden without any error.\n"
+ "Any number of variables can be passed into the request body array.\n"
+ "Note that scope is ignored, only local variables can be set in a case instance.\n"
+ "Note that scope is ignored, only global variables can be set in a case instance.\n"
+ "NB: Swagger V2 specification doesn't 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.cmmn.service.api.engine.variable.RestVariable", value = "Create a variable on a case instance", paramType = "body", example = "{\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public RestVariable getVariable(@ApiParam(name = "caseInstanceId") @PathVariable
@ApiOperation(value = "Update a single variable on a case instance", tags = { "Case Instance Variables" }, nickname = "updateCaseInstanceVariable",
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 case 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"
+ "Note that scope is ignored, only global variables can be set in a case instance.\n"
+ "NB: Swagger V2 specification doesn't 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.cmmn.service.api.engine.variable.RestVariable", value = "Create a variable on a case instance", paramType = "body", example = "{\n" +
Expand All @@ -85,7 +85,7 @@ public RestVariable getVariable(@ApiParam(name = "caseInstanceId") @PathVariable
})
@ApiResponses(value = {
@ApiResponse(code = 201, message = "Indicates both the case instance and variable were found and variable is updated."),
@ApiResponse(code = 404, message = "Indicates the requested case 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.")
@ApiResponse(code = 404, message = "Indicates the requested case instance was not found or the case instance does not have a variable with the given name. Status description contains additional information about the error.")
})
@PutMapping(value = "/cmmn-runtime/case-instances/{caseInstanceId}/variables/{variableName}", produces = "application/json", consumes = {"application/json", "multipart/form-data"})
public RestVariable updateVariable(@ApiParam(name = "caseInstanceId") @PathVariable("caseInstanceId") String caseInstanceId, @ApiParam(name = "variableName") @PathVariable("variableName") String variableName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ protected RestVariable setSimpleVariable(RestVariable restVariable, Execution ex
throw new FlowableIllegalArgumentException("Variable name is required");
}

// Figure out scope, revert to local is omitted
// Figure out scope, revert to local if omitted
RestVariableScope scope = restVariable.getVariableScope();
if (scope == null) {
scope = RestVariableScope.LOCAL;
Expand Down

0 comments on commit c06a097

Please sign in to comment.