From 4fa6a7d072eba3c6eb2261a12c104d394b52cb92 Mon Sep 17 00:00:00 2001 From: Mikko Tiihonen Date: Mon, 27 Apr 2020 23:10:49 +0300 Subject: [PATCH] Review fixes --- .../src/main/java/io/nflow/rest/v1/ResourceBase.java | 8 ++++---- .../nflow/rest/v1/springweb/WorkflowInstanceResource.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nflow-rest-api-common/src/main/java/io/nflow/rest/v1/ResourceBase.java b/nflow-rest-api-common/src/main/java/io/nflow/rest/v1/ResourceBase.java index f633ba403..a4b9e6822 100644 --- a/nflow-rest-api-common/src/main/java/io/nflow/rest/v1/ResourceBase.java +++ b/nflow-rest-api-common/src/main/java/io/nflow/rest/v1/ResourceBase.java @@ -68,12 +68,12 @@ public abstract class ResourceBase { new SimpleEntry<>(actionStateVariables, WorkflowInstanceInclude.ACTION_STATE_VARIABLES), new SimpleEntry<>(childWorkflows, WorkflowInstanceInclude.CHILD_WORKFLOW_IDS)) .collect(toMap(Entry::getKey, Entry::getValue))); - protected static final String QUERY_ARCHIVED_DEFAULT_S = "false"; - protected static final boolean QUERY_ARCHIVED_DEFAULT = Boolean.parseBoolean(QUERY_ARCHIVED_DEFAULT_S); + protected static final String QUERY_ARCHIVED_DEFAULT_STR = "false"; + protected static final boolean QUERY_ARCHIVED_DEFAULT = Boolean.parseBoolean(QUERY_ARCHIVED_DEFAULT_STR); public List listWorkflowDefinitions(final List types, - final WorkflowDefinitionService workflowDefinitions, final ListWorkflowDefinitionConverter converter, - final WorkflowDefinitionDao workflowDefinitionDao) { + final WorkflowDefinitionService workflowDefinitions, final ListWorkflowDefinitionConverter converter, + final WorkflowDefinitionDao workflowDefinitionDao) { List> definitions = workflowDefinitions.getWorkflowDefinitions(); Set reqTypes = new HashSet<>(types); Set foundTypes = new HashSet<>(); diff --git a/nflow-rest-api-spring-web/src/main/java/io/nflow/rest/v1/springweb/WorkflowInstanceResource.java b/nflow-rest-api-spring-web/src/main/java/io/nflow/rest/v1/springweb/WorkflowInstanceResource.java index 38b81aa35..d6a986772 100644 --- a/nflow-rest-api-spring-web/src/main/java/io/nflow/rest/v1/springweb/WorkflowInstanceResource.java +++ b/nflow-rest-api-spring-web/src/main/java/io/nflow/rest/v1/springweb/WorkflowInstanceResource.java @@ -110,7 +110,7 @@ public ResponseEntity updateWorkflowInstance(@ApiParam("Internal id for workf public ResponseEntity fetchWorkflowInstance(@ApiParam("Internal id for workflow instance") @PathVariable("id") long id, @RequestParam(value = "include", required = false) @ApiParam(value = INCLUDE_PARAM_DESC, allowableValues = INCLUDE_PARAM_VALUES, allowMultiple = true) String include, @RequestParam(value = "maxActions", required = false) @ApiParam("Maximum number of actions returned for each workflow instance") Long maxActions, - @RequestParam(value = "queryArchive", required = false, defaultValue = QUERY_ARCHIVED_DEFAULT_S) @ApiParam("Query also the archive if not found from main tables") boolean queryArchive) { + @RequestParam(value = "queryArchive", required = false, defaultValue = QUERY_ARCHIVED_DEFAULT_STR) @ApiParam("Query also the archive if not found from main tables") boolean queryArchive) { return handleExceptions( () -> ok(super.fetchWorkflowInstance(id, include, maxActions, queryArchive, this.workflowInstances, this.listWorkflowConverter))); } @@ -129,7 +129,7 @@ public ResponseEntity listWorkflowInstances( @RequestParam(value = "include", required = false) @ApiParam(value = INCLUDE_PARAM_DESC, allowableValues = INCLUDE_PARAM_VALUES, allowMultiple = true) String include, @RequestParam(value = "maxResults", required = false) @ApiParam("Maximum number of workflow instances to be returned") Long maxResults, @RequestParam(value = "maxActions", required = false) @ApiParam("Maximum number of actions returned for each workflow instance") Long maxActions, - @RequestParam(value = "queryArchive", required = false, defaultValue = QUERY_ARCHIVED_DEFAULT_S) @ApiParam("Query also the archive if not enough results found from main tables") boolean queryArchive) { + @RequestParam(value = "queryArchive", required = false, defaultValue = QUERY_ARCHIVED_DEFAULT_STR) @ApiParam("Query also the archive if not enough results found from main tables") boolean queryArchive) { return handleExceptions( () -> ok(super.listWorkflowInstances(ids, types, parentWorkflowId, parentActionId, states, statuses, businessKey, externalId, include, maxResults, maxActions, queryArchive, this.workflowInstances, this.listWorkflowConverter).iterator()));