Skip to content

Commit f57a6bb

Browse files
adjusted based on comments
1 parent fc8aba0 commit f57a6bb

21 files changed

Lines changed: 51 additions & 72 deletions

modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/caze/HistoricCaseInstanceQueryResource.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ public class HistoricCaseInstanceQueryResource extends HistoricCaseInstanceBaseR
4040
@ApiOperation(value = "Query for historic case instances", tags = {"History Case", "Query" }, nickname = "queryHistoricCaseInstance",
4141
notes = "All supported JSON parameter fields allowed are exactly the same as the parameters found for getting a collection of historic case instances, 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 process variables. The variables property is a JSON-array containing objects with the format as described here.")
4242
@ApiImplicitParams({
43-
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'caseInstanceId'.", allowableValues = "caseInstanceId,caseDefinitionId,startTime,endTime,tenantId", paramType = "query"),
44-
@ApiImplicitParam(name = "order", dataType = "string", value = "The sort order, either 'asc' or 'desc'. Defaults to 'asc'.", paramType = "query"),
45-
@ApiImplicitParam(name = "start", dataType = "integer", value = "Index of the first row to fetch. Defaults to 0.", paramType = "query"),
46-
@ApiImplicitParam(name = "size", dataType = "integer", value = "Number of rows to fetch, starting from start. Defaults to 10.", paramType = "query"),
43+
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'caseInstanceId'.", allowableValues = "caseInstanceId,caseDefinitionId,startTime,endTime,tenantId", paramType = "body"),
4744
})
4845
@ApiResponses(value = {
4946
@ApiResponse(code = 200, message = "Indicates request was successful and the case instances are returned"),

modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/milestone/HistoricMilestoneInstanceQueryResource.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ public class HistoricMilestoneInstanceQueryResource extends HistoricMilestoneIns
4141
@ApiOperation(value = "Query for historic milestone instances", tags = {"History Milestone", "Query"}, nickname = "queryHistoricMilestoneInstance",
4242
notes = "All supported JSON parameter fields allowed are exactly the same as the parameters found for getting a collection of historic milestone instances, 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.")
4343
@ApiImplicitParams({
44-
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'timestamp'.", allowableValues = "milestoneName,timestamp", paramType = "query"),
45-
@ApiImplicitParam(name = "order", dataType = "string", value = "The sort order, either 'asc' or 'desc'. Defaults to 'asc'.", paramType = "query"),
46-
@ApiImplicitParam(name = "start", dataType = "integer", value = "Index of the first row to fetch. Defaults to 0.", paramType = "query"),
47-
@ApiImplicitParam(name = "size", dataType = "integer", value = "Number of rows to fetch, starting from start. Defaults to 10.", paramType = "query"),
44+
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'timestamp'.", allowableValues = "milestoneName,timestamp", paramType = "body"),
4845
})
4946
@ApiResponses(value = {
5047
@ApiResponse(code = 200, message = "Indicates request was successful and the milestone instances are returned"),

modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/planitem/HistoricPlanItemInstanceQueryResource.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ public class HistoricPlanItemInstanceQueryResource extends HistoricPlanItemInsta
4141
@ApiOperation(value = "Query for historic plan item instances", tags = {"History PlanItem", "Query"}, nickname = "queryHistoricPlanItemInstance",
4242
notes = "All supported JSON parameter fields allowed are exactly the same as the parameters found for getting a collection of historic plan item instances, 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.")
4343
@ApiImplicitParams({
44-
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'createTime'.", allowableValues = "createTime,createdTime,endedTime,name", paramType = "query"),
45-
@ApiImplicitParam(name = "order", dataType = "string", value = "The sort order, either 'asc' or 'desc'. Defaults to 'asc'.", paramType = "query"),
46-
@ApiImplicitParam(name = "start", dataType = "integer", value = "Index of the first row to fetch. Defaults to 0.", paramType = "query"),
47-
@ApiImplicitParam(name = "size", dataType = "integer", value = "Number of rows to fetch, starting from start. Defaults to 10.", paramType = "query"),
44+
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'createTime'.", allowableValues = "createTime,createdTime,endedTime,name", paramType = "body"),
4845
})
4946
@ApiResponses(value = {
5047
@ApiResponse(code = 200, message = "Indicates request was successful and the plan item instances are returned"),

modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/task/HistoricTaskInstanceQueryResource.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ public class HistoricTaskInstanceQueryResource extends HistoricTaskInstanceBaseR
4040
@ApiOperation(value = "Query for historic task instances", tags = {"History Task", "Query" },
4141
nickname = "queryHistoricTaskInstance", notes = "All supported JSON parameter fields allowed are exactly the same as the parameters found for getting a collection of historic task instances, 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 process variables. The taskVariables and processVariables properties are JSON-arrays containing objects with the format as described here.")
4242
@ApiImplicitParams({
43-
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'taskInstanceId'.", allowableValues = "deleteReason,duration,endTime,executionId,taskInstanceId,caseDefinitionId,caseInstanceId,start,assignee,taskDefinitionKey,description,dueDate,name,owner,priority,tenantId,startTime", paramType = "query"),
44-
@ApiImplicitParam(name = "order", dataType = "string", value = "The sort order, either 'asc' or 'desc'. Defaults to 'asc'.", paramType = "query"),
45-
@ApiImplicitParam(name = "start", dataType = "integer", value = "Index of the first row to fetch. Defaults to 0.", paramType = "query"),
46-
@ApiImplicitParam(name = "size", dataType = "integer", value = "Number of rows to fetch, starting from start. Defaults to 10.", paramType = "query"),
43+
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'taskInstanceId'.", allowableValues = "deleteReason,duration,endTime,executionId,taskInstanceId,caseDefinitionId,caseInstanceId,start,assignee,taskDefinitionKey,description,dueDate,name,owner,priority,tenantId,startTime", paramType = "body"),
4744
})
4845
@ApiResponses(value = {
4946
@ApiResponse(code = 200, message = "Indicates request was successful and the tasks are returned"),

modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceQueryResource.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ public class CaseInstanceQueryResource extends BaseCaseInstanceResource {
4242
+ "\n" + "The general paging and sorting query-parameters can be used for this URL.")
4343

4444
@ApiImplicitParams({
45-
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'id'.", allowableValues = "caseDefinitionId,caseDefinitionKey,id,startTime,tenantId,businessKey", paramType = "query"),
46-
@ApiImplicitParam(name = "order", dataType = "string", value = "The sort order, either 'asc' or 'desc'. Defaults to 'asc'.", paramType = "query"),
47-
@ApiImplicitParam(name = "start", dataType = "integer", value = "Index of the first row to fetch. Defaults to 0.", paramType = "query"),
48-
@ApiImplicitParam(name = "size", dataType = "integer", value = "Number of rows to fetch, starting from start. Defaults to 10.", paramType = "query"),
45+
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'id'.", allowableValues = "caseDefinitionId,caseDefinitionKey,id,startTime,tenantId,businessKey", paramType = "body"),
4946
})
5047
@ApiResponses(value = {
5148
@ApiResponse(code = 200, message = "Indicates request was successful and the case instances are returned"),

modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/planitem/PlanItemInstanceQueryResource.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ public class PlanItemInstanceQueryResource extends PlanItemInstanceBaseResource
4141
notes = "The request body can contain all possible filters that can be used in the List plan item instances URL query. On top of these, it’s possible to provide an array of variables and caseInstanceVariables to include in the query, with their format described here.\n"
4242
+ "\n" + "The general paging and sorting query-parameters can be used for this URL.")
4343
@ApiImplicitParams({
44-
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'createTime'.", allowableValues = "name,createTime,startTime", paramType = "query"),
45-
@ApiImplicitParam(name = "order", dataType = "string", value = "The sort order, either 'asc' or 'desc'. Defaults to 'asc'.", paramType = "query"),
46-
@ApiImplicitParam(name = "start", dataType = "integer", value = "Index of the first row to fetch. Defaults to 0.", paramType = "query"),
47-
@ApiImplicitParam(name = "size", dataType = "integer", value = "Number of rows to fetch, starting from start. Defaults to 10.", paramType = "query"),
44+
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'createTime'.", allowableValues = "name,createTime,startTime", paramType = "body"),
4845
})
4946
@ApiResponses(value = {
5047
@ApiResponse(code = 200, message = "Indicates request was successful and the plan item instances are returned."),

modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/task/TaskQueryResource.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ public class TaskQueryResource extends TaskBaseResource {
4040
@ApiOperation(value = "Query for tasks", nickname="queryTasks", tags = {"Tasks", "Query"},
4141
notes = "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.")
4242
@ApiImplicitParams({
43-
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'id'.", allowableValues = "id,name,description,dueDate,createTime,priority,executionId,processInstanceId,tenantId,assignee,owner", paramType = "query"),
44-
@ApiImplicitParam(name = "order", dataType = "string", value = "The sort order, either 'asc' or 'desc'. Defaults to 'asc'.", paramType = "query"),
45-
@ApiImplicitParam(name = "start", dataType = "integer", value = "Index of the first row to fetch. Defaults to 0.", paramType = "query"),
46-
@ApiImplicitParam(name = "size", dataType = "integer", value = "Number of rows to fetch, starting from start. Defaults to 10.", paramType = "query"),
43+
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'id'.", allowableValues = "id,name,description,dueDate,createTime,priority,executionId,processInstanceId,tenantId,assignee,owner", paramType = "body"),
4744
})
4845
@ApiResponses(value = {
4946
@ApiResponse(code = 200, message = "Indicates request was successful and the tasks are returned."),

modules/flowable-common-rest/src/main/java/org/flowable/common/rest/api/PaginateListUtil.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ static <RES, REQ> DataResponse<RES> paginateList(PaginateRequest paginateRequest
107107
String sort = paginateRequest.getSort();
108108
if (sort == null) {
109109
sort = defaultSort;
110-
} if (order == null) {
111-
order = "asc";
112110
}
113111
String order = paginateRequest.getOrder();
114-
112+
if (order == null) {
113+
order = "asc";
114+
}
115115

116116
// Sort order
117117
if (sort != null && properties != null && !properties.isEmpty()) {

modules/flowable-common-rest/src/main/java/org/flowable/common/rest/api/PaginateRequest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
*/
1313
package org.flowable.common.rest.api;
1414

15+
import io.swagger.annotations.ApiParam;
16+
1517
/**
1618
* Interface representing a paginated request object, use when paging is needed without using URL-parameters.
1719
*
@@ -33,6 +35,7 @@ public Integer getStart() {
3335
return start;
3436
}
3537

38+
@ApiParam(value = "From the paginate request. Index of the first row to fetch. Defaults to 0.")
3639
public void setStart(Integer start) {
3740
this.start = start;
3841
}
@@ -41,6 +44,7 @@ public Integer getSize() {
4144
return size;
4245
}
4346

47+
@ApiParam(name = "size", type = "integer", value = "From the paginate request. Number of rows to fetch, starting from start. Defaults to 10.", required = false)
4448
public void setSize(Integer size) {
4549
this.size = size;
4650
}
@@ -57,6 +61,7 @@ public String getOrder() {
5761
return order;
5862
}
5963

64+
@ApiParam(name = "order", type = "string", value = "From the paginate request. The sort order, either 'asc' or 'desc'. Defaults to 'asc'.", required = false)
6065
public void setOrder(String order) {
6166
this.order = order;
6267
}

modules/flowable-external-job-rest/src/main/java/org/flowable/external/job/rest/service/api/query/ExternalWorkerJobQueryResource.java renamed to modules/flowable-external-job-rest/src/main/java/org/flowable/external/job/rest/service/api/query/ExternalWorkerJobCollectionResource.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*/
3939
@RestController
4040
@Api(tags = { "Info and Query" })
41-
public class ExternalWorkerJobQueryResource extends ExternalWorkerJobBaseResource {
41+
public class ExternalWorkerJobCollectionResource extends ExternalWorkerJobBaseResource {
4242

4343
public static final Map<String, QueryProperty> PROPERTIES;
4444

@@ -55,17 +55,14 @@ public class ExternalWorkerJobQueryResource extends ExternalWorkerJobBaseResourc
5555

5656
protected final ExternalJobRestResponseFactory restResponseFactory;
5757

58-
public ExternalWorkerJobQueryResource(ExternalJobRestResponseFactory restResponseFactory) {
58+
public ExternalWorkerJobCollectionResource(ExternalJobRestResponseFactory restResponseFactory) {
5959
this.restResponseFactory = restResponseFactory;
6060
}
6161

6262
@ApiOperation(value = "List External Worker Jobs", tags = { "Info and Query" })
6363
@ApiImplicitParams({
64-
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'id'.", allowableValues = "id,dueDate,createTime,executionId,processInstanceId,retries,tenantId", paramType = "query"),
65-
@ApiImplicitParam(name = "order", dataType = "string", value = "The sort order, either 'asc' or 'desc'. Defaults to 'asc'.", paramType = "query"),
66-
@ApiImplicitParam(name = "start", dataType = "integer", value = "Index of the first row to fetch. Defaults to 0.", paramType = "query"),
67-
@ApiImplicitParam(name = "size", dataType = "integer", value = "Number of rows to fetch, starting from start. Defaults to 10.", paramType = "query"),
68-
})
64+
@ApiImplicitParam(name = "sort", dataType = "string", value = "The field to sort by. Defaults to 'id'.", allowableValues = "id,dueDate,createTime,executionId,processInstanceId,retries,tenantId", paramType = "body"),
65+
})
6966
@ApiResponses({
7067
@ApiResponse(code = 200, message = "Indicates the requested jobs were returned."),
7168
@ApiResponse(code = 400, message = "Indicates an illegal value has been used in a url query parameter. Status description contains additional details about the error."),

0 commit comments

Comments
 (0)