This is an automated email from the ASF dual-hosted git repository.
caishunfeng pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 1679f15a50 [FIX-9355] Fix scheduleTime of start-process-instance api
in api-doc (#9359)
1679f15a50 is described below
commit 1679f15a50a505e5177ad659348dec9b1ef863f9
Author: xiangzihao <[email protected]>
AuthorDate: Wed Apr 6 21:34:22 2022 +0800
[FIX-9355] Fix scheduleTime of start-process-instance api in api-doc (#9359)
* fix #9355
* fix #9355
* fix ut error
* fix ut error
---
.../api/controller/ExecutorController.java | 80 +++++++++++-----------
.../main/resources/i18n/messages_en_US.properties | 2 +-
.../main/resources/i18n/messages_zh_CN.properties | 2 +-
.../api/controller/ExecutorControllerTest.java | 3 +-
4 files changed, 44 insertions(+), 43 deletions(-)
diff --git
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
index 10c6177924..0a6fed5072 100644
---
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
+++
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ExecutorController.java
@@ -95,22 +95,22 @@ public class ExecutorController extends BaseController {
*/
@ApiOperation(value = "startProcessInstance", notes =
"RUN_PROCESS_INSTANCE_NOTES")
@ApiImplicitParams({
- @ApiImplicitParam(name = "processDefinitionCode", value =
"PROCESS_DEFINITION_CODE", required = true, dataType = "Long", example = "100"),
- @ApiImplicitParam(name = "scheduleTime", value = "SCHEDULE_TIME",
dataType = "String"),
- @ApiImplicitParam(name = "failureStrategy", value =
"FAILURE_STRATEGY", required = true, dataType = "FailureStrategy"),
- @ApiImplicitParam(name = "startNodeList", value = "START_NODE_LIST",
dataType = "String"),
- @ApiImplicitParam(name = "taskDependType", value = "TASK_DEPEND_TYPE",
dataType = "TaskDependType"),
- @ApiImplicitParam(name = "execType", value = "COMMAND_TYPE", dataType
= "CommandType"),
- @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE",
required = true, dataType = "WarningType"),
- @ApiImplicitParam(name = "warningGroupId", value = "WARNING_GROUP_ID",
dataType = "Int", example = "100"),
- @ApiImplicitParam(name = "runMode", value = "RUN_MODE", dataType =
"RunMode"),
- @ApiImplicitParam(name = "processInstancePriority", value =
"PROCESS_INSTANCE_PRIORITY", required = true, dataType = "Priority"),
- @ApiImplicitParam(name = "workerGroup", value = "WORKER_GROUP",
dataType = "String", example = "default"),
- @ApiImplicitParam(name = "environmentCode", value =
"ENVIRONMENT_CODE", dataType = "Long", example = "-1"),
- @ApiImplicitParam(name = "timeout", value = "TIMEOUT", dataType =
"Int", example = "100"),
- @ApiImplicitParam(name = "expectedParallelismNumber", value =
"EXPECTED_PARALLELISM_NUMBER", dataType = "Int" , example = "8"),
- @ApiImplicitParam(name = "dryRun", value = "DRY_RUN", dataType =
"Int", example = "0"),
- @ApiImplicitParam(name = "complementDependentMode", value =
"COMPLEMENT_DEPENDENT_MODE", dataType = "complementDependentMode")
+ @ApiImplicitParam(name = "processDefinitionCode", value =
"PROCESS_DEFINITION_CODE", required = true, dataType = "Long", example = "100"),
+ @ApiImplicitParam(name = "scheduleTime", value = "SCHEDULE_TIME",
required = true, dataType = "String", example = "2022-04-06 00:00:00,2022-04-06
00:00:00"),
+ @ApiImplicitParam(name = "failureStrategy", value =
"FAILURE_STRATEGY", required = true, dataType = "FailureStrategy"),
+ @ApiImplicitParam(name = "startNodeList", value =
"START_NODE_LIST", dataType = "String"),
+ @ApiImplicitParam(name = "taskDependType", value =
"TASK_DEPEND_TYPE", dataType = "TaskDependType"),
+ @ApiImplicitParam(name = "execType", value = "COMMAND_TYPE",
dataType = "CommandType"),
+ @ApiImplicitParam(name = "warningType", value = "WARNING_TYPE",
required = true, dataType = "WarningType"),
+ @ApiImplicitParam(name = "warningGroupId", value =
"WARNING_GROUP_ID", dataType = "Int", example = "100"),
+ @ApiImplicitParam(name = "runMode", value = "RUN_MODE", dataType =
"RunMode"),
+ @ApiImplicitParam(name = "processInstancePriority", value =
"PROCESS_INSTANCE_PRIORITY", required = true, dataType = "Priority"),
+ @ApiImplicitParam(name = "workerGroup", value = "WORKER_GROUP",
dataType = "String", example = "default"),
+ @ApiImplicitParam(name = "environmentCode", value =
"ENVIRONMENT_CODE", dataType = "Long", example = "-1"),
+ @ApiImplicitParam(name = "timeout", value = "TIMEOUT", dataType =
"Int", example = "100"),
+ @ApiImplicitParam(name = "expectedParallelismNumber", value =
"EXPECTED_PARALLELISM_NUMBER", dataType = "Int" , example = "8"),
+ @ApiImplicitParam(name = "dryRun", value = "DRY_RUN", dataType =
"Int", example = "0"),
+ @ApiImplicitParam(name = "complementDependentMode", value =
"COMPLEMENT_DEPENDENT_MODE", dataType = "complementDependentMode")
})
@PostMapping(value = "start-process-instance")
@ResponseStatus(HttpStatus.OK)
@@ -119,7 +119,7 @@ public class ExecutorController extends BaseController {
public Result startProcessInstance(@ApiIgnore @RequestAttribute(value =
Constants.SESSION_USER) User loginUser,
@ApiParam(name = "projectCode", value =
"PROJECT_CODE", required = true) @PathVariable long projectCode,
@RequestParam(value =
"processDefinitionCode") long processDefinitionCode,
- @RequestParam(value = "scheduleTime",
required = false) String scheduleTime,
+ @RequestParam(value = "scheduleTime")
String scheduleTime,
@RequestParam(value =
"failureStrategy") FailureStrategy failureStrategy,
@RequestParam(value = "startNodeList",
required = false) String startNodeList,
@RequestParam(value = "taskDependType",
required = false) TaskDependType taskDependType,
@@ -159,7 +159,7 @@ public class ExecutorController extends BaseController {
* batch execute process instance
* If any processDefinitionCode cannot be found, the failure information
is returned and the status is set to
* failed. The successful task will run normally and will not stop
- *
+ *
* @param loginUser login user
* @param projectCode project code
* @param processDefinitionCodes process definition codes
@@ -180,7 +180,7 @@ public class ExecutorController extends BaseController {
@ApiOperation(value = "batchStartProcessInstance", notes =
"BATCH_RUN_PROCESS_INSTANCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "processDefinitionCodes", value =
"PROCESS_DEFINITION_CODES", required = true, dataType = "String", example =
"1,2,3"),
- @ApiImplicitParam(name = "scheduleTime", value = "SCHEDULE_TIME",
required = true, dataType = "String"),
+ @ApiImplicitParam(name = "scheduleTime", value = "SCHEDULE_TIME",
required = true, dataType = "String", example = "2022-04-06 00:00:00,2022-04-06
00:00:00"),
@ApiImplicitParam(name = "failureStrategy", value =
"FAILURE_STRATEGY", required = true, dataType = "FailureStrategy"),
@ApiImplicitParam(name = "startNodeList", value =
"START_NODE_LIST", dataType = "String"),
@ApiImplicitParam(name = "taskDependType", value =
"TASK_DEPEND_TYPE", dataType = "TaskDependType"),
@@ -201,24 +201,24 @@ public class ExecutorController extends BaseController {
@ApiException(START_PROCESS_INSTANCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result batchStartProcessInstance(@ApiIgnore @RequestAttribute(value
= Constants.SESSION_USER) User loginUser,
- @ApiParam(name = "projectCode", value =
"PROJECT_CODE", required = true) @PathVariable long projectCode,
- @RequestParam(value =
"processDefinitionCodes") String processDefinitionCodes,
- @RequestParam(value = "scheduleTime",
required = false) String scheduleTime,
- @RequestParam(value =
"failureStrategy") FailureStrategy failureStrategy,
- @RequestParam(value = "startNodeList",
required = false) String startNodeList,
- @RequestParam(value = "taskDependType",
required = false) TaskDependType taskDependType,
- @RequestParam(value = "execType",
required = false) CommandType execType,
- @RequestParam(value = "warningType")
WarningType warningType,
- @RequestParam(value = "warningGroupId",
required = false) int warningGroupId,
- @RequestParam(value = "runMode",
required = false) RunMode runMode,
- @RequestParam(value =
"processInstancePriority", required = false) Priority processInstancePriority,
- @RequestParam(value = "workerGroup",
required = false, defaultValue = "default") String workerGroup,
- @RequestParam(value =
"environmentCode", required = false, defaultValue = "-1") Long environmentCode,
- @RequestParam(value = "timeout",
required = false) Integer timeout,
- @RequestParam(value = "startParams",
required = false) String startParams,
- @RequestParam(value =
"expectedParallelismNumber", required = false) Integer
expectedParallelismNumber,
- @RequestParam(value = "dryRun",
defaultValue = "0", required = false) int dryRun,
- @RequestParam(value =
"complementDependentMode", required = false) ComplementDependentMode
complementDependentMode) {
+ @ApiParam(name = "projectCode",
value = "PROJECT_CODE", required = true) @PathVariable long projectCode,
+ @RequestParam(value =
"processDefinitionCodes") String processDefinitionCodes,
+ @RequestParam(value =
"scheduleTime") String scheduleTime,
+ @RequestParam(value =
"failureStrategy") FailureStrategy failureStrategy,
+ @RequestParam(value =
"startNodeList", required = false) String startNodeList,
+ @RequestParam(value =
"taskDependType", required = false) TaskDependType taskDependType,
+ @RequestParam(value = "execType",
required = false) CommandType execType,
+ @RequestParam(value =
"warningType") WarningType warningType,
+ @RequestParam(value =
"warningGroupId", required = false) int warningGroupId,
+ @RequestParam(value = "runMode",
required = false) RunMode runMode,
+ @RequestParam(value =
"processInstancePriority", required = false) Priority processInstancePriority,
+ @RequestParam(value =
"workerGroup", required = false, defaultValue = "default") String workerGroup,
+ @RequestParam(value =
"environmentCode", required = false, defaultValue = "-1") Long environmentCode,
+ @RequestParam(value = "timeout",
required = false) Integer timeout,
+ @RequestParam(value =
"startParams", required = false) String startParams,
+ @RequestParam(value =
"expectedParallelismNumber", required = false) Integer
expectedParallelismNumber,
+ @RequestParam(value = "dryRun",
defaultValue = "0", required = false) int dryRun,
+ @RequestParam(value =
"complementDependentMode", required = false) ComplementDependentMode
complementDependentMode) {
if (timeout == null) {
timeout = Constants.MAX_TASK_TIMEOUT;
@@ -269,8 +269,8 @@ public class ExecutorController extends BaseController {
*/
@ApiOperation(value = "execute", notes =
"EXECUTE_ACTION_TO_PROCESS_INSTANCE_NOTES")
@ApiImplicitParams({
- @ApiImplicitParam(name = "processInstanceId", value =
"PROCESS_INSTANCE_ID", required = true, dataType = "Int", example = "100"),
- @ApiImplicitParam(name = "executeType", value = "EXECUTE_TYPE",
required = true, dataType = "ExecuteType")
+ @ApiImplicitParam(name = "processInstanceId", value =
"PROCESS_INSTANCE_ID", required = true, dataType = "Int", example = "100"),
+ @ApiImplicitParam(name = "executeType", value = "EXECUTE_TYPE",
required = true, dataType = "ExecuteType")
})
@PostMapping(value = "/execute")
@ResponseStatus(HttpStatus.OK)
@@ -293,7 +293,7 @@ public class ExecutorController extends BaseController {
*/
@ApiOperation(value = "startCheckProcessDefinition", notes =
"START_CHECK_PROCESS_DEFINITION_NOTES")
@ApiImplicitParams({
- @ApiImplicitParam(name = "processDefinitionCode", value =
"PROCESS_DEFINITION_CODE", required = true, dataType = "Long", example = "100")
+ @ApiImplicitParam(name = "processDefinitionCode", value =
"PROCESS_DEFINITION_CODE", required = true, dataType = "Long", example = "100")
})
@PostMapping(value = "/start-check")
@ResponseStatus(HttpStatus.OK)
diff --git
a/dolphinscheduler-api/src/main/resources/i18n/messages_en_US.properties
b/dolphinscheduler-api/src/main/resources/i18n/messages_en_US.properties
index 7a4752f225..bdaba338d1 100644
--- a/dolphinscheduler-api/src/main/resources/i18n/messages_en_US.properties
+++ b/dolphinscheduler-api/src/main/resources/i18n/messages_en_US.properties
@@ -219,7 +219,7 @@ QUERY_ALL_DEFINITION_LIST_NOTES=query all definition list
PAGE_NO=page no
PROCESS_INSTANCE_ID=process instance id
PROCESS_INSTANCE_JSON=process instance info(json format)
-SCHEDULE_TIME=schedule time
+SCHEDULE_TIME=schedule time,empty string indicates the current day
SYNC_DEFINE=update the information of the process instance to the process
definition
RECOVERY_PROCESS_INSTANCE_FLAG=whether to recovery process instance
PREVIEW_SCHEDULE_NOTES=preview schedule
diff --git
a/dolphinscheduler-api/src/main/resources/i18n/messages_zh_CN.properties
b/dolphinscheduler-api/src/main/resources/i18n/messages_zh_CN.properties
index bdcf2f5d37..748f2a662d 100644
--- a/dolphinscheduler-api/src/main/resources/i18n/messages_zh_CN.properties
+++ b/dolphinscheduler-api/src/main/resources/i18n/messages_zh_CN.properties
@@ -206,7 +206,7 @@ PROCESS_INSTANCE_ID=流程实例ID
PROCESS_INSTANCE_IDS=流程实例ID集合
PROCESS_INSTANCE_JSON=流程实例信息(json格式)
PREVIEW_SCHEDULE_NOTES=定时调度预览
-SCHEDULE_TIME=定时时间
+SCHEDULE_TIME=定时时间,空字符串表示当前天
SYNC_DEFINE=更新流程实例的信息是否同步到流程定义
RECOVERY_PROCESS_INSTANCE_FLAG=是否恢复流程实例
SEARCH_VAL=搜索值
diff --git
a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ExecutorControllerTest.java
b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ExecutorControllerTest.java
index 2d5c03a83a..7faed0bde0 100644
---
a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ExecutorControllerTest.java
+++
b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ExecutorControllerTest.java
@@ -202,9 +202,10 @@ public class ExecutorControllerTest extends
AbstractControllerTest {
paramsMap.add("processDefinitionCode",
String.valueOf(processDefinitionCode));
paramsMap.add("failureStrategy", String.valueOf(failureStrategy));
paramsMap.add("warningType", String.valueOf(warningType));
+ paramsMap.add("scheduleTime", scheduleTime);
when(executorService.execProcessInstance(any(User.class),
eq(projectCode), eq(processDefinitionCode),
- eq(null), eq(null), eq(failureStrategy),
eq(null), eq(null), eq(warningType),
+ eq(scheduleTime), eq(null),
eq(failureStrategy), eq(null), eq(null), eq(warningType),
eq(0), eq(null), eq(null), eq("default"), eq(-1L),
eq(Constants.MAX_TASK_TIMEOUT), eq(null), eq(null), eq(0),
eq(complementDependentMode))).thenReturn(executeServiceResult);