status
stringclasses 1
value | repo_name
stringclasses 31
values | repo_url
stringclasses 31
values | issue_id
int64 1
104k
| title
stringlengths 4
233
| body
stringlengths 0
186k
⌀ | issue_url
stringlengths 38
56
| pull_url
stringlengths 37
54
| before_fix_sha
stringlengths 40
40
| after_fix_sha
stringlengths 40
40
| report_datetime
timestamp[us, tz=UTC] | language
stringclasses 5
values | commit_datetime
timestamp[us, tz=UTC] | updated_file
stringlengths 7
188
| chunk_content
stringlengths 1
1.03M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.controller;
import static org.apache.dolphinscheduler.api.enums.Status.CREATE_TASK_DEFINITION_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.DELETE_TASK_DEFINE_BY_CODE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.DELETE_TASK_DEFINITION_VERSION_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.QUERY_DETAIL_OF_TASK_DEFINITION_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.QUERY_TASK_DEFINITION_LIST_PAGING_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.QUERY_TASK_DEFINITION_VERSIONS_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.RELEASE_TASK_DEFINITION_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.SWITCH_TASK_DEFINITION_VERSION_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_TASK_DEFINITION_ERROR;
import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.exceptions.ApiException;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
import org.apache.dolphinscheduler.api.service.TaskDefinitionService;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.constants.Constants;
import org.apache.dolphinscheduler.common.enums.ReleaseState;
import org.apache.dolphinscheduler.common.enums.TaskExecuteType;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.plugin.task.api.utils.ParameterUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
/**
* task definition controller
*/
@Tag(name = "TASK_DEFINITION_TAG")
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
@RestController
@RequestMapping("projects/{projectCode}/task-definition")
public class TaskDefinitionController extends BaseController {
@Autowired
private TaskDefinitionService taskDefinitionService;
/**
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
* create task definition
*
* @param loginUser login user
* @param projectCode project code
* @param taskDefinitionJson task definition json
* @return create result code
*/
@Operation(summary = "save", description = "CREATE_TASK_DEFINITION_NOTES")
@Parameters({
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)),
@Parameter(name = "taskDefinitionJson", description = "TASK_DEFINITION_JSON", required = true, schema = @Schema(implementation = String.class))
})
@PostMapping()
@ResponseStatus(HttpStatus.CREATED)
@ApiException(CREATE_TASK_DEFINITION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result createTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@RequestParam(value = "taskDefinitionJson", required = true) String taskDefinitionJson) {
Map<String, Object> result =
taskDefinitionService.createTaskDefinition(loginUser, projectCode, taskDefinitionJson);
return returnDataList(result);
}
/**
* create single task definition that binds the workflow
*
* @param loginUser login user
* @param projectCode project code
* @param processDefinitionCode process definition code
* @param taskDefinitionJsonObj task definition json object
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
* @param upstreamCodes upstream task codes, sep comma
* @return create result code
*/
@Operation(summary = "saveSingle", description = "CREATE_SINGLE_TASK_DEFINITION_NOTES")
@Parameters({
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)),
@Parameter(name = "processDefinitionCode", description = "PROCESS_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class)),
@Parameter(name = "taskDefinitionJsonObj", description = "TASK_DEFINITION_JSON", required = true, schema = @Schema(implementation = String.class)),
@Parameter(name = "upstreamCodes", description = "UPSTREAM_CODES", required = false, schema = @Schema(implementation = String.class))
})
@PostMapping("/save-single")
@ResponseStatus(HttpStatus.CREATED)
@ApiException(CREATE_TASK_DEFINITION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result createTaskBindsWorkFlow(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@RequestParam(value = "processDefinitionCode", required = true) long processDefinitionCode,
@RequestParam(value = "taskDefinitionJsonObj", required = true) String taskDefinitionJsonObj,
@RequestParam(value = "upstreamCodes", required = false) String upstreamCodes) {
Map<String, Object> result = taskDefinitionService.createTaskBindsWorkFlow(loginUser, projectCode,
processDefinitionCode, taskDefinitionJsonObj, StringUtils.defaultString(upstreamCodes));
return returnDataList(result);
}
/**
* update task definition
*
* @param loginUser login user
* @param projectCode project code
* @param code task definition code
* @param taskDefinitionJsonObj task definition json object
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
* @return update result code
*/
@Operation(summary = "update", description = "UPDATE_TASK_DEFINITION_NOTES")
@Parameters({
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)),
@Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")),
@Parameter(name = "taskDefinitionJsonObj", description = "TASK_DEFINITION_JSON", required = true, schema = @Schema(implementation = String.class))
})
@PutMapping(value = "/{code}")
@ResponseStatus(HttpStatus.OK)
@ApiException(UPDATE_TASK_DEFINITION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result updateTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@PathVariable(value = "code") long code,
@RequestParam(value = "taskDefinitionJsonObj", required = true) String taskDefinitionJsonObj) {
Map<String, Object> result =
taskDefinitionService.updateTaskDefinition(loginUser, projectCode, code, taskDefinitionJsonObj);
return returnDataList(result);
}
/**
* update task definition
*
* @param loginUser login user
* @param projectCode project code
* @param code task definition code
* @param taskDefinitionJsonObj task definition json object
* @param upstreamCodes upstream task codes, sep comma
* @return update result code
*/
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
@Operation(summary = "updateWithUpstream", description = "UPDATE_TASK_DEFINITION_NOTES")
@Parameters({
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true, schema = @Schema(implementation = long.class)),
@Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")),
@Parameter(name = "taskDefinitionJsonObj", description = "TASK_DEFINITION_JSON", required = true, schema = @Schema(implementation = String.class)),
@Parameter(name = "upstreamCodes", description = "UPSTREAM_CODES", required = false, schema = @Schema(implementation = String.class))
})
@PutMapping(value = "/{code}/with-upstream")
@ResponseStatus(HttpStatus.OK)
@ApiException(UPDATE_TASK_DEFINITION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result updateTaskWithUpstream(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@PathVariable(value = "code") long code,
@RequestParam(value = "taskDefinitionJsonObj", required = true) String taskDefinitionJsonObj,
@RequestParam(value = "upstreamCodes", required = false) String upstreamCodes) {
Map<String, Object> result = taskDefinitionService.updateTaskWithUpstream(loginUser, projectCode, code,
taskDefinitionJsonObj, upstreamCodes);
return returnDataList(result);
}
/**
* query task definition version paging list info
*
* @param loginUser login user info
* @param projectCode project code
* @param code task definition code
* @param pageNo the task definition version list current page number
* @param pageSize the task definition version list page size
* @param code the task definition code
* @return the task definition version list
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
*/
@Operation(summary = "queryVersions", description = "QUERY_TASK_DEFINITION_VERSIONS_NOTES")
@Parameters({
@Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")),
@Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")),
@Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10"))
})
@GetMapping(value = "/{code}/versions")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_TASK_DEFINITION_VERSIONS_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryTaskDefinitionVersions(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@PathVariable(value = "code") long code,
@RequestParam(value = "pageNo") int pageNo,
@RequestParam(value = "pageSize") int pageSize) {
Result result = checkPageParams(pageNo, pageSize);
if (!result.checkResult()) {
return result;
}
return taskDefinitionService.queryTaskDefinitionVersions(loginUser, projectCode, code, pageNo, pageSize);
}
/**
* switch task definition version
*
* @param loginUser login user info
* @param projectCode project code
* @param code the task definition code
* @param version the version user want to switch
* @return switch version result code
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
*/
@Operation(summary = "switchVersion", description = "SWITCH_TASK_DEFINITION_VERSION_NOTES")
@Parameters({
@Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")),
@Parameter(name = "version", description = "VERSION", required = true, schema = @Schema(implementation = int.class, example = "100"))
})
@GetMapping(value = "/{code}/versions/{version}")
@ResponseStatus(HttpStatus.OK)
@ApiException(SWITCH_TASK_DEFINITION_VERSION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result switchTaskDefinitionVersion(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@PathVariable(value = "code") long code,
@PathVariable(value = "version") int version) {
Map<String, Object> result = taskDefinitionService.switchVersion(loginUser, projectCode, code, version);
return returnDataList(result);
}
/**
* delete the certain task definition version by version and code
*
* @param loginUser login user info
* @param projectCode project code
* @param code the task definition code
* @param version the task definition version user want to delete
* @return delete version result code
*/
@Operation(summary = "deleteVersion", description = "DELETE_TASK_DEFINITION_VERSION_NOTES")
@Parameters({
@Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1")),
@Parameter(name = "version", description = "VERSION", required = true, schema = @Schema(implementation = int.class, example = "100"))
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
})
@DeleteMapping(value = "/{code}/versions/{version}")
@ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_TASK_DEFINITION_VERSION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result deleteTaskDefinitionVersion(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@PathVariable(value = "code") long code,
@PathVariable(value = "version") int version) {
Map<String, Object> result =
taskDefinitionService.deleteByCodeAndVersion(loginUser, projectCode, code, version);
return returnDataList(result);
}
/**
* delete task definition by code
*
* @param loginUser login user
* @param projectCode project code
* @param code the task definition code
* @return delete result code
*/
@Operation(summary = "deleteTaskDefinition", description = "DELETE_TASK_DEFINITION_BY_CODE_NOTES")
@Parameters({
@Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1"))
})
@DeleteMapping(value = "/{code}")
@ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_TASK_DEFINE_BY_CODE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result deleteTaskDefinitionByCode(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@PathVariable(value = "code") long code) {
taskDefinitionService.deleteTaskDefinitionByCode(loginUser, code);
return new Result(Status.SUCCESS);
}
/**
* query detail of task definition by code
*
* @param loginUser login user
* @param projectCode project code
* @param code the task definition code
* @return task definition detail
*/
@Operation(summary = "queryTaskDefinitionByCode", description = "QUERY_TASK_DEFINITION_DETAIL_NOTES")
@Parameters({
@Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "1"))
})
@GetMapping(value = "/{code}")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_DETAIL_OF_TASK_DEFINITION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryTaskDefinitionDetail(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@PathVariable(value = "code") long code) {
Map<String, Object> result = taskDefinitionService.queryTaskDefinitionDetail(loginUser, projectCode, code);
return returnDataList(result);
}
/**
* query task definition list paging
*
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
* @param loginUser login user
* @param projectCode project code
* @param searchWorkflowName searchWorkflowName
* @param searchTaskName searchTaskName
* @param taskType taskType
* @param taskExecuteType taskExecuteType
* @param pageNo page number
* @param pageSize page size
* @return task definition page
*/
@Operation(summary = "queryTaskDefinitionListPaging", description = "QUERY_TASK_DEFINITION_LIST_PAGING_NOTES")
@Parameters({
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = false, schema = @Schema(implementation = long.class)),
@Parameter(name = "searchWorkflowName", description = "SEARCH_WORKFLOW_NAME", required = false, schema = @Schema(implementation = String.class)),
@Parameter(name = "searchTaskName", description = "SEARCH_TASK_NAME", required = false, schema = @Schema(implementation = String.class)),
@Parameter(name = "taskType", description = "TASK_TYPE", required = false, schema = @Schema(implementation = String.class, example = "SHELL")),
@Parameter(name = "taskExecuteType", description = "TASK_EXECUTE_TYPE", required = false, schema = @Schema(implementation = TaskExecuteType.class, example = "STREAM")),
@Parameter(name = "pageNo", description = "PAGE_NO", required = true, schema = @Schema(implementation = int.class, example = "1")),
@Parameter(name = "pageSize", description = "PAGE_SIZE", required = true, schema = @Schema(implementation = int.class, example = "10"))
})
@GetMapping()
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_TASK_DEFINITION_LIST_PAGING_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryTaskDefinitionListPaging(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@RequestParam(value = "searchWorkflowName", required = false) String searchWorkflowName,
@RequestParam(value = "searchTaskName", required = false) String searchTaskName,
@RequestParam(value = "taskType", required = false) String taskType,
@RequestParam(value = "taskExecuteType", required = false, defaultValue = "BATCH") TaskExecuteType taskExecuteType,
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
@RequestParam("pageNo") Integer pageNo,
@RequestParam("pageSize") Integer pageSize) {
Result result = checkPageParams(pageNo, pageSize);
if (!result.checkResult()) {
return result;
}
searchWorkflowName = ParameterUtils.handleEscapes(searchWorkflowName);
searchTaskName = ParameterUtils.handleEscapes(searchTaskName);
return taskDefinitionService.queryTaskDefinitionListPaging(loginUser, projectCode, searchWorkflowName,
searchTaskName, taskType, taskExecuteType, pageNo, pageSize);
}
/**
* gen task code list
*
* @param loginUser login user
* @param genNum gen num
* @return task code list
*/
@Operation(summary = "genTaskCodeList", description = "GEN_TASK_CODE_LIST_NOTES")
@Parameters({
@Parameter(name = "genNum", description = "GEN_NUM", required = true, schema = @Schema(implementation = int.class, example = "1"))
})
@GetMapping(value = "/gen-task-codes")
@ResponseStatus(HttpStatus.OK)
@ApiException(LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result genTaskCodeList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("genNum") Integer genNum) {
Map<String, Object> result = taskDefinitionService.genTaskCodeList(genNum);
return returnDataList(result);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
|
}
/**
* release task definition
*
* @param loginUser login user
* @param projectCode project code
* @param code task definition code
* @param releaseState releaseState
* @return update result code
*/
@Operation(summary = "releaseTaskDefinition", description = "RELEASE_TASK_DEFINITION_NOTES")
@Parameters({
@Parameter(name = "projectCode", description = "PROCESS_DEFINITION_NAME", required = true, schema = @Schema(implementation = long.class)),
@Parameter(name = "code", description = "TASK_DEFINITION_CODE", required = true, schema = @Schema(implementation = long.class, example = "123456789")),
@Parameter(name = "releaseState", description = "RELEASE_PROCESS_DEFINITION_NOTES", required = true, schema = @Schema(implementation = ReleaseState.class))
})
@PostMapping(value = "/{code}/release")
@ResponseStatus(HttpStatus.OK)
@ApiException(RELEASE_TASK_DEFINITION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result releaseTaskDefinition(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@Parameter(name = "projectCode", description = "PROJECT_CODE", required = true) @PathVariable long projectCode,
@PathVariable(value = "code", required = true) long code,
@RequestParam(value = "releaseState", required = true, defaultValue = "OFFLINE") ReleaseState releaseState) {
Map<String, Object> result =
taskDefinitionService.releaseTaskDefinition(loginUser, projectCode, code, releaseState);
return returnDataList(result);
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskDefinitionService.java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.service;
import org.apache.dolphinscheduler.api.dto.task.TaskCreateRequest;
import org.apache.dolphinscheduler.api.dto.task.TaskFilterRequest;
import org.apache.dolphinscheduler.api.dto.task.TaskUpdateRequest;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.enums.ReleaseState;
import org.apache.dolphinscheduler.common.enums.TaskExecuteType;
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
import org.apache.dolphinscheduler.dao.entity.User;
import java.util.Map;
/**
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskDefinitionService.java
|
* task definition service
*/
public interface TaskDefinitionService {
/**
* create task definition
*
* @param loginUser login user
* @param projectCode project code
* @param taskDefinitionJson task definition json
*/
Map<String, Object> createTaskDefinition(User loginUser,
long projectCode,
String taskDefinitionJson);
/**
* Create resource task definition
*
* @param loginUser login user
* @param taskCreateRequest task definition json
* @Return new TaskDefinition have created
*/
TaskDefinition createTaskDefinitionV2(User loginUser,
TaskCreateRequest taskCreateRequest);
/**
* create single task definition that binds the workflow
*
* @param loginUser login user
* @param projectCode project code
* @param processDefinitionCode process definition code
* @param taskDefinitionJsonObj task definition json object
* @param upstreamCodes upstream task codes, sep comma
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskDefinitionService.java
|
* @return create result code
*/
Map<String, Object> createTaskBindsWorkFlow(User loginUser,
long projectCode,
long processDefinitionCode,
String taskDefinitionJsonObj,
String upstreamCodes);
/**
* query task definition
*
* @param loginUser login user
* @param projectCode project code
* @param processCode process code
* @param taskName task name
*/
Map<String, Object> queryTaskDefinitionByName(User loginUser,
long projectCode,
long processCode,
String taskName);
/**
* Delete resource task definition by code
*
* Only task release state offline and no downstream tasks can be deleted, will also remove the exists
* task relation [upstreamTaskCode, taskCode]
*
* @param loginUser login user
* @param taskCode task code
*/
void deleteTaskDefinitionByCode(User loginUser,
long taskCode);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskDefinitionService.java
|
/**
* update task definition
*
* @param loginUser login user
* @param projectCode project code
* @param taskCode task code
* @param taskDefinitionJsonObj task definition json object
*/
Map<String, Object> updateTaskDefinition(User loginUser,
long projectCode,
long taskCode,
String taskDefinitionJsonObj);
/**
* Update resource task definition by code
*
* @param loginUser login user
* @param taskCode task code
* @param taskUpdateRequest task definition json object
* @return new TaskDefinition have updated
*/
TaskDefinition updateTaskDefinitionV2(User loginUser,
long taskCode,
TaskUpdateRequest taskUpdateRequest);
/**
* Get resource task definition by code
*
* @param loginUser login user
* @param taskCode task code
* @return TaskDefinition
*/
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskDefinitionService.java
|
TaskDefinition getTaskDefinition(User loginUser,
long taskCode);
/**
* Get resource task definition according to query parameter
*
* @param loginUser login user
* @param taskFilterRequest taskFilterRequest
* @return PageResourceResponse from condition
*/
PageInfo<TaskDefinition> filterTaskDefinition(User loginUser,
TaskFilterRequest taskFilterRequest);
/**
* update task definition and upstream
*
* @param loginUser login user
* @param projectCode project code
* @param taskCode task definition code
* @param taskDefinitionJsonObj task definition json object
* @param upstreamCodes upstream task codes, sep comma
* @return update result code
*/
Map<String, Object> updateTaskWithUpstream(User loginUser,
long projectCode,
long taskCode,
String taskDefinitionJsonObj,
String upstreamCodes);
/**
* update task definition
*
* @param loginUser login user
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskDefinitionService.java
|
* @param projectCode project code
* @param taskCode task code
* @param version the version user want to switch
*/
Map<String, Object> switchVersion(User loginUser,
long projectCode,
long taskCode,
int version);
/**
* query the pagination versions info by one certain task definition code
*
* @param loginUser login user info to check auth
* @param projectCode project code
* @param taskCode task definition code
* @param pageNo page number
* @param pageSize page size
* @return the pagination task definition versions info of the certain task definition
*/
Result queryTaskDefinitionVersions(User loginUser,
long projectCode,
long taskCode,
int pageNo,
int pageSize);
/**
* delete the certain task definition version by version and code
*
* @param loginUser login user info
* @param projectCode project code
* @param taskCode the task definition code
* @param version the task definition version user want to delete
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskDefinitionService.java
|
* @return delete version result code
*/
Map<String, Object> deleteByCodeAndVersion(User loginUser,
long projectCode,
long taskCode,
int version);
/**
* query detail of task definition by code
*
* @param loginUser login user
* @param projectCode project code
* @param taskCode the task definition code
* @return task definition detail
*/
Map<String, Object> queryTaskDefinitionDetail(User loginUser,
long projectCode,
long taskCode);
/**
* query task definition list paging
*
* @param loginUser login user
* @param projectCode project code
* @param searchWorkflowName searchWorkflowName
* @param searchTaskName searchTaskName
* @param taskType taskType
* @param taskExecuteType taskExecuteType
* @param pageNo page number
* @param pageSize page size
* @return task definition page
*/
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskDefinitionService.java
|
Result queryTaskDefinitionListPaging(User loginUser,
long projectCode,
String searchWorkflowName,
String searchTaskName,
String taskType,
TaskExecuteType taskExecuteType,
Integer pageNo,
Integer pageSize);
/**
* gen task code list
*
* @param genNum gen num
* @return task code list
*/
Map<String, Object> genTaskCodeList(Integer genNum);
/**
* release task definition
*
* @param loginUser login user
* @param projectCode project code
* @param code task definition code
* @param releaseState releaseState
* @return update result code
*/
Map<String, Object> releaseTaskDefinition(User loginUser,
long projectCode,
long code,
ReleaseState releaseState);
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.service.impl;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION_CREATE;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION_DELETE;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION_UPDATE;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_VERSION_VIEW;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_DEFINITION;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_SWITCH_TO_THIS_VERSION;
import org.apache.dolphinscheduler.api.dto.task.TaskCreateRequest;
import org.apache.dolphinscheduler.api.dto.task.TaskFilterRequest;
import org.apache.dolphinscheduler.api.dto.task.TaskUpdateRequest;
import org.apache.dolphinscheduler.api.dto.taskRelation.TaskRelationUpdateUpstreamRequest;
import org.apache.dolphinscheduler.api.dto.workflow.WorkflowUpdateRequest;
import org.apache.dolphinscheduler.api.enums.Status;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
import org.apache.dolphinscheduler.api.exceptions.ServiceException;
import org.apache.dolphinscheduler.api.permission.PermissionCheck;
import org.apache.dolphinscheduler.api.service.ProcessDefinitionService;
import org.apache.dolphinscheduler.api.service.ProcessTaskRelationService;
import org.apache.dolphinscheduler.api.service.ProjectService;
import org.apache.dolphinscheduler.api.service.TaskDefinitionService;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.api.vo.TaskDefinitionVo;
import org.apache.dolphinscheduler.common.constants.Constants;
import org.apache.dolphinscheduler.common.enums.AuthorizationType;
import org.apache.dolphinscheduler.common.enums.ConditionType;
import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.common.enums.ReleaseState;
import org.apache.dolphinscheduler.common.enums.TaskExecuteType;
import org.apache.dolphinscheduler.common.enums.TimeoutFlag;
import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils;
import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils.CodeGenerateException;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation;
import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog;
import org.apache.dolphinscheduler.dao.entity.TaskMainInfo;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionLogMapper;
import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper;
import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode;
import org.apache.dolphinscheduler.service.process.ProcessService;
import org.apache.dolphinscheduler.service.task.TaskPluginManager;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
/**
* task definition service impl
*/
@Service
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDefinitionService {
private static final Logger logger = LoggerFactory.getLogger(TaskDefinitionServiceImpl.class);
private static final String RELEASESTATE = "releaseState";
@Autowired
private ProjectMapper projectMapper;
@Autowired
private ProjectService projectService;
@Autowired
private TaskDefinitionMapper taskDefinitionMapper;
@Autowired
private TaskDefinitionLogMapper taskDefinitionLogMapper;
@Autowired
private ProcessTaskRelationMapper processTaskRelationMapper;
@Autowired
private ProcessTaskRelationService processTaskRelationService;
@Autowired
private ProcessDefinitionMapper processDefinitionMapper;
@Autowired
private ProcessService processService;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
@Autowired
private TaskPluginManager taskPluginManager;
@Autowired
private ProcessDefinitionService processDefinitionService;
/**
* create task definition
*
* @param loginUser login user
* @param projectCode project code
* @param taskDefinitionJson task definition json
*/
@Transactional
@Override
public Map<String, Object> createTaskDefinition(User loginUser,
long projectCode,
String taskDefinitionJson) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_DEFINITION_CREATE);
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result);
if (!hasProjectAndWritePerm) {
return result;
}
List<TaskDefinitionLog> taskDefinitionLogs = JSONUtils.toList(taskDefinitionJson, TaskDefinitionLog.class);
if (CollectionUtils.isEmpty(taskDefinitionLogs)) {
logger.warn("Parameter taskDefinitionJson is invalid.");
putMsg(result, Status.DATA_IS_NOT_VALID, taskDefinitionJson);
return result;
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
for (TaskDefinitionLog taskDefinitionLog : taskDefinitionLogs) {
if (!taskPluginManager.checkTaskParameters(ParametersNode.builder()
.taskType(taskDefinitionLog.getTaskType())
.taskParams(taskDefinitionLog.getTaskParams())
.dependence(taskDefinitionLog.getDependence())
.build())) {
logger.warn("Task definition {} parameters are invalid.", taskDefinitionLog.getName());
putMsg(result, Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinitionLog.getName());
return result;
}
}
int saveTaskResult = processService.saveTaskDefine(loginUser, projectCode, taskDefinitionLogs, Boolean.TRUE);
if (saveTaskResult == Constants.DEFINITION_FAILURE) {
logger.error("Create task definition error, projectCode:{}.", projectCode);
putMsg(result, Status.CREATE_TASK_DEFINITION_ERROR);
throw new ServiceException(Status.CREATE_TASK_DEFINITION_ERROR);
}
Map<String, Object> resData = new HashMap<>();
resData.put("total", taskDefinitionLogs.size());
resData.put("code", StringUtils
.join(taskDefinitionLogs.stream().map(TaskDefinition::getCode).collect(Collectors.toList()), ","));
putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, resData);
return result;
}
private TaskDefinitionLog persist2TaskDefinitionLog(User user, TaskDefinition taskDefinition) {
TaskDefinitionLog taskDefinitionLog = new TaskDefinitionLog(taskDefinition);
taskDefinitionLog.setOperator(user.getId());
taskDefinitionLog.setOperateTime(new Date());
int result = taskDefinitionLogMapper.insert(taskDefinitionLog);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
if (result <= 0) {
throw new ServiceException(Status.CREATE_TASK_DEFINITION_LOG_ERROR, taskDefinitionLog.getName());
}
return taskDefinitionLog;
}
private void checkTaskDefinitionValid(User user, TaskDefinition taskDefinition, String permissions) {
Project project = projectMapper.queryByCode(taskDefinition.getProjectCode());
projectService.checkProjectAndAuthThrowException(user, project, permissions);
if (!taskPluginManager.checkTaskParameters(ParametersNode.builder()
.taskType(taskDefinition.getTaskType())
.taskParams(taskDefinition.getTaskParams())
.dependence(taskDefinition.getDependence())
.build())) {
throw new ServiceException(Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinition.getName());
}
}
private List<ProcessTaskRelation> updateTaskUpstreams(User user, long workflowCode, long taskCode,
String upstreamCodes) {
TaskRelationUpdateUpstreamRequest taskRelationUpdateUpstreamRequest = new TaskRelationUpdateUpstreamRequest();
taskRelationUpdateUpstreamRequest.setWorkflowCode(workflowCode);
taskRelationUpdateUpstreamRequest.setUpstreams(upstreamCodes);
return processTaskRelationService.updateUpstreamTaskDefinition(user, taskCode,
taskRelationUpdateUpstreamRequest);
}
private ProcessDefinition updateWorkflowLocation(User user, ProcessDefinition processDefinition) {
WorkflowUpdateRequest workflowUpdateRequest = new WorkflowUpdateRequest();
workflowUpdateRequest.setLocation(null);
return processDefinitionService.updateSingleProcessDefinition(user, processDefinition.getCode(),
workflowUpdateRequest);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
}
/**
* Create resource task definition
*
* @param loginUser login user
* @param taskCreateRequest task definition json
* @return new TaskDefinition have created
*/
@Override
@Transactional
public TaskDefinition createTaskDefinitionV2(User loginUser,
TaskCreateRequest taskCreateRequest) {
TaskDefinition taskDefinition = taskCreateRequest.convert2TaskDefinition();
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(taskCreateRequest.getWorkflowCode());
if (processDefinition == null) {
throw new ServiceException(Status.PROCESS_DEFINE_NOT_EXIST, taskCreateRequest.getWorkflowCode());
}
if (taskDefinition.getProjectCode() == 0L) {
taskDefinition.setProjectCode(processDefinition.getProjectCode());
}
this.checkTaskDefinitionValid(loginUser, taskDefinition, TASK_DEFINITION_CREATE);
long taskDefinitionCode;
try {
taskDefinitionCode = CodeGenerateUtils.getInstance().genCode();
} catch (CodeGenerateException e) {
throw new ServiceException(Status.INTERNAL_SERVER_ERROR_ARGS);
}
taskDefinition.setCode(taskDefinitionCode);
int create = taskDefinitionMapper.insert(taskDefinition);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
if (create <= 0) {
throw new ServiceException(Status.CREATE_TASK_DEFINITION_ERROR);
}
this.persist2TaskDefinitionLog(loginUser, taskDefinition);
this.updateTaskUpstreams(loginUser, taskCreateRequest.getWorkflowCode(), taskDefinition.getCode(),
taskCreateRequest.getUpstreamTasksCodes());
this.updateWorkflowLocation(loginUser, processDefinition);
return taskDefinition;
}
/**
* create single task definition that binds the workflow
*
* @param loginUser login user
* @param projectCode project code
* @param processDefinitionCode process definition code
* @param taskDefinitionJsonObj task definition json object
* @param upstreamCodes upstream task codes, sep comma
* @return create result code
*/
@Transactional
@Override
public Map<String, Object> createTaskBindsWorkFlow(User loginUser,
long projectCode,
long processDefinitionCode,
String taskDefinitionJsonObj,
String upstreamCodes) {
Project project = projectMapper.queryByCode(projectCode);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_DEFINITION_CREATE);
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result);
if (!hasProjectAndWritePerm) {
return result;
}
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefinitionCode);
if (processDefinition == null || projectCode != processDefinition.getProjectCode()) {
logger.error("Process definition does not exist, processDefinitionCode:{}.", processDefinitionCode);
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, String.valueOf(processDefinitionCode));
return result;
}
if (processDefinition.getReleaseState() == ReleaseState.ONLINE) {
logger.warn("Task definition can not be created due to process definition is {}, processDefinitionCode:{}.",
ReleaseState.ONLINE.getDescp(), processDefinition.getCode());
putMsg(result, Status.PROCESS_DEFINE_STATE_ONLINE, String.valueOf(processDefinitionCode));
return result;
}
TaskDefinitionLog taskDefinition = JSONUtils.parseObject(taskDefinitionJsonObj, TaskDefinitionLog.class);
if (taskDefinition == null) {
logger.warn("Parameter taskDefinitionJsonObj is invalid json.");
putMsg(result, Status.DATA_IS_NOT_VALID, taskDefinitionJsonObj);
return result;
}
if (!taskPluginManager.checkTaskParameters(ParametersNode.builder()
.taskType(taskDefinition.getTaskType())
.taskParams(taskDefinition.getTaskParams())
.dependence(taskDefinition.getDependence())
.build())) {
logger.error("Task definition {} parameters are invalid", taskDefinition.getName());
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
putMsg(result, Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinition.getName());
return result;
}
long taskCode = taskDefinition.getCode();
if (taskCode == 0) {
taskDefinition.setCode(CodeGenerateUtils.getInstance().genCode());
}
List<ProcessTaskRelationLog> processTaskRelationLogList =
processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode)
.stream()
.map(ProcessTaskRelationLog::new)
.collect(Collectors.toList());
if (StringUtils.isNotBlank(upstreamCodes)) {
Set<Long> upstreamTaskCodes = Arrays.stream(upstreamCodes.split(Constants.COMMA)).map(Long::parseLong)
.collect(Collectors.toSet());
List<TaskDefinition> upstreamTaskDefinitionList = taskDefinitionMapper.queryByCodeList(upstreamTaskCodes);
Set<Long> queryUpStreamTaskCodes =
upstreamTaskDefinitionList.stream().map(TaskDefinition::getCode).collect(Collectors.toSet());
Set<Long> diffCode = upstreamTaskCodes.stream().filter(code -> !queryUpStreamTaskCodes.contains(code))
.collect(Collectors.toSet());
if (CollectionUtils.isNotEmpty(diffCode)) {
String taskCodes = StringUtils.join(diffCode, Constants.COMMA);
logger.error("Some task definitions with parameter upstreamCodes do not exist, taskDefinitionCodes:{}.",
taskCodes);
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCodes);
return result;
}
for (TaskDefinition upstreamTask : upstreamTaskDefinitionList) {
ProcessTaskRelationLog processTaskRelationLog = new ProcessTaskRelationLog();
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
processTaskRelationLog.setPreTaskCode(upstreamTask.getCode());
processTaskRelationLog.setPreTaskVersion(upstreamTask.getVersion());
processTaskRelationLog.setPostTaskCode(taskCode);
processTaskRelationLog.setPostTaskVersion(Constants.VERSION_FIRST);
processTaskRelationLog.setConditionType(ConditionType.NONE);
processTaskRelationLog.setConditionParams("{}");
processTaskRelationLogList.add(processTaskRelationLog);
}
} else {
ProcessTaskRelationLog processTaskRelationLog = new ProcessTaskRelationLog();
processTaskRelationLog.setPreTaskCode(0);
processTaskRelationLog.setPreTaskVersion(0);
processTaskRelationLog.setPostTaskCode(taskCode);
processTaskRelationLog.setPostTaskVersion(Constants.VERSION_FIRST);
processTaskRelationLog.setConditionType(ConditionType.NONE);
processTaskRelationLog.setConditionParams("{}");
processTaskRelationLogList.add(processTaskRelationLog);
}
int insertResult = processService.saveTaskRelation(loginUser, projectCode, processDefinition.getCode(),
processDefinition.getVersion(),
processTaskRelationLogList, Lists.newArrayList(), Boolean.TRUE);
if (insertResult != Constants.EXIT_CODE_SUCCESS) {
logger.error(
"Save new version process task relations error, processDefinitionCode:{}, processDefinitionVersion:{}.",
processDefinition.getCode(), processDefinition.getVersion());
putMsg(result, Status.CREATE_PROCESS_TASK_RELATION_ERROR);
throw new ServiceException(Status.CREATE_PROCESS_TASK_RELATION_ERROR);
} else
logger.info(
"Save new version process task relations complete, processDefinitionCode:{}, processDefinitionVersion:{}.",
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
processDefinition.getCode(), processDefinition.getVersion());
int saveTaskResult =
processService.saveTaskDefine(loginUser, projectCode, Lists.newArrayList(taskDefinition), Boolean.TRUE);
if (saveTaskResult == Constants.DEFINITION_FAILURE) {
logger.error("Save task definition error, projectCode:{}, taskDefinitionCode:{}.", projectCode,
taskDefinition.getCode());
putMsg(result, Status.CREATE_TASK_DEFINITION_ERROR);
throw new ServiceException(Status.CREATE_TASK_DEFINITION_ERROR);
} else
logger.info("Save task definition complete, projectCode:{}, taskDefinitionCode:{}.", projectCode,
taskDefinition.getCode());
putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, taskDefinition);
return result;
}
/**
* query task definition
*
* @param loginUser login user
* @param projectCode project code
* @param processCode process code
* @param taskName task name
*/
@Override
public Map<String, Object> queryTaskDefinitionByName(User loginUser, long projectCode, long processCode,
String taskName) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_DEFINITION);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
TaskDefinition taskDefinition = taskDefinitionMapper.queryByName(project.getCode(), processCode, taskName);
if (taskDefinition == null) {
logger.error("Task definition does not exist, taskName:{}.", taskName);
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskName);
} else {
result.put(Constants.DATA_LIST, taskDefinition);
putMsg(result, Status.SUCCESS);
}
return result;
}
/**
* Whether task definition can be deleted or not
*/
private void taskCanDeleteValid(User user, TaskDefinition taskDefinition, User loginUser) {
Project project = projectMapper.queryByCode(taskDefinition.getProjectCode());
projectService.checkProjectAndAuthThrowException(user, project, TASK_DEFINITION_DELETE);
Map<String, Object> result = new HashMap<>();
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result);
if (!hasProjectAndWritePerm) {
throw new ServiceException(Status.TASK_DEFINE_STATE_ONLINE, taskDefinition.getCode());
}
if (processService.isTaskOnline(taskDefinition.getCode()) && taskDefinition.getFlag() == Flag.YES) {
throw new ServiceException(Status.TASK_DEFINE_STATE_ONLINE, taskDefinition.getCode());
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
List<ProcessTaskRelation> processTaskRelationList =
processTaskRelationMapper.queryDownstreamByTaskCode(taskDefinition.getCode());
if (CollectionUtils.isNotEmpty(processTaskRelationList)) {
Set<Long> postTaskCodes = processTaskRelationList
.stream()
.map(ProcessTaskRelation::getPostTaskCode)
.collect(Collectors.toSet());
String postTaskCodesStr = StringUtils.join(postTaskCodes, Constants.COMMA);
throw new ServiceException(Status.TASK_HAS_DOWNSTREAM, postTaskCodesStr);
}
}
/**
* Delete resource task definition by code
*
* Only task release state offline and no downstream tasks can be deleted, will also remove the exists
* task relation [upstreamTaskCode, taskCode]
*
* @param loginUser login user
* @param taskCode task code
*/
@Transactional
@Override
public void deleteTaskDefinitionByCode(User loginUser, long taskCode) {
TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode);
if (taskDefinition == null) {
throw new ServiceException(Status.TASK_DEFINE_NOT_EXIST, taskCode);
}
this.taskCanDeleteValid(loginUser, taskDefinition, loginUser);
int delete = taskDefinitionMapper.deleteByCode(taskCode);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
if (delete <= 0) {
throw new ServiceException(Status.DELETE_TASK_DEFINE_BY_CODE_MSG_ERROR, taskDefinition.getCode());
}
List<ProcessTaskRelation> taskRelationList =
processTaskRelationMapper.queryUpstreamByCode(taskDefinition.getProjectCode(), taskCode);
if (CollectionUtils.isNotEmpty(taskRelationList)) {
logger.debug(
"Task definition has upstream tasks, start handle them after delete task, taskDefinitionCode:{}.",
taskCode);
long processDefinitionCode = taskRelationList.get(0).getProcessDefinitionCode();
List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper
.queryByProcessCode(taskDefinition.getProjectCode(), processDefinitionCode);
List<ProcessTaskRelation> relationList = processTaskRelations.stream()
.filter(r -> r.getPostTaskCode() != taskCode).collect(Collectors.toList());
updateDag(loginUser, processDefinitionCode, relationList, Lists.newArrayList());
}
}
private void updateDag(User loginUser, long processDefinitionCode,
List<ProcessTaskRelation> processTaskRelationList,
List<TaskDefinitionLog> taskDefinitionLogs) {
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefinitionCode);
if (processDefinition == null) {
logger.error("Process definition does not exist, processDefinitionCode:{}.", processDefinitionCode);
throw new ServiceException(Status.PROCESS_DEFINE_NOT_EXIST);
}
int insertVersion = processService.saveProcessDefine(loginUser, processDefinition, Boolean.TRUE, Boolean.TRUE);
if (insertVersion <= 0) {
logger.error("Update process definition error, projectCode:{}, processDefinitionCode:{}.",
processDefinition.getProjectCode(), processDefinitionCode);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
throw new ServiceException(Status.UPDATE_PROCESS_DEFINITION_ERROR);
} else
logger.info(
"Save new version process definition complete, projectCode:{}, processDefinitionCode:{}, newVersion:{}.",
processDefinition.getProjectCode(), processDefinitionCode, insertVersion);
List<ProcessTaskRelationLog> relationLogs =
processTaskRelationList.stream().map(ProcessTaskRelationLog::new).collect(Collectors.toList());
int insertResult = processService.saveTaskRelation(loginUser, processDefinition.getProjectCode(),
processDefinition.getCode(),
insertVersion, relationLogs, taskDefinitionLogs, Boolean.TRUE);
if (insertResult == Constants.EXIT_CODE_SUCCESS) {
logger.info(
"Save new version task relations complete, projectCode:{}, processDefinitionCode:{}, newVersion:{}.",
processDefinition.getProjectCode(), processDefinitionCode, insertVersion);
} else {
logger.error("Update task relations error, projectCode:{}, processDefinitionCode:{}.",
processDefinition.getProjectCode(), processDefinitionCode);
throw new ServiceException(Status.UPDATE_PROCESS_DEFINITION_ERROR);
}
}
/**
* update task definition
*
* @param loginUser login user
* @param projectCode project code
* @param taskCode task code
* @param taskDefinitionJsonObj task definition json object
*/
@Transactional
@Override
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
public Map<String, Object> updateTaskDefinition(User loginUser, long projectCode, long taskCode,
String taskDefinitionJsonObj) {
Map<String, Object> result = new HashMap<>();
TaskDefinitionLog taskDefinitionToUpdate =
updateTask(loginUser, projectCode, taskCode, taskDefinitionJsonObj, result);
if (taskDefinitionToUpdate == null) {
return result;
}
List<ProcessTaskRelation> taskRelationList =
processTaskRelationMapper.queryUpstreamByCode(projectCode, taskCode);
if (CollectionUtils.isNotEmpty(taskRelationList)) {
logger.info(
"Task definition has upstream tasks, start handle them after update task, taskDefinitionCode:{}.",
taskCode);
long processDefinitionCode = taskRelationList.get(0).getProcessDefinitionCode();
List<ProcessTaskRelation> processTaskRelations =
processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode);
updateDag(loginUser, processDefinitionCode, processTaskRelations,
Lists.newArrayList(taskDefinitionToUpdate));
}
logger.info("Update task definition complete, projectCode:{}, taskDefinitionCode:{}.", projectCode, taskCode);
result.put(Constants.DATA_LIST, taskCode);
putMsg(result, Status.SUCCESS);
return result;
}
private void TaskDefinitionUpdateValid(TaskDefinition taskDefinitionOriginal, TaskDefinition taskDefinitionUpdate) {
if (processService.isTaskOnline(taskDefinitionOriginal.getCode())
&& taskDefinitionOriginal.getFlag() == Flag.YES) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
if (taskDefinitionOriginal.getTaskExecuteType() != TaskExecuteType.STREAM) {
throw new ServiceException(Status.NOT_SUPPORT_UPDATE_TASK_DEFINITION);
}
}
if (taskDefinitionOriginal.equals(taskDefinitionUpdate)) {
throw new ServiceException(Status.TASK_DEFINITION_NOT_CHANGE, taskDefinitionOriginal.getCode());
}
Integer version = taskDefinitionLogMapper.queryMaxVersionForDefinition(taskDefinitionOriginal.getCode());
if (version == null || version == 0) {
throw new ServiceException(Status.DATA_IS_NOT_VALID, taskDefinitionOriginal.getCode());
}
}
/**
* update task definition
*
* @param loginUser login user
* @param taskCode task code
* @param taskUpdateRequest task definition json object
* @return new TaskDefinition have updated
*/
@Transactional
@Override
public TaskDefinition updateTaskDefinitionV2(User loginUser,
long taskCode,
TaskUpdateRequest taskUpdateRequest) {
TaskDefinition taskDefinitionOriginal = taskDefinitionMapper.queryByCode(taskCode);
if (taskDefinitionOriginal == null) {
throw new ServiceException(Status.TASK_DEFINITION_NOT_EXISTS, taskCode);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
}
TaskDefinition taskDefinitionUpdate;
try {
taskDefinitionUpdate = taskUpdateRequest.mergeIntoTaskDefinition(taskDefinitionOriginal);
} catch (InvocationTargetException | IllegalAccessException | InstantiationException
| NoSuchMethodException e) {
throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR, taskUpdateRequest.toString());
}
this.checkTaskDefinitionValid(loginUser, taskDefinitionUpdate, TASK_DEFINITION_UPDATE);
this.TaskDefinitionUpdateValid(taskDefinitionOriginal, taskDefinitionUpdate);
int update = taskDefinitionMapper.updateById(taskDefinitionUpdate);
if (update <= 0) {
throw new ServiceException(Status.UPDATE_TASK_DEFINITION_ERROR);
}
TaskDefinitionLog taskDefinitionLog = this.persist2TaskDefinitionLog(loginUser, taskDefinitionUpdate);
List<ProcessTaskRelation> taskRelationList =
processTaskRelationMapper.queryUpstreamByCode(taskDefinitionUpdate.getProjectCode(), taskCode);
if (CollectionUtils.isNotEmpty(taskRelationList)) {
logger.info(
"Task definition has upstream tasks, start handle them after update task, taskDefinitionCode:{}.",
taskCode);
long processDefinitionCode = taskRelationList.get(0).getProcessDefinitionCode();
List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper
.queryByProcessCode(taskDefinitionUpdate.getProjectCode(), processDefinitionCode);
updateDag(loginUser, processDefinitionCode, processTaskRelations, Lists.newArrayList(taskDefinitionLog));
}
this.updateTaskUpstreams(loginUser, taskUpdateRequest.getWorkflowCode(), taskDefinitionUpdate.getCode(),
taskUpdateRequest.getUpstreamTasksCodes());
return taskDefinitionUpdate;
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
/**
* Get resource task definition by code
*
* @param loginUser login user
* @param taskCode task code
* @return TaskDefinition
*/
@Override
public TaskDefinition getTaskDefinition(User loginUser,
long taskCode) {
TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode);
if (taskDefinition == null) {
throw new ServiceException(Status.TASK_DEFINE_NOT_EXIST, taskCode);
}
Project project = projectMapper.queryByCode(taskDefinition.getProjectCode());
projectService.checkProjectAndAuthThrowException(loginUser, project, TASK_DEFINITION);
return taskDefinition;
}
/**
* Get resource task definition according to query parameter
*
* @param loginUser login user
* @param taskFilterRequest taskFilterRequest object you want to filter the resource task definitions
* @return TaskDefinitions of page
*/
@Override
public PageInfo<TaskDefinition> filterTaskDefinition(User loginUser,
TaskFilterRequest taskFilterRequest) {
TaskDefinition taskDefinition = taskFilterRequest.convert2TaskDefinition();
if (taskDefinition.getProjectName() != null) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
Project project = projectMapper.queryByName(taskDefinition.getProjectName());
projectService.checkProjectAndAuthThrowException(loginUser, project, WORKFLOW_DEFINITION);
taskDefinition.setProjectCode(project.getCode());
}
Page<TaskDefinition> page =
new Page<>(taskFilterRequest.getPageNo(), taskFilterRequest.getPageSize());
IPage<TaskDefinition> taskDefinitionIPage =
taskDefinitionMapper.filterTaskDefinition(page, taskDefinition);
PageInfo<TaskDefinition> pageInfo =
new PageInfo<>(taskFilterRequest.getPageNo(), taskFilterRequest.getPageSize());
pageInfo.setTotal((int) taskDefinitionIPage.getTotal());
pageInfo.setTotalList(taskDefinitionIPage.getRecords());
return pageInfo;
}
private TaskDefinitionLog updateTask(User loginUser, long projectCode, long taskCode, String taskDefinitionJsonObj,
Map<String, Object> result) {
Project project = projectMapper.queryByCode(projectCode);
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result);
if (!hasProjectAndWritePerm) {
return null;
}
TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode);
if (taskDefinition == null) {
logger.error("Task definition does not exist, taskDefinitionCode:{}.", taskCode);
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, String.valueOf(taskCode));
return null;
}
if (processService.isTaskOnline(taskCode) && taskDefinition.getFlag() == Flag.YES) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
if (taskDefinition.getTaskExecuteType() != TaskExecuteType.STREAM) {
logger.warn("Only {} type task can be updated without online check, taskDefinitionCode:{}.",
TaskExecuteType.STREAM, taskCode);
putMsg(result, Status.NOT_SUPPORT_UPDATE_TASK_DEFINITION);
return null;
}
}
TaskDefinitionLog taskDefinitionToUpdate =
JSONUtils.parseObject(taskDefinitionJsonObj, TaskDefinitionLog.class);
if (TimeoutFlag.CLOSE == taskDefinition.getTimeoutFlag()) {
taskDefinition.setTimeoutNotifyStrategy(null);
}
if (taskDefinition.equals(taskDefinitionToUpdate)) {
logger.warn("Task definition does not need update because no change, taskDefinitionCode:{}.", taskCode);
putMsg(result, Status.TASK_DEFINITION_NOT_MODIFY_ERROR, String.valueOf(taskCode));
return null;
}
if (taskDefinitionToUpdate == null) {
logger.warn("Parameter taskDefinitionJson is invalid.");
putMsg(result, Status.DATA_IS_NOT_VALID, taskDefinitionJsonObj);
return null;
}
if (!taskPluginManager.checkTaskParameters(ParametersNode.builder()
.taskType(taskDefinitionToUpdate.getTaskType())
.taskParams(taskDefinitionToUpdate.getTaskParams())
.dependence(taskDefinitionToUpdate.getDependence())
.build())) {
logger.warn("Task definition parameters are invalid, taskDefinitionName:{}.",
taskDefinitionToUpdate.getName());
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
putMsg(result, Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinitionToUpdate.getName());
return null;
}
Integer version = taskDefinitionLogMapper.queryMaxVersionForDefinition(taskCode);
if (version == null || version == 0) {
logger.error("Max version task definitionLog can not be found in database, taskDefinitionCode:{}.",
taskCode);
putMsg(result, Status.DATA_IS_NOT_VALID, taskCode);
return null;
}
Date now = new Date();
taskDefinitionToUpdate.setCode(taskCode);
taskDefinitionToUpdate.setId(taskDefinition.getId());
taskDefinitionToUpdate.setProjectCode(projectCode);
taskDefinitionToUpdate.setUserId(taskDefinition.getUserId());
taskDefinitionToUpdate.setVersion(++version);
taskDefinitionToUpdate.setTaskType(taskDefinitionToUpdate.getTaskType().toUpperCase());
taskDefinitionToUpdate.setResourceIds(processService.getResourceIds(taskDefinitionToUpdate));
taskDefinitionToUpdate.setUpdateTime(now);
int update = taskDefinitionMapper.updateById(taskDefinitionToUpdate);
taskDefinitionToUpdate.setOperator(loginUser.getId());
taskDefinitionToUpdate.setOperateTime(now);
taskDefinitionToUpdate.setCreateTime(now);
taskDefinitionToUpdate.setId(null);
int insert = taskDefinitionLogMapper.insert(taskDefinitionToUpdate);
if ((update & insert) != 1) {
logger.error("Update task definition or definitionLog error, projectCode:{}, taskDefinitionCode:{}.",
projectCode, taskCode);
putMsg(result, Status.UPDATE_TASK_DEFINITION_ERROR);
throw new ServiceException(Status.UPDATE_TASK_DEFINITION_ERROR);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
} else
logger.info(
"Update task definition and definitionLog complete, projectCode:{}, taskDefinitionCode:{}, newTaskVersion:{}.",
projectCode, taskCode, taskDefinitionToUpdate.getVersion());
List<ProcessTaskRelation> processTaskRelations = processTaskRelationMapper
.queryByTaskCode(taskDefinitionToUpdate.getCode());
if (CollectionUtils.isNotEmpty(processTaskRelations)) {
for (ProcessTaskRelation processTaskRelation : processTaskRelations) {
if (taskCode == processTaskRelation.getPreTaskCode()) {
processTaskRelation.setPreTaskVersion(version);
} else if (taskCode == processTaskRelation.getPostTaskCode()) {
processTaskRelation.setPostTaskVersion(version);
}
int count = processTaskRelationMapper.updateProcessTaskRelationTaskVersion(processTaskRelation);
if (count != 1) {
logger.error("batch update process task relation error, projectCode:{}, taskDefinitionCode:{}.",
projectCode, taskCode);
putMsg(result, Status.PROCESS_TASK_RELATION_BATCH_UPDATE_ERROR);
throw new ServiceException(Status.PROCESS_TASK_RELATION_BATCH_UPDATE_ERROR);
}
}
}
return taskDefinitionToUpdate;
}
/**
* update task definition and upstream
*
* @param loginUser login user
* @param projectCode project code
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
* @param taskCode task definition code
* @param taskDefinitionJsonObj task definition json object
* @param upstreamCodes upstream task codes, sep comma
* @return update result code
*/
@Override
public Map<String, Object> updateTaskWithUpstream(User loginUser, long projectCode, long taskCode,
String taskDefinitionJsonObj, String upstreamCodes) {
Map<String, Object> result = new HashMap<>();
TaskDefinitionLog taskDefinitionToUpdate =
updateTask(loginUser, projectCode, taskCode, taskDefinitionJsonObj, result);
if (result.get(Constants.STATUS) != Status.SUCCESS && taskDefinitionToUpdate == null) {
return result;
}
List<ProcessTaskRelation> upstreamTaskRelations =
processTaskRelationMapper.queryUpstreamByCode(projectCode, taskCode);
Set<Long> upstreamCodeSet =
upstreamTaskRelations.stream().map(ProcessTaskRelation::getPreTaskCode).collect(Collectors.toSet());
Set<Long> upstreamTaskCodes = Collections.emptySet();
if (StringUtils.isNotEmpty(upstreamCodes)) {
upstreamTaskCodes = Arrays.stream(upstreamCodes.split(Constants.COMMA)).map(Long::parseLong)
.collect(Collectors.toSet());
}
if (CollectionUtils.isEqualCollection(upstreamCodeSet, upstreamTaskCodes) && taskDefinitionToUpdate == null) {
putMsg(result, Status.SUCCESS);
return result;
} else {
if (taskDefinitionToUpdate == null) {
taskDefinitionToUpdate = JSONUtils.parseObject(taskDefinitionJsonObj, TaskDefinitionLog.class);
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
}
Map<Long, TaskDefinition> queryUpStreamTaskCodeMap;
if (CollectionUtils.isNotEmpty(upstreamTaskCodes)) {
List<TaskDefinition> upstreamTaskDefinitionList = taskDefinitionMapper.queryByCodeList(upstreamTaskCodes);
queryUpStreamTaskCodeMap = upstreamTaskDefinitionList.stream()
.collect(Collectors.toMap(TaskDefinition::getCode, taskDefinition -> taskDefinition));
upstreamTaskCodes.removeAll(queryUpStreamTaskCodeMap.keySet());
if (CollectionUtils.isNotEmpty(upstreamTaskCodes)) {
String notExistTaskCodes = StringUtils.join(upstreamTaskCodes, Constants.COMMA);
logger.error("Some task definitions in parameter upstreamTaskCodes do not exist, notExistTaskCodes:{}.",
notExistTaskCodes);
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, notExistTaskCodes);
return result;
}
} else {
queryUpStreamTaskCodeMap = new HashMap<>();
}
if (CollectionUtils.isNotEmpty(upstreamTaskCodes)) {
ProcessTaskRelation taskRelation = upstreamTaskRelations.get(0);
List<ProcessTaskRelation> processTaskRelations =
processTaskRelationMapper.queryByProcessCode(projectCode, taskRelation.getProcessDefinitionCode());
List<ProcessTaskRelation> processTaskRelationList = Lists.newArrayList(processTaskRelations);
List<ProcessTaskRelation> relationList = Lists.newArrayList();
for (ProcessTaskRelation processTaskRelation : processTaskRelationList) {
if (processTaskRelation.getPostTaskCode() == taskCode) {
if (queryUpStreamTaskCodeMap.containsKey(processTaskRelation.getPreTaskCode())
&& processTaskRelation.getPreTaskCode() != 0L) {
queryUpStreamTaskCodeMap.remove(processTaskRelation.getPreTaskCode());
} else {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
processTaskRelation.setPreTaskCode(0L);
processTaskRelation.setPreTaskVersion(0);
relationList.add(processTaskRelation);
}
}
}
processTaskRelationList.removeAll(relationList);
for (Map.Entry<Long, TaskDefinition> queryUpStreamTask : queryUpStreamTaskCodeMap.entrySet()) {
taskRelation.setPreTaskCode(queryUpStreamTask.getKey());
taskRelation.setPreTaskVersion(queryUpStreamTask.getValue().getVersion());
processTaskRelationList.add(taskRelation);
}
if (MapUtils.isEmpty(queryUpStreamTaskCodeMap) && CollectionUtils.isNotEmpty(processTaskRelationList)) {
processTaskRelationList.add(processTaskRelationList.get(0));
}
updateDag(loginUser, taskRelation.getProcessDefinitionCode(), processTaskRelations,
Lists.newArrayList(taskDefinitionToUpdate));
}
logger.info(
"Update task with upstream tasks complete, projectCode:{}, taskDefinitionCode:{}, upstreamTaskCodes:{}.",
projectCode, taskCode, upstreamTaskCodes);
result.put(Constants.DATA_LIST, taskCode);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* switch task definition
*
* @param loginUser login user
* @param projectCode project code
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
* @param taskCode task code
* @param version the version user want to switch
*/
@Transactional
@Override
public Map<String, Object> switchVersion(User loginUser, long projectCode, long taskCode, int version) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, WORKFLOW_SWITCH_TO_THIS_VERSION);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
if (processService.isTaskOnline(taskCode)) {
logger.warn(
"Task definition version can not be switched due to process definition is {}, taskDefinitionCode:{}.",
ReleaseState.ONLINE.getDescp(), taskCode);
putMsg(result, Status.PROCESS_DEFINE_STATE_ONLINE);
return result;
}
TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode);
if (taskDefinition == null || projectCode != taskDefinition.getProjectCode()) {
logger.error("Task definition does not exist, taskDefinitionCode:{}.", taskCode);
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, String.valueOf(taskCode));
return result;
}
TaskDefinitionLog taskDefinitionUpdate =
taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(taskCode, version);
taskDefinitionUpdate.setUserId(loginUser.getId());
taskDefinitionUpdate.setUpdateTime(new Date());
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
taskDefinitionUpdate.setId(taskDefinition.getId());
int switchVersion = taskDefinitionMapper.updateById(taskDefinitionUpdate);
if (switchVersion > 0) {
List<ProcessTaskRelation> taskRelationList =
processTaskRelationMapper.queryUpstreamByCode(projectCode, taskCode);
if (CollectionUtils.isNotEmpty(taskRelationList)) {
logger.info(
"Task definition has upstream tasks, start handle them after switch task, taskDefinitionCode:{}.",
taskCode);
long processDefinitionCode = taskRelationList.get(0).getProcessDefinitionCode();
List<ProcessTaskRelation> processTaskRelations =
processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode);
updateDag(loginUser, processDefinitionCode, processTaskRelations,
Lists.newArrayList(taskDefinitionUpdate));
} else {
logger.info(
"Task definition version switch complete, switch task version to {}, taskDefinitionCode:{}.",
version, taskCode);
putMsg(result, Status.SUCCESS);
}
} else {
logger.error("Task definition version switch error, taskDefinitionCode:{}.", taskCode);
putMsg(result, Status.SWITCH_TASK_DEFINITION_VERSION_ERROR);
}
return result;
}
@Override
public Result queryTaskDefinitionVersions(User loginUser,
long projectCode,
long taskCode,
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
int pageNo,
int pageSize) {
Result result = new Result();
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> checkResult =
projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_VERSION_VIEW);
Status resultStatus = (Status) checkResult.get(Constants.STATUS);
if (resultStatus != Status.SUCCESS) {
putMsg(result, resultStatus);
return result;
}
PageInfo<TaskDefinitionLog> pageInfo = new PageInfo<>(pageNo, pageSize);
Page<TaskDefinitionLog> page = new Page<>(pageNo, pageSize);
IPage<TaskDefinitionLog> taskDefinitionVersionsPaging =
taskDefinitionLogMapper.queryTaskDefinitionVersionsPaging(page, taskCode, projectCode);
List<TaskDefinitionLog> taskDefinitionLogs = taskDefinitionVersionsPaging.getRecords();
pageInfo.setTotalList(taskDefinitionLogs);
pageInfo.setTotal((int) taskDefinitionVersionsPaging.getTotal());
result.setData(pageInfo);
putMsg(result, Status.SUCCESS);
return result;
}
@Override
public Map<String, Object> deleteByCodeAndVersion(User loginUser, long projectCode, long taskCode, int version) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_DEFINITION_DELETE);
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
if (!hasProjectAndWritePerm) {
return result;
}
TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode);
if (taskDefinition == null) {
logger.error("Task definition does not exist, taskDefinitionCode:{}.", taskCode);
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, String.valueOf(taskCode));
} else {
if (taskDefinition.getVersion() == version) {
logger.warn(
"Task definition can not be deleted due to version is being used, projectCode:{}, taskDefinitionCode:{}, version:{}.",
projectCode, taskCode, version);
putMsg(result, Status.MAIN_TABLE_USING_VERSION);
return result;
}
int delete = taskDefinitionLogMapper.deleteByCodeAndVersion(taskCode, version);
if (delete > 0) {
logger.info(
"Task definition version delete complete, projectCode:{}, taskDefinitionCode:{}, version:{}.",
projectCode, taskCode, version);
putMsg(result, Status.SUCCESS);
} else {
logger.error("Task definition version delete error, projectCode:{}, taskDefinitionCode:{}, version:{}.",
projectCode, taskCode, version);
putMsg(result, Status.DELETE_TASK_DEFINITION_VERSION_ERROR);
}
}
return result;
}
@Override
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
public Map<String, Object> queryTaskDefinitionDetail(User loginUser, long projectCode, long taskCode) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_DEFINITION);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return result;
}
TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(taskCode);
if (taskDefinition == null || projectCode != taskDefinition.getProjectCode()) {
logger.error("Task definition does not exist, taskDefinitionCode:{}.", taskCode);
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, String.valueOf(taskCode));
} else {
List<ProcessTaskRelation> taskRelationList = processTaskRelationMapper
.queryByCode(projectCode, 0, 0, taskCode);
if (CollectionUtils.isNotEmpty(taskRelationList)) {
taskRelationList = taskRelationList.stream()
.filter(v -> v.getPreTaskCode() != 0).collect(Collectors.toList());
}
TaskDefinitionVo taskDefinitionVo = TaskDefinitionVo.fromTaskDefinition(taskDefinition);
taskDefinitionVo.setProcessTaskRelationList(taskRelationList);
result.put(Constants.DATA_LIST, taskDefinitionVo);
putMsg(result, Status.SUCCESS);
}
return result;
}
@Override
public Result queryTaskDefinitionListPaging(User loginUser,
long projectCode,
String searchWorkflowName,
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
String searchTaskName,
String taskType,
TaskExecuteType taskExecuteType,
Integer pageNo,
Integer pageSize) {
Result result = new Result();
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> checkResult =
projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_DEFINITION);
Status resultStatus = (Status) checkResult.get(Constants.STATUS);
if (resultStatus != Status.SUCCESS) {
putMsg(result, resultStatus);
return result;
}
taskType = taskType == null ? StringUtils.EMPTY : taskType;
Page<TaskMainInfo> page = new Page<>(pageNo, pageSize);
IPage<TaskMainInfo> taskMainInfoIPage =
taskDefinitionMapper.queryDefineListPaging(page, projectCode, searchWorkflowName,
searchTaskName, taskType, taskExecuteType);
List<TaskMainInfo> records = taskMainInfoIPage.getRecords();
if (CollectionUtils.isNotEmpty(records)) {
Map<Long, TaskMainInfo> taskMainInfoMap = new HashMap<>();
for (TaskMainInfo info : records) {
taskMainInfoMap.compute(info.getTaskCode(), (k, v) -> {
if (v == null) {
Map<Long, String> upstreamTaskMap = new HashMap<>();
if (info.getUpstreamTaskCode() != 0) {
upstreamTaskMap.put(info.getUpstreamTaskCode(), info.getUpstreamTaskName());
info.setUpstreamTaskCode(0L);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
info.setUpstreamTaskName(StringUtils.EMPTY);
}
info.setUpstreamTaskMap(upstreamTaskMap);
v = info;
}
if (info.getUpstreamTaskCode() != 0) {
v.getUpstreamTaskMap().put(info.getUpstreamTaskCode(), info.getUpstreamTaskName());
}
return v;
});
}
taskMainInfoIPage.setRecords(Lists.newArrayList(taskMainInfoMap.values()));
}
PageInfo<TaskMainInfo> pageInfo = new PageInfo<>(pageNo, pageSize);
pageInfo.setTotal((int) taskMainInfoIPage.getTotal());
pageInfo.setTotalList(taskMainInfoIPage.getRecords());
result.setData(pageInfo);
putMsg(result, Status.SUCCESS);
return result;
}
@Override
public Map<String, Object> genTaskCodeList(Integer genNum) {
Map<String, Object> result = new HashMap<>();
if (genNum == null || genNum < 1 || genNum > 100) {
logger.warn("Parameter genNum must be great than 1 and less than 100.");
putMsg(result, Status.DATA_IS_NOT_VALID, genNum);
return result;
}
List<Long> taskCodes = new ArrayList<>();
try {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
for (int i = 0; i < genNum; i++) {
taskCodes.add(CodeGenerateUtils.getInstance().genCode());
}
} catch (CodeGenerateException e) {
logger.error("Generate task definition code error.", e);
putMsg(result, Status.INTERNAL_SERVER_ERROR_ARGS, "Error generating task definition code");
}
putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, taskCodes);
return result;
}
/**
* release task definition
*
* @param loginUser login user
* @param projectCode project code
* @param code task definition code
* @param releaseState releaseState
* @return update result code
*/
@Transactional
@Override
public Map<String, Object> releaseTaskDefinition(User loginUser, long projectCode, long code,
ReleaseState releaseState) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, project, projectCode, null);
Status resultStatus = (Status) result.get(Constants.STATUS);
if (resultStatus != Status.SUCCESS) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
return result;
}
if (null == releaseState) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, RELEASESTATE);
return result;
}
TaskDefinition taskDefinition = taskDefinitionMapper.queryByCode(code);
if (taskDefinition == null || projectCode != taskDefinition.getProjectCode()) {
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, String.valueOf(code));
return result;
}
TaskDefinitionLog taskDefinitionLog =
taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(code, taskDefinition.getVersion());
if (taskDefinitionLog == null) {
logger.error("Task definition does not exist, taskDefinitionCode:{}.", code);
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, String.valueOf(code));
return result;
}
switch (releaseState) {
case OFFLINE:
taskDefinition.setFlag(Flag.NO);
taskDefinitionLog.setFlag(Flag.NO);
break;
case ONLINE:
String resourceIds = taskDefinition.getResourceIds();
if (StringUtils.isNotBlank(resourceIds)) {
Integer[] resourceIdArray =
Arrays.stream(resourceIds.split(",")).map(Integer::parseInt).toArray(Integer[]::new);
PermissionCheck<Integer> permissionCheck = new PermissionCheck(AuthorizationType.RESOURCE_FILE_ID,
processService, resourceIdArray, loginUser.getId(), logger);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
try {
permissionCheck.checkPermission();
} catch (Exception e) {
logger.error("Resources permission check error, resourceIds:{}.", resourceIds, e);
putMsg(result, Status.RESOURCE_NOT_EXIST_OR_NO_PERMISSION);
return result;
}
}
taskDefinition.setFlag(Flag.YES);
taskDefinitionLog.setFlag(Flag.YES);
break;
default:
logger.warn("Parameter releaseState is invalid.");
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, RELEASESTATE);
return result;
}
int update = taskDefinitionMapper.updateById(taskDefinition);
int updateLog = taskDefinitionLogMapper.updateById(taskDefinitionLog);
if ((update == 0 && updateLog == 1) || (update == 1 && updateLog == 0)) {
logger.error("Update taskDefinition state or taskDefinitionLog state error, taskDefinitionCode:{}.", code);
putMsg(result, Status.UPDATE_TASK_DEFINITION_ERROR);
throw new ServiceException(Status.UPDATE_TASK_DEFINITION_ERROR);
}
logger.error("Update taskDefinition state or taskDefinitionLog state to complete, taskDefinitionCode:{}.",
code);
putMsg(result, Status.SUCCESS);
return result;
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.service;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION_CREATE;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION_DELETE;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION_UPDATE;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_SWITCH_TO_THIS_VERSION;
import static org.mockito.ArgumentMatchers.isA;
import org.apache.dolphinscheduler.api.dto.task.TaskCreateRequest;
import org.apache.dolphinscheduler.api.dto.task.TaskUpdateRequest;
import org.apache.dolphinscheduler.api.dto.taskRelation.TaskRelationUpdateUpstreamRequest;
import org.apache.dolphinscheduler.api.dto.workflow.WorkflowUpdateRequest;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.exceptions.ServiceException;
import org.apache.dolphinscheduler.api.service.impl.ProjectServiceImpl;
import org.apache.dolphinscheduler.api.service.impl.TaskDefinitionServiceImpl;
import org.apache.dolphinscheduler.common.constants.Constants;
import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.common.enums.Priority;
import org.apache.dolphinscheduler.common.enums.ReleaseState;
import org.apache.dolphinscheduler.common.enums.UserType;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionLogMapper;
import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper;
import org.apache.dolphinscheduler.service.process.ProcessService;
import org.apache.dolphinscheduler.service.task.TaskPluginManager;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
@ExtendWith(MockitoExtension.class)
public class TaskDefinitionServiceImplTest {
@InjectMocks
private TaskDefinitionServiceImpl taskDefinitionService;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
@Mock
private TaskDefinitionMapper taskDefinitionMapper;
@Mock
private TaskDefinitionLogMapper taskDefinitionLogMapper;
@Mock
private ProjectMapper projectMapper;
@Mock
private ProjectServiceImpl projectService;
@Mock
private ProcessService processService;
@Mock
private ProcessTaskRelationMapper processTaskRelationMapper;
@Mock
private TaskPluginManager taskPluginManager;
@Mock
private ProcessTaskRelationService processTaskRelationService;
@Mock
private ProcessDefinitionMapper processDefinitionMapper;
@Mock
private ProcessDefinitionService processDefinitionService;
private static final String TASK_PARAMETER =
"{\"resourceList\":[],\"localParams\":[],\"rawScript\":\"echo 1\",\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"dependence\":{}}";;
private static final long PROJECT_CODE = 1L;
private static final long PROCESS_DEFINITION_CODE = 2L;
private static final long TASK_CODE = 3L;
private static final int VERSION = 1;
private static final int RESOURCE_RATE = -1;
protected User user;
protected Exception exception;
@BeforeEach
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
public void before() {
User loginUser = new User();
loginUser.setId(1);
loginUser.setTenantId(2);
loginUser.setUserType(UserType.GENERAL_USER);
loginUser.setUserName("admin");
user = loginUser;
}
@Test
public void createTaskDefinition() {
Project project = getProject();
Mockito.when(projectMapper.queryByCode(PROJECT_CODE)).thenReturn(project);
Map<String, Object> result = new HashMap<>();
putMsg(result, Status.SUCCESS, PROJECT_CODE);
Mockito.when(projectService.checkProjectAndAuth(user, project, PROJECT_CODE, TASK_DEFINITION_CREATE))
.thenReturn(result);
String createTaskDefinitionJson =
"[{\"name\":\"detail_up\",\"description\":\"\",\"taskType\":\"SHELL\",\"taskParams\":"
+ "\"{\\\"resourceList\\\":[],\\\"localParams\\\":[{\\\"prop\\\":\\\"datetime\\\",\\\"direct\\\":\\\"IN\\\","
+ "\\\"type\\\":\\\"VARCHAR\\\",\\\"value\\\":\\\"${system.datetime}\\\"}],\\\"rawScript\\\":"
+ "\\\"echo ${datetime}\\\",\\\"conditionResult\\\":\\\"{\\\\\\\"successNode\\\\\\\":[\\\\\\\"\\\\\\\"],"
+ "\\\\\\\"failedNode\\\\\\\":[\\\\\\\"\\\\\\\"]}\\\",\\\"dependence\\\":{}}\",\"flag\":0,\"taskPriority\":0,"
+ "\"workerGroup\":\"default\",\"failRetryTimes\":0,\"failRetryInterval\":0,\"timeoutFlag\":0,"
+ "\"timeoutNotifyStrategy\":0,\"timeout\":0,\"delayTime\":0,\"resourceIds\":\"\"}]";
Map<String, Object> relation = taskDefinitionService
.createTaskDefinition(user, PROJECT_CODE, createTaskDefinitionJson);
Assertions.assertEquals(Status.SUCCESS, relation.get(Constants.STATUS));
}
@Test
public void updateTaskDefinition() {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
String taskDefinitionJson =
"{\"name\":\"detail_up\",\"description\":\"\",\"taskType\":\"SHELL\",\"taskParams\":"
+ "\"{\\\"resourceList\\\":[],\\\"localParams\\\":[{\\\"prop\\\":\\\"datetime\\\",\\\"direct\\\":\\\"IN\\\","
+ "\\\"type\\\":\\\"VARCHAR\\\",\\\"value\\\":\\\"${system.datetime}\\\"}],\\\"rawScript\\\":"
+ "\\\"echo ${datetime}\\\",\\\"conditionResult\\\":\\\"{\\\\\\\"successNode\\\\\\\":[\\\\\\\"\\\\\\\"],"
+ "\\\\\\\"failedNode\\\\\\\":[\\\\\\\"\\\\\\\"]}\\\",\\\"dependence\\\":{}}\",\"flag\":0,\"taskPriority\":0,"
+ "\"workerGroup\":\"default\",\"failRetryTimes\":0,\"failRetryInterval\":0,\"timeoutFlag\":0,"
+ "\"timeoutNotifyStrategy\":0,\"timeout\":0,\"delayTime\":0,\"resourceIds\":\"\"}";
Project project = getProject();
Mockito.when(projectMapper.queryByCode(PROJECT_CODE)).thenReturn(project);
Map<String, Object> result = new HashMap<>();
putMsg(result, Status.SUCCESS, PROJECT_CODE);
Mockito.when(projectService.hasProjectAndWritePerm(user, project, new HashMap<>())).thenReturn(true);
Mockito.when(processService.isTaskOnline(TASK_CODE)).thenReturn(Boolean.FALSE);
Mockito.when(taskDefinitionMapper.queryByCode(TASK_CODE)).thenReturn(new TaskDefinition());
Mockito.when(taskDefinitionMapper.updateById(Mockito.any(TaskDefinitionLog.class))).thenReturn(1);
Mockito.when(taskDefinitionLogMapper.insert(Mockito.any(TaskDefinitionLog.class))).thenReturn(1);
Mockito.when(taskDefinitionLogMapper.queryMaxVersionForDefinition(TASK_CODE)).thenReturn(1);
Mockito.when(taskPluginManager.checkTaskParameters(Mockito.any())).thenReturn(true);
Mockito.when(processTaskRelationMapper.queryByTaskCode(3)).thenReturn(getProcessTaskRelationList2());
Mockito.when(processTaskRelationMapper
.updateProcessTaskRelationTaskVersion(Mockito.any(ProcessTaskRelation.class))).thenReturn(1);
result = taskDefinitionService.updateTaskDefinition(user, PROJECT_CODE, TASK_CODE, taskDefinitionJson);
Assertions.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
Mockito.when(processTaskRelationMapper
.updateProcessTaskRelationTaskVersion(Mockito.any(ProcessTaskRelation.class))).thenReturn(2);
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.updateTaskDefinition(user, PROJECT_CODE, TASK_CODE, taskDefinitionJson));
Assertions.assertEquals(Status.PROCESS_TASK_RELATION_BATCH_UPDATE_ERROR.getCode(),
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
((ServiceException) exception).getCode());
}
@Test
public void queryTaskDefinitionByName() {
String taskName = "task";
Project project = getProject();
Mockito.when(projectMapper.queryByCode(PROJECT_CODE)).thenReturn(project);
Map<String, Object> result = new HashMap<>();
putMsg(result, Status.SUCCESS, PROJECT_CODE);
Mockito.when(projectService.checkProjectAndAuth(user, project, PROJECT_CODE, TASK_DEFINITION))
.thenReturn(result);
Mockito.when(taskDefinitionMapper.queryByName(project.getCode(), PROCESS_DEFINITION_CODE, taskName))
.thenReturn(new TaskDefinition());
Map<String, Object> relation = taskDefinitionService
.queryTaskDefinitionByName(user, PROJECT_CODE, PROCESS_DEFINITION_CODE, taskName);
Assertions.assertEquals(Status.SUCCESS, relation.get(Constants.STATUS));
}
@Test
public void deleteTaskDefinitionByCode() {
Project project = getProject();
Mockito.when(projectMapper.queryByCode(PROJECT_CODE)).thenReturn(project);
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.deleteTaskDefinitionByCode(user, TASK_CODE));
Assertions.assertEquals(Status.TASK_DEFINE_NOT_EXIST.getCode(), ((ServiceException) exception).getCode());
Mockito.when(taskDefinitionMapper.queryByCode(TASK_CODE)).thenReturn(getTaskDefinition());
Mockito.when(taskDefinitionMapper.deleteByCode(TASK_CODE)).thenReturn(0);
Mockito.when(projectService.hasProjectAndWritePerm(user, project, new HashMap<>())).thenReturn(true);
exception = Assertions.assertThrows(ServiceException.class,
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
() -> taskDefinitionService.deleteTaskDefinitionByCode(user, TASK_CODE));
Assertions.assertEquals(Status.DELETE_TASK_DEFINE_BY_CODE_MSG_ERROR.getCode(),
((ServiceException) exception).getCode());
Mockito.doNothing().when(projectService).checkProjectAndAuthThrowException(user, project,
TASK_DEFINITION_DELETE);
Mockito.when(processTaskRelationMapper.queryDownstreamByTaskCode(TASK_CODE)).thenReturn(new ArrayList<>());
Mockito.when(taskDefinitionMapper.deleteByCode(TASK_CODE)).thenReturn(1);
Assertions.assertDoesNotThrow(() -> taskDefinitionService.deleteTaskDefinitionByCode(user, TASK_CODE));
}
@Test
public void switchVersion() {
Project project = getProject();
Mockito.when(projectMapper.queryByCode(PROJECT_CODE)).thenReturn(project);
Map<String, Object> result = new HashMap<>();
putMsg(result, Status.SUCCESS, PROJECT_CODE);
Mockito.when(
projectService.checkProjectAndAuth(user, project, PROJECT_CODE, WORKFLOW_SWITCH_TO_THIS_VERSION))
.thenReturn(result);
Mockito.when(taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(TASK_CODE, VERSION))
.thenReturn(new TaskDefinitionLog());
TaskDefinition taskDefinition = new TaskDefinition();
taskDefinition.setProjectCode(PROJECT_CODE);
Mockito.when(taskDefinitionMapper.queryByCode(TASK_CODE))
.thenReturn(taskDefinition);
Mockito.when(taskDefinitionMapper.updateById(new TaskDefinitionLog())).thenReturn(1);
Map<String, Object> relation = taskDefinitionService
.switchVersion(user, PROJECT_CODE, TASK_CODE, VERSION);
Assertions.assertEquals(Status.SUCCESS, relation.get(Constants.STATUS));
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
private void putMsg(Map<String, Object> result, Status status, Object... statusParams) {
result.put(Constants.STATUS, status);
if (statusParams != null && statusParams.length > 0) {
result.put(Constants.MSG, MessageFormat.format(status.getMsg(), statusParams));
} else {
result.put(Constants.MSG, status.getMsg());
}
}
@Test
public void checkJson() {
String taskDefinitionJson =
"[{\"name\":\"detail_up\",\"description\":\"\",\"taskType\":\"SHELL\",\"taskParams\":"
+ "\"{\\\"resourceList\\\":[],\\\"localParams\\\":[{\\\"prop\\\":\\\"datetime\\\",\\\"direct\\\":\\\"IN\\\","
+ "\\\"type\\\":\\\"VARCHAR\\\",\\\"value\\\":\\\"${system.datetime}\\\"}],\\\"rawScript\\\":"
+ "\\\"echo ${datetime}\\\",\\\"conditionResult\\\":\\\"{\\\\\\\"successNode\\\\\\\":[\\\\\\\"\\\\\\\"],"
+ "\\\\\\\"failedNode\\\\\\\":[\\\\\\\"\\\\\\\"]}\\\",\\\"dependence\\\":{}}\",\"flag\":0,\"taskPriority\":0,"
+ "\"workerGroup\":\"default\",\"failRetryTimes\":0,\"failRetryInterval\":0,\"timeoutFlag\":0,"
+ "\"timeoutNotifyStrategy\":0,\"timeout\":0,\"delayTime\":0,\"resourceIds\":\"\"}]";
List<TaskDefinitionLog> taskDefinitionLogs = JSONUtils.toList(taskDefinitionJson, TaskDefinitionLog.class);
Assertions.assertFalse(taskDefinitionLogs.isEmpty());
String taskJson =
"[{\"name\":\"shell1\",\"description\":\"\",\"taskType\":\"SHELL\",\"taskParams\":{\"resourceList\":[],"
+ "\"localParams\":[],\"rawScript\":\"echo 1\",\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"dependence\":{}},"
+ "\"flag\":\"NORMAL\",\"taskPriority\":\"MEDIUM\",\"workerGroup\":\"default\",\"failRetryTimes\":\"0\",\"failRetryInterval\":\"1\","
+ "\"timeoutFlag\":\"CLOSE\",\"timeoutNotifyStrategy\":\"\",\"timeout\":null,\"delayTime\":\"0\"},{\"name\":\"shell2\",\"description\":\"\","
+ "\"taskType\":\"SHELL\",\"taskParams\":{\"resourceList\":[],\"localParams\":[],\"rawScript\":\"echo 2\",\"conditionResult\":{\"successNode\""
+ ":[\"\"],\"failedNode\":[\"\"]},\"dependence\":{}},\"flag\":\"NORMAL\",\"taskPriority\":\"MEDIUM\",\"workerGroup\":\"default\","
+ "\"failRetryTimes\":\"0\",\"failRetryInterval\":\"1\",\"timeoutFlag\":\"CLOSE\",\"timeoutNotifyStrategy\":\"\",\"timeout\":null,\"delayTime\":\"0\"}]";
taskDefinitionLogs = JSONUtils.toList(taskJson, TaskDefinitionLog.class);
Assertions.assertFalse(taskDefinitionLogs.isEmpty());
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
String taskParams =
"{\"resourceList\":[],\"localParams\":[{\"prop\":\"datetime\",\"direct\":\"IN\",\"type\":\"VARCHAR\","
+ "\"value\":\"${system.datetime}\"}],\"rawScript\":\"echo ${datetime}\",\"conditionResult\":\"{\\\"successNode\\\":[\\\"\\\"],"
+ "\\\"failedNode\\\":[\\\"\\\"]}\",\"dependence\":{}}";
Map parameters = JSONUtils.parseObject(taskParams, Map.class);
Assertions.assertNotNull(parameters);
String params =
"{\"resourceList\":[],\"localParams\":[],\"rawScript\":\"echo 1\",\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"dependence\":{}}";
Map parameters1 = JSONUtils.parseObject(params, Map.class);
Assertions.assertNotNull(parameters1);
}
@Test
public void genTaskCodeList() {
Map<String, Object> genTaskCodeList = taskDefinitionService.genTaskCodeList(10);
Assertions.assertEquals(Status.SUCCESS, genTaskCodeList.get(Constants.STATUS));
}
@Test
public void testReleaseTaskDefinition() {
Mockito.when(projectMapper.queryByCode(PROJECT_CODE)).thenReturn(getProject());
Project project = getProject();
Map<String, Object> result = new HashMap<>();
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, TASK_CODE);
Mockito.when(projectService.checkProjectAndAuth(user, project, PROJECT_CODE, null)).thenReturn(result);
Map<String, Object> map =
taskDefinitionService.releaseTaskDefinition(user, PROJECT_CODE, TASK_CODE, ReleaseState.OFFLINE);
Assertions.assertEquals(Status.TASK_DEFINE_NOT_EXIST, map.get(Constants.STATUS));
putMsg(result, Status.SUCCESS);
TaskDefinition taskDefinition = new TaskDefinition();
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
taskDefinition.setProjectCode(PROJECT_CODE);
taskDefinition.setVersion(1);
taskDefinition.setCode(TASK_CODE);
String params =
"{\"resourceList\":[],\"localParams\":[],\"rawScript\":\"echo 1\",\"conditionResult\":{\"successNode\":[\"\"],\"failedNode\":[\"\"]},\"dependence\":{}}";
taskDefinition.setTaskParams(params);
taskDefinition.setTaskType("SHELL");
Mockito.when(taskDefinitionMapper.queryByCode(TASK_CODE)).thenReturn(taskDefinition);
TaskDefinitionLog taskDefinitionLog = new TaskDefinitionLog(taskDefinition);
Mockito.when(taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(TASK_CODE, taskDefinition.getVersion()))
.thenReturn(taskDefinitionLog);
Map<String, Object> offlineTaskResult =
taskDefinitionService.releaseTaskDefinition(user, PROJECT_CODE, TASK_CODE, ReleaseState.OFFLINE);
Assertions.assertEquals(Status.SUCCESS, offlineTaskResult.get(Constants.STATUS));
Map<String, Object> onlineTaskResult =
taskDefinitionService.releaseTaskDefinition(user, PROJECT_CODE, TASK_CODE, ReleaseState.ONLINE);
Assertions.assertEquals(Status.SUCCESS, onlineTaskResult.get(Constants.STATUS));
Map<String, Object> failResult =
taskDefinitionService.releaseTaskDefinition(user, PROJECT_CODE, TASK_CODE, ReleaseState.getEnum(2));
Assertions.assertEquals(Status.REQUEST_PARAMS_NOT_VALID_ERROR, failResult.get(Constants.STATUS));
}
@Test
public void testCreateTaskDefinitionV2() {
TaskCreateRequest taskCreateRequest = new TaskCreateRequest();
taskCreateRequest.setProjectCode(PROJECT_CODE);
taskCreateRequest.setWorkflowCode(PROCESS_DEFINITION_CODE);
exception = Assertions.assertThrows(ServiceException.class,
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
() -> taskDefinitionService.createTaskDefinitionV2(user, taskCreateRequest));
Assertions.assertEquals(Status.PROCESS_DEFINE_NOT_EXIST.getCode(), ((ServiceException) exception).getCode());
Mockito.when(processDefinitionMapper.queryByCode(PROCESS_DEFINITION_CODE)).thenReturn(getProcessDefinition());
Mockito.when(projectMapper.queryByCode(PROJECT_CODE)).thenReturn(getProject());
Mockito.doThrow(new ServiceException(Status.PROJECT_NOT_EXIST)).when(projectService)
.checkProjectAndAuthThrowException(user, getProject(), TASK_DEFINITION_CREATE);
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.createTaskDefinitionV2(user, taskCreateRequest));
Assertions.assertEquals(Status.PROJECT_NOT_EXIST.getCode(), ((ServiceException) exception).getCode());
taskCreateRequest.setTaskParams(TASK_PARAMETER);
Mockito.doNothing().when(projectService).checkProjectAndAuthThrowException(user, getProject(),
TASK_DEFINITION_CREATE);
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.createTaskDefinitionV2(user, taskCreateRequest));
Assertions.assertEquals(Status.PROCESS_NODE_S_PARAMETER_INVALID.getCode(),
((ServiceException) exception).getCode());
Mockito.when(taskPluginManager.checkTaskParameters(Mockito.any())).thenReturn(true);
Mockito.when(taskDefinitionMapper.insert(isA(TaskDefinition.class))).thenReturn(0);
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.createTaskDefinitionV2(user, taskCreateRequest));
Assertions.assertEquals(Status.CREATE_TASK_DEFINITION_ERROR.getCode(),
((ServiceException) exception).getCode());
Mockito.when(taskDefinitionMapper.insert(isA(TaskDefinition.class))).thenReturn(1);
Mockito.when(taskDefinitionLogMapper.insert(isA(TaskDefinitionLog.class))).thenReturn(0);
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.createTaskDefinitionV2(user, taskCreateRequest));
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
Assertions.assertEquals(Status.CREATE_TASK_DEFINITION_LOG_ERROR.getCode(),
((ServiceException) exception).getCode());
Mockito.when(taskDefinitionLogMapper.insert(isA(TaskDefinitionLog.class))).thenReturn(1);
Mockito.when(processTaskRelationService.updateUpstreamTaskDefinition(isA(User.class), isA(Long.class),
isA(TaskRelationUpdateUpstreamRequest.class))).thenReturn(getProcessTaskRelationList());
Mockito.when(processDefinitionService.updateSingleProcessDefinition(isA(User.class), isA(Long.class),
isA(WorkflowUpdateRequest.class))).thenReturn(getProcessDefinition());
Assertions.assertDoesNotThrow(() -> taskDefinitionService.createTaskDefinitionV2(user, taskCreateRequest));
}
@Test
public void testUpdateTaskDefinitionV2() {
TaskUpdateRequest taskUpdateRequest = new TaskUpdateRequest();
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.updateTaskDefinitionV2(user, TASK_CODE, taskUpdateRequest));
Assertions.assertEquals(Status.TASK_DEFINITION_NOT_EXISTS.getCode(), ((ServiceException) exception).getCode());
Mockito.when(taskDefinitionMapper.queryByCode(TASK_CODE)).thenReturn(getTaskDefinition());
Mockito.when(projectMapper.queryByCode(isA(Long.class))).thenReturn(getProject());
Mockito.doThrow(new ServiceException(Status.PROJECT_NOT_EXIST)).when(projectService)
.checkProjectAndAuthThrowException(user, getProject(), TASK_DEFINITION_UPDATE);
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.updateTaskDefinitionV2(user, TASK_CODE, taskUpdateRequest));
Assertions.assertEquals(Status.PROJECT_NOT_EXIST.getCode(), ((ServiceException) exception).getCode());
Mockito.doNothing().when(projectService).checkProjectAndAuthThrowException(user, getProject(),
TASK_DEFINITION_UPDATE);
exception = Assertions.assertThrows(ServiceException.class,
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
() -> taskDefinitionService.updateTaskDefinitionV2(user, TASK_CODE, taskUpdateRequest));
Assertions.assertEquals(Status.PROCESS_NODE_S_PARAMETER_INVALID.getCode(),
((ServiceException) exception).getCode());
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.updateTaskDefinitionV2(user, TASK_CODE, taskUpdateRequest));
Assertions.assertEquals(Status.PROCESS_NODE_S_PARAMETER_INVALID.getCode(),
((ServiceException) exception).getCode());
Mockito.when(processService.isTaskOnline(TASK_CODE)).thenReturn(false);
Mockito.when(taskPluginManager.checkTaskParameters(Mockito.any())).thenReturn(true);
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.updateTaskDefinitionV2(user, TASK_CODE, taskUpdateRequest));
Assertions.assertEquals(Status.TASK_DEFINITION_NOT_CHANGE.getCode(), ((ServiceException) exception).getCode());
taskUpdateRequest.setTaskPriority(String.valueOf(Priority.HIGH));
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.updateTaskDefinitionV2(user, TASK_CODE, taskUpdateRequest));
Assertions.assertEquals(Status.DATA_IS_NOT_VALID.getCode(), ((ServiceException) exception).getCode());
Mockito.when(taskDefinitionLogMapper.queryMaxVersionForDefinition(TASK_CODE)).thenReturn(VERSION);
Mockito.when(taskDefinitionMapper.updateById(isA(TaskDefinition.class))).thenReturn(0);
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.updateTaskDefinitionV2(user, TASK_CODE, taskUpdateRequest));
Assertions.assertEquals(Status.UPDATE_TASK_DEFINITION_ERROR.getCode(),
((ServiceException) exception).getCode());
Mockito.when(taskDefinitionMapper.updateById(isA(TaskDefinition.class))).thenReturn(1);
Mockito.when(taskDefinitionLogMapper.insert(isA(TaskDefinitionLog.class))).thenReturn(0);
exception = Assertions.assertThrows(ServiceException.class,
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
() -> taskDefinitionService.updateTaskDefinitionV2(user, TASK_CODE, taskUpdateRequest));
Assertions.assertEquals(Status.CREATE_TASK_DEFINITION_LOG_ERROR.getCode(),
((ServiceException) exception).getCode());
Mockito.when(taskDefinitionLogMapper.insert(isA(TaskDefinitionLog.class))).thenReturn(1);
Mockito.when(processTaskRelationService.updateUpstreamTaskDefinition(isA(User.class), isA(Long.class),
isA(TaskRelationUpdateUpstreamRequest.class))).thenReturn(getProcessTaskRelationList());
Assertions.assertDoesNotThrow(
() -> taskDefinitionService.updateTaskDefinitionV2(user, TASK_CODE, taskUpdateRequest));
}
@Test
public void testGetTaskDefinition() {
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.getTaskDefinition(user, TASK_CODE));
Assertions.assertEquals(Status.TASK_DEFINE_NOT_EXIST.getCode(), ((ServiceException) exception).getCode());
Mockito.when(taskDefinitionMapper.queryByCode(TASK_CODE)).thenReturn(getTaskDefinition());
Mockito.when(projectMapper.queryByCode(PROJECT_CODE)).thenReturn(getProject());
Mockito.doThrow(new ServiceException(Status.USER_NO_OPERATION_PROJECT_PERM)).when(projectService)
.checkProjectAndAuthThrowException(user, getProject(), TASK_DEFINITION);
exception = Assertions.assertThrows(ServiceException.class,
() -> taskDefinitionService.getTaskDefinition(user, TASK_CODE));
Assertions.assertEquals(Status.USER_NO_OPERATION_PROJECT_PERM.getCode(),
((ServiceException) exception).getCode());
Mockito.doNothing().when(projectService).checkProjectAndAuthThrowException(user, getProject(), TASK_DEFINITION);
Assertions.assertDoesNotThrow(() -> taskDefinitionService.getTaskDefinition(user, TASK_CODE));
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
/**
* get mock Project
*
* @return Project
*/
private Project getProject() {
Project project = new Project();
project.setId(1);
project.setCode(PROJECT_CODE);
project.setName("test");
project.setUserId(1);
return project;
}
private ProcessDefinition getProcessDefinition() {
ProcessDefinition processDefinition = new ProcessDefinition();
processDefinition.setProjectCode(PROJECT_CODE);
processDefinition.setCode(PROCESS_DEFINITION_CODE);
processDefinition.setVersion(VERSION);
return processDefinition;
}
private TaskDefinition getTaskDefinition() {
TaskDefinition taskDefinition = new TaskDefinition();
taskDefinition.setProjectCode(PROJECT_CODE);
taskDefinition.setCode(TASK_CODE);
taskDefinition.setVersion(VERSION);
taskDefinition.setTaskType("SHELL");
taskDefinition.setTaskParams(TASK_PARAMETER);
taskDefinition.setFlag(Flag.YES);
taskDefinition.setCpuQuota(RESOURCE_RATE);
taskDefinition.setMemoryMax(RESOURCE_RATE);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java
|
return taskDefinition;
}
private List<ProcessTaskRelation> getProcessTaskRelationList() {
List<ProcessTaskRelation> processTaskRelationList = new ArrayList<>();
ProcessTaskRelation processTaskRelation = new ProcessTaskRelation();
processTaskRelation.setProjectCode(PROJECT_CODE);
processTaskRelation.setProcessDefinitionCode(PROCESS_DEFINITION_CODE);
processTaskRelation.setPreTaskCode(TASK_CODE);
processTaskRelation.setPostTaskCode(TASK_CODE + 1L);
processTaskRelationList.add(processTaskRelation);
return processTaskRelationList;
}
private List<ProcessTaskRelation> getProcessTaskRelationList2() {
List<ProcessTaskRelation> processTaskRelationList = new ArrayList<>();
ProcessTaskRelation processTaskRelation = new ProcessTaskRelation();
processTaskRelation.setProjectCode(PROJECT_CODE);
processTaskRelation.setProcessDefinitionCode(PROCESS_DEFINITION_CODE);
processTaskRelation.setPreTaskCode(TASK_CODE);
processTaskRelation.setPostTaskCode(TASK_CODE + 1L);
processTaskRelationList.add(processTaskRelation);
ProcessTaskRelation processTaskRelation2 = new ProcessTaskRelation();
processTaskRelation2.setProjectCode(PROJECT_CODE);
processTaskRelation2.setProcessDefinitionCode(PROCESS_DEFINITION_CODE);
processTaskRelation2.setPreTaskCode(TASK_CODE - 1);
processTaskRelation2.setPostTaskCode(TASK_CODE);
processTaskRelationList.add(processTaskRelation2);
return processTaskRelationList;
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionMapper.java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionMapper.java
|
*/
package org.apache.dolphinscheduler.dao.mapper;
import org.apache.dolphinscheduler.common.enums.TaskExecuteType;
import org.apache.dolphinscheduler.dao.entity.DefinitionGroupByUser;
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog;
import org.apache.dolphinscheduler.dao.entity.TaskMainInfo;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
* task definition mapper interface
*/
public interface TaskDefinitionMapper extends BaseMapper<TaskDefinition> {
/**
* query task definition by name
*
* @param projectCode projectCode
* @param processCode processCode
* @param name name
* @return task definition
*/
TaskDefinition queryByName(@Param("projectCode") long projectCode,
@Param("processCode") long processCode,
@Param("name") String name);
/**
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionMapper.java
|
* query task definition by code
*
* @param code taskDefinitionCode
* @return task definition
*/
TaskDefinition queryByCode(@Param("code") long code);
/**
* query all task definition list
*
* @param projectCode projectCode
* @return task definition list
*/
List<TaskDefinition> queryAllDefinitionList(@Param("projectCode") long projectCode);
/**
* count task definition group by user
*
* @param projectCodes projectCodes
* @return task definition list
*/
List<DefinitionGroupByUser> countDefinitionGroupByUser(@Param("projectCodes") Long[] projectCodes);
/**
* list all resource ids and task_params containing resourceList
*
* @return task ids list
*/
@MapKey("id")
List<Map<String, Object>> listResources();
/**
* list all resource ids by user id
*
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionMapper.java
|
* @return resource ids list
*/
@MapKey("id")
List<Map<String, Object>> listResourcesByUser(@Param("userId") Integer userId);
/**
* delete task definition by code
*
* @param code code
* @return int
*/
int deleteByCode(@Param("code") long code);
/**
* batch insert task definitions
*
* @param taskDefinitions taskDefinitions
* @return int
*/
int batchInsert(@Param("taskDefinitions") List<TaskDefinitionLog> taskDefinitions);
/**
* task main info page
*
* @param page page
* @param projectCode projectCode
* @param searchWorkflowName searchWorkflowName
* @param searchTaskName searchTaskName
* @param taskType taskType
* @param taskExecuteType taskExecuteType
* @return task main info IPage
*/
IPage<TaskMainInfo> queryDefineListPaging(IPage<TaskMainInfo> page,
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 13,105 |
[Improvement][dolphinscheduler-api] optimization task definition & fix in the task definition list, if one task have more pre task, the task list can't show all task
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
in the task definition, delete search workflow name filter, and fix in the task definition list, if one task have more pre task, the task list can't show all task
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/13105
|
https://github.com/apache/dolphinscheduler/pull/13106
|
d9f43adafdc6a0db3d17777fa8432122bd2acc9e
|
cb8d125e0f5c099078af7f1629cbdfeec0692951
| 2022-12-05T15:27:59Z |
java
| 2022-12-07T01:52:53Z |
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskDefinitionMapper.java
|
@Param("projectCode") long projectCode,
@Param("searchWorkflowName") String searchWorkflowName,
@Param("searchTaskName") String searchTaskName,
@Param("taskType") String taskType,
@Param("taskExecuteType") TaskExecuteType taskExecuteType);
/**
* query task definition by code list
*
* @param codes taskDefinitionCode list
* @return task definition list
*/
List<TaskDefinition> queryByCodeList(@Param("codes") Collection<Long> codes);
/**
* Filter task definition
*
* @param page page
* @param taskDefinition process definition object
* @return task definition IPage
*/
IPage<TaskDefinition> filterTaskDefinition(IPage<TaskDefinition> page,
@Param("task") TaskDefinition taskDefinition);
/**
* batch delete task by task code
*
* @param taskCodeList task code list
* @return deleted row count
*/
int deleteByBatchCodes(@Param("taskCodeList") List<Long> taskCodeList);
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,927 |
[Bug] [Worker The parameter setting of the same out type is invalid multiple times.
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The same name out type parameter setting is invalid multiple times( use first)
### What you expected to happen
The same type parameter setting uses the latest value multiple times
### How to reproduce
Use sql to modify values for the same out type multiple times
### Anything else
_No response_
### Version
3.1.x
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12927
|
https://github.com/apache/dolphinscheduler/pull/12930
|
f5801a0e1c8bebc900d75aab8ca3314bc0410c6b
|
560d232cbdea88e3ef1ede51fd55c8eb0e87594d
| 2022-11-17T03:50:32Z |
java
| 2022-12-12T03:07:23Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,927 |
[Bug] [Worker The parameter setting of the same out type is invalid multiple times.
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The same name out type parameter setting is invalid multiple times( use first)
### What you expected to happen
The same type parameter setting uses the latest value multiple times
### How to reproduce
Use sql to modify values for the same out type multiple times
### Anything else
_No response_
### Version
3.1.x
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12927
|
https://github.com/apache/dolphinscheduler/pull/12930
|
f5801a0e1c8bebc900d75aab8ca3314bc0410c6b
|
560d232cbdea88e3ef1ede51fd55c8eb0e87594d
| 2022-11-17T03:50:32Z |
java
| 2022-12-12T03:07:23Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java
|
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.plugin.task.api.parameters;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.plugin.task.api.enums.Direct;
import org.apache.dolphinscheduler.plugin.task.api.model.Property;
import org.apache.dolphinscheduler.plugin.task.api.model.ResourceInfo;
import org.apache.dolphinscheduler.plugin.task.api.parameters.resource.ResourceParametersHelper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
/**
* job params related class
*/
public abstract class AbstractParameters implements IParameters {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,927 |
[Bug] [Worker The parameter setting of the same out type is invalid multiple times.
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The same name out type parameter setting is invalid multiple times( use first)
### What you expected to happen
The same type parameter setting uses the latest value multiple times
### How to reproduce
Use sql to modify values for the same out type multiple times
### Anything else
_No response_
### Version
3.1.x
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12927
|
https://github.com/apache/dolphinscheduler/pull/12930
|
f5801a0e1c8bebc900d75aab8ca3314bc0410c6b
|
560d232cbdea88e3ef1ede51fd55c8eb0e87594d
| 2022-11-17T03:50:32Z |
java
| 2022-12-12T03:07:23Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java
|
@Override
public abstract boolean checkParameters();
@Override
public List<ResourceInfo> getResourceFilesList() {
return new ArrayList<>();
}
/**
* local parameters
*/
public List<Property> localParams;
/**
* var pool
*/
public List<Property> varPool;
/**
* get local parameters list
*
* @return Property list
*/
public List<Property> getLocalParams() {
return localParams;
}
public void setLocalParams(List<Property> localParams) {
this.localParams = localParams;
}
/**
* get local parameters map
* @return parameters map
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,927 |
[Bug] [Worker The parameter setting of the same out type is invalid multiple times.
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The same name out type parameter setting is invalid multiple times( use first)
### What you expected to happen
The same type parameter setting uses the latest value multiple times
### How to reproduce
Use sql to modify values for the same out type multiple times
### Anything else
_No response_
### Version
3.1.x
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12927
|
https://github.com/apache/dolphinscheduler/pull/12930
|
f5801a0e1c8bebc900d75aab8ca3314bc0410c6b
|
560d232cbdea88e3ef1ede51fd55c8eb0e87594d
| 2022-11-17T03:50:32Z |
java
| 2022-12-12T03:07:23Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java
|
*/
public Map<String, Property> getLocalParametersMap() {
Map<String, Property> localParametersMaps = new LinkedHashMap<>();
if (localParams != null) {
for (Property property : localParams) {
localParametersMaps.put(property.getProp(), property);
}
}
return localParametersMaps;
}
/**
* get input local parameters map if the param direct is IN
* @return parameters map
*/
public Map<String, Property> getInputLocalParametersMap() {
Map<String, Property> localParametersMaps = new LinkedHashMap<>();
if (localParams != null) {
for (Property property : localParams) {
if (property.getDirect() == null || Objects.equals(Direct.IN, property.getDirect())) {
localParametersMaps.put(property.getProp(), property);
}
}
}
return localParametersMaps;
}
/**
* get varPool map
*
* @return parameters map
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,927 |
[Bug] [Worker The parameter setting of the same out type is invalid multiple times.
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The same name out type parameter setting is invalid multiple times( use first)
### What you expected to happen
The same type parameter setting uses the latest value multiple times
### How to reproduce
Use sql to modify values for the same out type multiple times
### Anything else
_No response_
### Version
3.1.x
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12927
|
https://github.com/apache/dolphinscheduler/pull/12930
|
f5801a0e1c8bebc900d75aab8ca3314bc0410c6b
|
560d232cbdea88e3ef1ede51fd55c8eb0e87594d
| 2022-11-17T03:50:32Z |
java
| 2022-12-12T03:07:23Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java
|
*/
public Map<String, Property> getVarPoolMap() {
Map<String, Property> varPoolMap = new LinkedHashMap<>();
if (varPool != null) {
for (Property property : varPool) {
varPoolMap.put(property.getProp(), property);
}
}
return varPoolMap;
}
public List<Property> getVarPool() {
return varPool;
}
public void setVarPool(String varPool) {
if (StringUtils.isEmpty(varPool)) {
this.varPool = new ArrayList<>();
} else {
this.varPool = JSONUtils.toList(varPool, Property.class);
}
}
public void dealOutParam(String result) {
if (CollectionUtils.isEmpty(localParams)) {
return;
}
List<Property> outProperty = getOutProperty(localParams);
if (CollectionUtils.isEmpty(outProperty)) {
return;
}
if (StringUtils.isEmpty(result)) {
varPool.addAll(outProperty);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,927 |
[Bug] [Worker The parameter setting of the same out type is invalid multiple times.
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The same name out type parameter setting is invalid multiple times( use first)
### What you expected to happen
The same type parameter setting uses the latest value multiple times
### How to reproduce
Use sql to modify values for the same out type multiple times
### Anything else
_No response_
### Version
3.1.x
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12927
|
https://github.com/apache/dolphinscheduler/pull/12930
|
f5801a0e1c8bebc900d75aab8ca3314bc0410c6b
|
560d232cbdea88e3ef1ede51fd55c8eb0e87594d
| 2022-11-17T03:50:32Z |
java
| 2022-12-12T03:07:23Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java
|
return;
}
Map<String, String> taskResult = getMapByString(result);
if (taskResult.size() == 0) {
return;
}
for (Property info : outProperty) {
String propValue = taskResult.get(info.getProp());
if (StringUtils.isNotEmpty(propValue)) {
info.setValue(propValue);
addPropertyToValPool(info);
}
}
}
public List<Property> getOutProperty(List<Property> params) {
if (CollectionUtils.isEmpty(params)) {
return new ArrayList<>();
}
List<Property> result = new ArrayList<>();
for (Property info : params) {
if (info.getDirect() == Direct.OUT) {
result.add(info);
}
}
return result;
}
public List<Map<String, String>> getListMapByString(String json) {
List<Map<String, String>> allParams = new ArrayList<>();
ArrayNode paramsByJson = JSONUtils.parseArray(json);
for (JsonNode jsonNode : paramsByJson) {
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,927 |
[Bug] [Worker The parameter setting of the same out type is invalid multiple times.
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
The same name out type parameter setting is invalid multiple times( use first)
### What you expected to happen
The same type parameter setting uses the latest value multiple times
### How to reproduce
Use sql to modify values for the same out type multiple times
### Anything else
_No response_
### Version
3.1.x
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12927
|
https://github.com/apache/dolphinscheduler/pull/12930
|
f5801a0e1c8bebc900d75aab8ca3314bc0410c6b
|
560d232cbdea88e3ef1ede51fd55c8eb0e87594d
| 2022-11-17T03:50:32Z |
java
| 2022-12-12T03:07:23Z |
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/AbstractParameters.java
|
Map<String, String> param = JSONUtils.toMap(jsonNode.toString());
allParams.add(param);
}
return allParams;
}
/**
* shell's result format is key=value$VarPool$key=value$VarPool$
* @param result
* @return
*/
public static Map<String, String> getMapByString(String result) {
String[] formatResult = result.split("\\$VarPool\\$");
Map<String, String> format = new HashMap<>();
for (String info : formatResult) {
if (StringUtils.isNotEmpty(info) && info.contains("=")) {
String[] keyValue = info.split("=");
format.put(keyValue[0], keyValue[1]);
}
}
return format;
}
public ResourceParametersHelper getResources() {
return new ResourceParametersHelper();
}
private void addPropertyToValPool(Property property) {
varPool.removeIf(p -> p.getProp().equals(property.getProp()));
varPool.add(property);
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,621 |
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
List task defination and sorted by update time not effect
### What you expected to happen
List task defination and sorted by update time
### How to reproduce
List task defination and look
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12621
|
https://github.com/apache/dolphinscheduler/pull/12622
|
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
|
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
| 2022-10-31T08:44:47Z |
java
| 2022-12-13T08:35:54Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.service.impl;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION_CREATE;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION_DELETE;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION_UPDATE;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_VERSION_VIEW;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_DEFINITION;
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_SWITCH_TO_THIS_VERSION;
import org.apache.dolphinscheduler.api.dto.task.TaskCreateRequest;
import org.apache.dolphinscheduler.api.dto.task.TaskFilterRequest;
import org.apache.dolphinscheduler.api.dto.task.TaskUpdateRequest;
import org.apache.dolphinscheduler.api.dto.taskRelation.TaskRelationUpdateUpstreamRequest;
import org.apache.dolphinscheduler.api.dto.workflow.WorkflowUpdateRequest;
import org.apache.dolphinscheduler.api.enums.Status;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,621 |
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
List task defination and sorted by update time not effect
### What you expected to happen
List task defination and sorted by update time
### How to reproduce
List task defination and look
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12621
|
https://github.com/apache/dolphinscheduler/pull/12622
|
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
|
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
| 2022-10-31T08:44:47Z |
java
| 2022-12-13T08:35:54Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
import org.apache.dolphinscheduler.api.exceptions.ServiceException;
import org.apache.dolphinscheduler.api.permission.PermissionCheck;
import org.apache.dolphinscheduler.api.service.ProcessDefinitionService;
import org.apache.dolphinscheduler.api.service.ProcessTaskRelationService;
import org.apache.dolphinscheduler.api.service.ProjectService;
import org.apache.dolphinscheduler.api.service.TaskDefinitionService;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.api.vo.TaskDefinitionVo;
import org.apache.dolphinscheduler.common.constants.Constants;
import org.apache.dolphinscheduler.common.enums.AuthorizationType;
import org.apache.dolphinscheduler.common.enums.ConditionType;
import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.common.enums.ReleaseState;
import org.apache.dolphinscheduler.common.enums.TaskExecuteType;
import org.apache.dolphinscheduler.common.enums.TimeoutFlag;
import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils;
import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils.CodeGenerateException;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelation;
import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog;
import org.apache.dolphinscheduler.dao.entity.TaskMainInfo;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,621 |
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
List task defination and sorted by update time not effect
### What you expected to happen
List task defination and sorted by update time
### How to reproduce
List task defination and look
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12621
|
https://github.com/apache/dolphinscheduler/pull/12622
|
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
|
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
| 2022-10-31T08:44:47Z |
java
| 2022-12-13T08:35:54Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionLogMapper;
import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper;
import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode;
import org.apache.dolphinscheduler.service.process.ProcessService;
import org.apache.dolphinscheduler.service.task.TaskPluginManager;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
/**
* task definition service impl
*/
@Service
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,621 |
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
List task defination and sorted by update time not effect
### What you expected to happen
List task defination and sorted by update time
### How to reproduce
List task defination and look
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12621
|
https://github.com/apache/dolphinscheduler/pull/12622
|
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
|
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
| 2022-10-31T08:44:47Z |
java
| 2022-12-13T08:35:54Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDefinitionService {
private static final Logger logger = LoggerFactory.getLogger(TaskDefinitionServiceImpl.class);
private static final String RELEASESTATE = "releaseState";
@Autowired
private ProjectMapper projectMapper;
@Autowired
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,621 |
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
List task defination and sorted by update time not effect
### What you expected to happen
List task defination and sorted by update time
### How to reproduce
List task defination and look
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12621
|
https://github.com/apache/dolphinscheduler/pull/12622
|
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
|
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
| 2022-10-31T08:44:47Z |
java
| 2022-12-13T08:35:54Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
private ProjectService projectService;
@Autowired
private TaskDefinitionMapper taskDefinitionMapper;
@Autowired
private TaskDefinitionLogMapper taskDefinitionLogMapper;
@Autowired
private ProcessTaskRelationMapper processTaskRelationMapper;
@Autowired
private ProcessTaskRelationService processTaskRelationService;
@Autowired
private ProcessDefinitionMapper processDefinitionMapper;
@Autowired
private ProcessService processService;
@Autowired
private TaskPluginManager taskPluginManager;
@Autowired
private ProcessDefinitionService processDefinitionService;
/**
* create task definition
*
* @param loginUser login user
* @param projectCode project code
* @param taskDefinitionJson task definition json
*/
@Transactional
@Override
public Map<String, Object> createTaskDefinition(User loginUser,
long projectCode,
String taskDefinitionJson) {
Project project = projectMapper.queryByCode(projectCode);
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,621 |
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
List task defination and sorted by update time not effect
### What you expected to happen
List task defination and sorted by update time
### How to reproduce
List task defination and look
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12621
|
https://github.com/apache/dolphinscheduler/pull/12622
|
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
|
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
| 2022-10-31T08:44:47Z |
java
| 2022-12-13T08:35:54Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_DEFINITION_CREATE);
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result);
if (!hasProjectAndWritePerm) {
return result;
}
List<TaskDefinitionLog> taskDefinitionLogs = JSONUtils.toList(taskDefinitionJson, TaskDefinitionLog.class);
if (CollectionUtils.isEmpty(taskDefinitionLogs)) {
logger.warn("Parameter taskDefinitionJson is invalid.");
putMsg(result, Status.DATA_IS_NOT_VALID, taskDefinitionJson);
return result;
}
for (TaskDefinitionLog taskDefinitionLog : taskDefinitionLogs) {
if (!taskPluginManager.checkTaskParameters(ParametersNode.builder()
.taskType(taskDefinitionLog.getTaskType())
.taskParams(taskDefinitionLog.getTaskParams())
.dependence(taskDefinitionLog.getDependence())
.build())) {
logger.warn("Task definition {} parameters are invalid.", taskDefinitionLog.getName());
putMsg(result, Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinitionLog.getName());
return result;
}
}
int saveTaskResult = processService.saveTaskDefine(loginUser, projectCode, taskDefinitionLogs, Boolean.TRUE);
if (saveTaskResult == Constants.DEFINITION_FAILURE) {
logger.error("Create task definition error, projectCode:{}.", projectCode);
putMsg(result, Status.CREATE_TASK_DEFINITION_ERROR);
throw new ServiceException(Status.CREATE_TASK_DEFINITION_ERROR);
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,621 |
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
List task defination and sorted by update time not effect
### What you expected to happen
List task defination and sorted by update time
### How to reproduce
List task defination and look
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12621
|
https://github.com/apache/dolphinscheduler/pull/12622
|
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
|
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
| 2022-10-31T08:44:47Z |
java
| 2022-12-13T08:35:54Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
Map<String, Object> resData = new HashMap<>();
resData.put("total", taskDefinitionLogs.size());
resData.put("code", StringUtils
.join(taskDefinitionLogs.stream().map(TaskDefinition::getCode).collect(Collectors.toList()), ","));
putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, resData);
return result;
}
private TaskDefinitionLog persist2TaskDefinitionLog(User user, TaskDefinition taskDefinition) {
TaskDefinitionLog taskDefinitionLog = new TaskDefinitionLog(taskDefinition);
taskDefinitionLog.setOperator(user.getId());
taskDefinitionLog.setOperateTime(new Date());
int result = taskDefinitionLogMapper.insert(taskDefinitionLog);
if (result <= 0) {
throw new ServiceException(Status.CREATE_TASK_DEFINITION_LOG_ERROR, taskDefinitionLog.getName());
}
return taskDefinitionLog;
}
private void checkTaskDefinitionValid(User user, TaskDefinition taskDefinition, String permissions) {
Project project = projectMapper.queryByCode(taskDefinition.getProjectCode());
projectService.checkProjectAndAuthThrowException(user, project, permissions);
if (!taskPluginManager.checkTaskParameters(ParametersNode.builder()
.taskType(taskDefinition.getTaskType())
.taskParams(taskDefinition.getTaskParams())
.dependence(taskDefinition.getDependence())
.build())) {
throw new ServiceException(Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinition.getName());
}
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,621 |
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
List task defination and sorted by update time not effect
### What you expected to happen
List task defination and sorted by update time
### How to reproduce
List task defination and look
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12621
|
https://github.com/apache/dolphinscheduler/pull/12622
|
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
|
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
| 2022-10-31T08:44:47Z |
java
| 2022-12-13T08:35:54Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
private List<ProcessTaskRelation> updateTaskUpstreams(User user, long workflowCode, long taskCode,
String upstreamCodes) {
TaskRelationUpdateUpstreamRequest taskRelationUpdateUpstreamRequest = new TaskRelationUpdateUpstreamRequest();
taskRelationUpdateUpstreamRequest.setWorkflowCode(workflowCode);
taskRelationUpdateUpstreamRequest.setUpstreams(upstreamCodes);
return processTaskRelationService.updateUpstreamTaskDefinition(user, taskCode,
taskRelationUpdateUpstreamRequest);
}
private ProcessDefinition updateWorkflowLocation(User user, ProcessDefinition processDefinition) {
WorkflowUpdateRequest workflowUpdateRequest = new WorkflowUpdateRequest();
workflowUpdateRequest.setLocation(null);
return processDefinitionService.updateSingleProcessDefinition(user, processDefinition.getCode(),
workflowUpdateRequest);
}
/**
* Create resource task definition
*
* @param loginUser login user
* @param taskCreateRequest task definition json
* @return new TaskDefinition have created
*/
@Override
@Transactional
public TaskDefinition createTaskDefinitionV2(User loginUser,
TaskCreateRequest taskCreateRequest) {
TaskDefinition taskDefinition = taskCreateRequest.convert2TaskDefinition();
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(taskCreateRequest.getWorkflowCode());
if (processDefinition == null) {
throw new ServiceException(Status.PROCESS_DEFINE_NOT_EXIST, taskCreateRequest.getWorkflowCode());
}
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,621 |
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
List task defination and sorted by update time not effect
### What you expected to happen
List task defination and sorted by update time
### How to reproduce
List task defination and look
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12621
|
https://github.com/apache/dolphinscheduler/pull/12622
|
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
|
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
| 2022-10-31T08:44:47Z |
java
| 2022-12-13T08:35:54Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
if (taskDefinition.getProjectCode() == 0L) {
taskDefinition.setProjectCode(processDefinition.getProjectCode());
}
this.checkTaskDefinitionValid(loginUser, taskDefinition, TASK_DEFINITION_CREATE);
long taskDefinitionCode;
try {
taskDefinitionCode = CodeGenerateUtils.getInstance().genCode();
} catch (CodeGenerateException e) {
throw new ServiceException(Status.INTERNAL_SERVER_ERROR_ARGS);
}
taskDefinition.setCode(taskDefinitionCode);
int create = taskDefinitionMapper.insert(taskDefinition);
if (create <= 0) {
throw new ServiceException(Status.CREATE_TASK_DEFINITION_ERROR);
}
this.persist2TaskDefinitionLog(loginUser, taskDefinition);
this.updateTaskUpstreams(loginUser, taskCreateRequest.getWorkflowCode(), taskDefinition.getCode(),
taskCreateRequest.getUpstreamTasksCodes());
this.updateWorkflowLocation(loginUser, processDefinition);
return taskDefinition;
}
/**
* create single task definition that binds the workflow
*
* @param loginUser login user
* @param projectCode project code
* @param processDefinitionCode process definition code
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,621 |
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
List task defination and sorted by update time not effect
### What you expected to happen
List task defination and sorted by update time
### How to reproduce
List task defination and look
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12621
|
https://github.com/apache/dolphinscheduler/pull/12622
|
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
|
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
| 2022-10-31T08:44:47Z |
java
| 2022-12-13T08:35:54Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
* @param taskDefinitionJsonObj task definition json object
* @param upstreamCodes upstream task codes, sep comma
* @return create result code
*/
@Transactional
@Override
public Map<String, Object> createTaskBindsWorkFlow(User loginUser,
long projectCode,
long processDefinitionCode,
String taskDefinitionJsonObj,
String upstreamCodes) {
Project project = projectMapper.queryByCode(projectCode);
Map<String, Object> result =
projectService.checkProjectAndAuth(loginUser, project, projectCode, TASK_DEFINITION_CREATE);
boolean hasProjectAndWritePerm = projectService.hasProjectAndWritePerm(loginUser, project, result);
if (!hasProjectAndWritePerm) {
return result;
}
ProcessDefinition processDefinition = processDefinitionMapper.queryByCode(processDefinitionCode);
if (processDefinition == null || projectCode != processDefinition.getProjectCode()) {
logger.error("Process definition does not exist, processDefinitionCode:{}.", processDefinitionCode);
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, String.valueOf(processDefinitionCode));
return result;
}
if (processDefinition.getReleaseState() == ReleaseState.ONLINE) {
logger.warn("Task definition can not be created due to process definition is {}, processDefinitionCode:{}.",
ReleaseState.ONLINE.getDescp(), processDefinition.getCode());
putMsg(result, Status.PROCESS_DEFINE_STATE_ONLINE, String.valueOf(processDefinitionCode));
return result;
|
closed
|
apache/dolphinscheduler
|
https://github.com/apache/dolphinscheduler
| 12,621 |
[Improvement] [ApiServer] Task defination list paging sorted by updateTime not effect
|
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
List task defination and sorted by update time not effect
### What you expected to happen
List task defination and sorted by update time
### How to reproduce
List task defination and look
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
https://github.com/apache/dolphinscheduler/issues/12621
|
https://github.com/apache/dolphinscheduler/pull/12622
|
838a0df7839ae0e2c186b9bf52a0bcbcae8e7d80
|
0db1bb6ba8fcd503e215bbbf4a4529d94b2467fb
| 2022-10-31T08:44:47Z |
java
| 2022-12-13T08:35:54Z |
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
|
}
TaskDefinitionLog taskDefinition = JSONUtils.parseObject(taskDefinitionJsonObj, TaskDefinitionLog.class);
if (taskDefinition == null) {
logger.warn("Parameter taskDefinitionJsonObj is invalid json.");
putMsg(result, Status.DATA_IS_NOT_VALID, taskDefinitionJsonObj);
return result;
}
if (!taskPluginManager.checkTaskParameters(ParametersNode.builder()
.taskType(taskDefinition.getTaskType())
.taskParams(taskDefinition.getTaskParams())
.dependence(taskDefinition.getDependence())
.build())) {
logger.error("Task definition {} parameters are invalid", taskDefinition.getName());
putMsg(result, Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinition.getName());
return result;
}
long taskCode = taskDefinition.getCode();
if (taskCode == 0) {
taskDefinition.setCode(CodeGenerateUtils.getInstance().genCode());
}
List<ProcessTaskRelationLog> processTaskRelationLogList =
processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode)
.stream()
.map(ProcessTaskRelationLog::new)
.collect(Collectors.toList());
if (StringUtils.isNotBlank(upstreamCodes)) {
Set<Long> upstreamTaskCodes = Arrays.stream(upstreamCodes.split(Constants.COMMA)).map(Long::parseLong)
.collect(Collectors.toSet());
List<TaskDefinition> upstreamTaskDefinitionList = taskDefinitionMapper.queryByCodeList(upstreamTaskCodes);
Set<Long> queryUpStreamTaskCodes =
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.