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
7,804
[Feature][Task] DingTalk alert plugin adds signature.
### 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 DingTalk alert plugin adds signature. ### Use case DingTalk alert plugin adds signature. ### Related issues _No response_ ### 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/7804
https://github.com/apache/dolphinscheduler/pull/7805
64efc65edf06e8dc2ffdae14eabd4aab3d518a02
cb8c875fa86e19c70537cbe425dcbe6c9e70aefb
2022-01-05T04:55:44Z
java
2022-01-12T07:24:25Z
dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-dingtalk/src/test/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkAlertChannelFactoryTest.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.plugin.alert.dingtalk; import org.apache.dolphinscheduler.alert.api.AlertChannel; import org.apache.dolphinscheduler.spi.params.base.PluginParams; import org.apache.dolphinscheduler.spi.utils.JSONUtils; import java.util.List; import org.junit.Assert; import org.junit.Test; public class DingTalkAlertChannelFactoryTest {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,804
[Feature][Task] DingTalk alert plugin adds signature.
### 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 DingTalk alert plugin adds signature. ### Use case DingTalk alert plugin adds signature. ### Related issues _No response_ ### 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/7804
https://github.com/apache/dolphinscheduler/pull/7805
64efc65edf06e8dc2ffdae14eabd4aab3d518a02
cb8c875fa86e19c70537cbe425dcbe6c9e70aefb
2022-01-05T04:55:44Z
java
2022-01-12T07:24:25Z
dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-dingtalk/src/test/java/org/apache/dolphinscheduler/plugin/alert/dingtalk/DingTalkAlertChannelFactoryTest.java
@Test public void testGetParams() { DingTalkAlertChannelFactory dingTalkAlertChannelFactory = new DingTalkAlertChannelFactory(); List<PluginParams> params = dingTalkAlertChannelFactory.params(); JSONUtils.toJsonString(params); Assert.assertEquals(7, params.size()); } @Test public void testCreate() { DingTalkAlertChannelFactory dingTalkAlertChannelFactory = new DingTalkAlertChannelFactory(); AlertChannel alertChannel = dingTalkAlertChannelFactory.create(); Assert.assertNotNull(alertChannel); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.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.service.process; import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE; import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_START_DATE; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_EMPTY_SUB_PROCESS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_FATHER_PARAMS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS_DEFINE_CODE; import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID; import static org.apache.dolphinscheduler.common.Constants.LOCAL_PARAMS; import static java.util.stream.Collectors.toSet; import org.apache.dolphinscheduler.common.Constants;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
import org.apache.dolphinscheduler.common.enums.AuthorizationType; import org.apache.dolphinscheduler.common.enums.CommandType; import org.apache.dolphinscheduler.common.enums.Direct; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.FailureStrategy; import org.apache.dolphinscheduler.common.enums.Flag; import org.apache.dolphinscheduler.common.enums.ReleaseState; import org.apache.dolphinscheduler.common.enums.TaskDependType; import org.apache.dolphinscheduler.common.enums.TaskGroupQueueStatus; import org.apache.dolphinscheduler.common.enums.TimeoutFlag; import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.common.graph.DAG; import org.apache.dolphinscheduler.common.model.DateInterval; import org.apache.dolphinscheduler.common.model.TaskNode; import org.apache.dolphinscheduler.common.model.TaskNodeRelation; import org.apache.dolphinscheduler.common.process.ProcessDag; import org.apache.dolphinscheduler.common.process.Property; import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.task.AbstractParameters; import org.apache.dolphinscheduler.common.task.TaskTimeoutParameter; import org.apache.dolphinscheduler.common.task.subprocess.SubProcessParameters; import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils; import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils.CodeGenerateException; import org.apache.dolphinscheduler.common.utils.DateUtils; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.common.utils.ParameterUtils; import org.apache.dolphinscheduler.common.utils.TaskParametersUtils; import org.apache.dolphinscheduler.dao.entity.Command; import org.apache.dolphinscheduler.dao.entity.DagData; import org.apache.dolphinscheduler.dao.entity.DataSource;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
import org.apache.dolphinscheduler.dao.entity.Environment; import org.apache.dolphinscheduler.dao.entity.ErrorCommand; import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; import org.apache.dolphinscheduler.dao.entity.ProcessInstanceMap; 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.ProjectUser; import org.apache.dolphinscheduler.dao.entity.Resource; import org.apache.dolphinscheduler.dao.entity.Schedule; import org.apache.dolphinscheduler.dao.entity.TaskDefinition; import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog; import org.apache.dolphinscheduler.dao.entity.TaskGroup; import org.apache.dolphinscheduler.dao.entity.TaskGroupQueue; import org.apache.dolphinscheduler.dao.entity.TaskInstance; import org.apache.dolphinscheduler.dao.entity.Tenant; import org.apache.dolphinscheduler.dao.entity.UdfFunc; import org.apache.dolphinscheduler.dao.entity.User; import org.apache.dolphinscheduler.dao.mapper.CommandMapper; import org.apache.dolphinscheduler.dao.mapper.DataSourceMapper; import org.apache.dolphinscheduler.dao.mapper.EnvironmentMapper; import org.apache.dolphinscheduler.dao.mapper.ErrorCommandMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionLogMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationLogMapper; import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper; import org.apache.dolphinscheduler.dao.mapper.ResourceMapper; import org.apache.dolphinscheduler.dao.mapper.ResourceUserMapper; import org.apache.dolphinscheduler.dao.mapper.ScheduleMapper; import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionLogMapper; import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionMapper; import org.apache.dolphinscheduler.dao.mapper.TaskGroupMapper; import org.apache.dolphinscheduler.dao.mapper.TaskGroupQueueMapper; import org.apache.dolphinscheduler.dao.mapper.TaskInstanceMapper; import org.apache.dolphinscheduler.dao.mapper.TenantMapper; import org.apache.dolphinscheduler.dao.mapper.UdfFuncMapper; import org.apache.dolphinscheduler.dao.mapper.UserMapper; import org.apache.dolphinscheduler.dao.utils.DagHelper; import org.apache.dolphinscheduler.remote.command.StateEventChangeCommand; import org.apache.dolphinscheduler.remote.command.TaskEventChangeCommand; import org.apache.dolphinscheduler.remote.processor.StateEventCallbackService; import org.apache.dolphinscheduler.remote.utils.Host; import org.apache.dolphinscheduler.service.bean.SpringApplicationContext; import org.apache.dolphinscheduler.service.exceptions.ServiceException; import org.apache.dolphinscheduler.service.log.LogClientService; import org.apache.dolphinscheduler.service.quartz.cron.CronUtils; import org.apache.dolphinscheduler.spi.enums.ResourceType; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.EnumMap; import java.util.HashMap; import java.util.HashSet;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Objects; 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.Component; import org.springframework.transaction.annotation.Transactional; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.common.collect.Lists; /** * process relative dao that some mappers in this. */ @Component public class ProcessService { private final Logger logger = LoggerFactory.getLogger(getClass()); private final int[] stateArray = new int[]{ExecutionStatus.SUBMITTED_SUCCESS.ordinal(), ExecutionStatus.RUNNING_EXECUTION.ordinal(), ExecutionStatus.DELAY_EXECUTION.ordinal(), ExecutionStatus.READY_PAUSE.ordinal(), ExecutionStatus.READY_STOP.ordinal()}; @Autowired private UserMapper userMapper; @Autowired private ProcessDefinitionMapper processDefineMapper; @Autowired
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
private ProcessDefinitionLogMapper processDefineLogMapper; @Autowired private ProcessInstanceMapper processInstanceMapper; @Autowired private DataSourceMapper dataSourceMapper; @Autowired private ProcessInstanceMapMapper processInstanceMapMapper; @Autowired private TaskInstanceMapper taskInstanceMapper; @Autowired private CommandMapper commandMapper; @Autowired private ScheduleMapper scheduleMapper; @Autowired private UdfFuncMapper udfFuncMapper; @Autowired private ResourceMapper resourceMapper; @Autowired private ResourceUserMapper resourceUserMapper; @Autowired private ErrorCommandMapper errorCommandMapper; @Autowired private TenantMapper tenantMapper; @Autowired private ProjectMapper projectMapper; @Autowired private TaskDefinitionMapper taskDefinitionMapper; @Autowired private TaskDefinitionLogMapper taskDefinitionLogMapper; @Autowired
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
private ProcessTaskRelationMapper processTaskRelationMapper; @Autowired private ProcessTaskRelationLogMapper processTaskRelationLogMapper; @Autowired StateEventCallbackService stateEventCallbackService; @Autowired private EnvironmentMapper environmentMapper; @Autowired private TaskGroupQueueMapper taskGroupQueueMapper; @Autowired private TaskGroupMapper taskGroupMapper; /** * handle Command (construct ProcessInstance from Command) , wrapped in transaction * * @param logger logger * @param host host * @param command found command * @return process instance */ @Transactional public ProcessInstance handleCommand(Logger logger, String host, Command command) { ProcessInstance processInstance = constructProcessInstance(command, host); if (processInstance == null) { logger.error("scan command, command parameter is error: {}", command); moveToErrorCommand(command, "process instance is null"); return null; } processInstance.setCommandType(command.getCommandType()); processInstance.addHistoryCmd(command.getCommandType());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
ProcessDefinition processDefinition = this.findProcessDefinition(processInstance.getProcessDefinitionCode(), processInstance.getProcessDefinitionVersion()); if (processDefinition.getExecutionType().typeIsSerial()) { saveSerialProcess(processInstance, processDefinition); if (processInstance.getState() != ExecutionStatus.SUBMITTED_SUCCESS) { setSubProcessParam(processInstance); deleteCommandWithCheck(command.getId()); return null; } } else { saveProcessInstance(processInstance); } setSubProcessParam(processInstance); deleteCommandWithCheck(command.getId()); return processInstance; } private void saveSerialProcess(ProcessInstance processInstance, ProcessDefinition processDefinition) { processInstance.setState(ExecutionStatus.SERIAL_WAIT); saveProcessInstance(processInstance); if (processDefinition.getExecutionType().typeIsSerialWait()) { while (true) { List<ProcessInstance> runningProcessInstances = this.processInstanceMapper.queryByProcessDefineCodeAndStatusAndNextId(processInstance.getProcessDefinitionCode(), Constants.RUNNING_PROCESS_STATE, processInstance.getId()); if (CollectionUtils.isEmpty(runningProcessInstances)) { processInstance.setState(ExecutionStatus.SUBMITTED_SUCCESS); saveProcessInstance(processInstance); return; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
ProcessInstance runningProcess = runningProcessInstances.get(0); if (this.processInstanceMapper.updateNextProcessIdById(processInstance.getId(), runningProcess.getId())) { return; } } } else if (processDefinition.getExecutionType().typeIsSerialDiscard()) { List<ProcessInstance> runningProcessInstances = this.processInstanceMapper.queryByProcessDefineCodeAndStatusAndNextId(processInstance.getProcessDefinitionCode(), Constants.RUNNING_PROCESS_STATE, processInstance.getId()); if (CollectionUtils.isEmpty(runningProcessInstances)) { processInstance.setState(ExecutionStatus.STOP); saveProcessInstance(processInstance); } } else if (processDefinition.getExecutionType().typeIsSerialPriority()) { List<ProcessInstance> runningProcessInstances = this.processInstanceMapper.queryByProcessDefineCodeAndStatusAndNextId(processInstance.getProcessDefinitionCode(), Constants.RUNNING_PROCESS_STATE, processInstance.getId()); if (CollectionUtils.isNotEmpty(runningProcessInstances)) { for (ProcessInstance info : runningProcessInstances) { info.setCommandType(CommandType.STOP); info.addHistoryCmd(CommandType.STOP); info.setState(ExecutionStatus.READY_STOP); int update = updateProcessInstance(info); if (update > 0) { String host = info.getHost(); String address = host.split(":")[0]; int port = Integer.parseInt(host.split(":")[1]); StateEventChangeCommand stateEventChangeCommand = new StateEventChangeCommand( info.getId(), 0, info.getState(), info.getId(), 0 ); try {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
stateEventCallbackService.sendResult(address, port, stateEventChangeCommand.convert2Command()); } catch (Exception e) { logger.error("sendResultError"); } } } } } } /** * save error command, and delete original command * * @param command command * @param message message */ public void moveToErrorCommand(Command command, String message) { ErrorCommand errorCommand = new ErrorCommand(command, message); this.errorCommandMapper.insert(errorCommand); this.commandMapper.deleteById(command.getId()); } /** * set process waiting thread * * @param command command * @param processInstance processInstance * @return process instance */ private ProcessInstance setWaitingThreadProcess(Command command, ProcessInstance processInstance) { processInstance.setState(ExecutionStatus.WAITING_THREAD); if (command.getCommandType() != CommandType.RECOVER_WAITING_THREAD) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
processInstance.addHistoryCmd(command.getCommandType()); } saveProcessInstance(processInstance); this.setSubProcessParam(processInstance); createRecoveryWaitingThreadCommand(command, processInstance); return null; } /** * insert one command * * @param command command * @return create result */ public int createCommand(Command command) { int result = 0; if (command != null) { result = commandMapper.insert(command); } return result; } /** * get command page */ public List<Command> findCommandPage(int pageSize, int pageNumber) { return commandMapper.queryCommandPage(pageSize, pageNumber * pageSize); } /** * check the input command exists in queue list * * @param command command
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @return create command result */ public boolean verifyIsNeedCreateCommand(Command command) { boolean isNeedCreate = true; EnumMap<CommandType, Integer> cmdTypeMap = new EnumMap<>(CommandType.class); cmdTypeMap.put(CommandType.REPEAT_RUNNING, 1); cmdTypeMap.put(CommandType.RECOVER_SUSPENDED_PROCESS, 1); cmdTypeMap.put(CommandType.START_FAILURE_TASK_PROCESS, 1); CommandType commandType = command.getCommandType(); if (cmdTypeMap.containsKey(commandType)) { ObjectNode cmdParamObj = JSONUtils.parseObject(command.getCommandParam()); int processInstanceId = cmdParamObj.path(CMD_PARAM_RECOVER_PROCESS_ID_STRING).asInt(); List<Command> commands = commandMapper.selectList(null); for (Command tmpCommand : commands) { if (cmdTypeMap.containsKey(tmpCommand.getCommandType())) { ObjectNode tempObj = JSONUtils.parseObject(tmpCommand.getCommandParam()); if (tempObj != null && processInstanceId == tempObj.path(CMD_PARAM_RECOVER_PROCESS_ID_STRING).asInt()) { isNeedCreate = false; break; } } } } return isNeedCreate; } /** * find process instance detail by id * * @param processId processId
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @return process instance */ public ProcessInstance findProcessInstanceDetailById(int processId) { return processInstanceMapper.queryDetailById(processId); } /** * get task node list by definitionId */ public List<TaskDefinition> getTaskNodeListByDefinition(long defineCode) { ProcessDefinition processDefinition = processDefineMapper.queryByCode(defineCode); if (processDefinition == null) { logger.error("process define not exists"); return Lists.newArrayList(); } List<ProcessTaskRelationLog> processTaskRelations = processTaskRelationLogMapper.queryByProcessCodeAndVersion(processDefinition.getCode(), processDefinition.getVersion()); Set<TaskDefinition> taskDefinitionSet = new HashSet<>(); for (ProcessTaskRelationLog processTaskRelation : processTaskRelations) { if (processTaskRelation.getPostTaskCode() > 0) { taskDefinitionSet.add(new TaskDefinition(processTaskRelation.getPostTaskCode(), processTaskRelation.getPostTaskVersion())); } } if (taskDefinitionSet.isEmpty()) { return Lists.newArrayList(); } List<TaskDefinitionLog> taskDefinitionLogs = taskDefinitionLogMapper.queryByTaskDefinitions(taskDefinitionSet); return Lists.newArrayList(taskDefinitionLogs); } /** * find process instance by id *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @param processId processId * @return process instance */ public ProcessInstance findProcessInstanceById(int processId) { return processInstanceMapper.selectById(processId); } /** * find process define by id. * * @param processDefinitionId processDefinitionId * @return process definition */ public ProcessDefinition findProcessDefineById(int processDefinitionId) { return processDefineMapper.selectById(processDefinitionId); } /** * find process define by code and version. * * @param processDefinitionCode processDefinitionCode * @return process definition */ public ProcessDefinition findProcessDefinition(Long processDefinitionCode, int version) { ProcessDefinition processDefinition = processDefineMapper.queryByCode(processDefinitionCode); if (processDefinition == null || processDefinition.getVersion() != version) { processDefinition = processDefineLogMapper.queryByDefinitionCodeAndVersion(processDefinitionCode, version); if (processDefinition != null) { processDefinition.setId(0); } } return processDefinition;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} /** * find process define by code. * * @param processDefinitionCode processDefinitionCode * @return process definition */ public ProcessDefinition findProcessDefinitionByCode(Long processDefinitionCode) { return processDefineMapper.queryByCode(processDefinitionCode); } /** * delete work process instance by id * * @param processInstanceId processInstanceId * @return delete process instance result */ public int deleteWorkProcessInstanceById(int processInstanceId) { return processInstanceMapper.deleteById(processInstanceId); } /** * delete all sub process by parent instance id * * @param processInstanceId processInstanceId * @return delete all sub process instance result */ public int deleteAllSubWorkProcessByParentId(int processInstanceId) { List<Integer> subProcessIdList = processInstanceMapMapper.querySubIdListByParentId(processInstanceId); for (Integer subId : subProcessIdList) { deleteAllSubWorkProcessByParentId(subId); deleteWorkProcessMapByParentId(subId);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
removeTaskLogFile(subId); deleteWorkProcessInstanceById(subId); } return 1; } /** * remove task log file * * @param processInstanceId processInstanceId */ public void removeTaskLogFile(Integer processInstanceId) { List<TaskInstance> taskInstanceList = findValidTaskListByProcessId(processInstanceId); if (CollectionUtils.isEmpty(taskInstanceList)) { return; } try (LogClientService logClient = new LogClientService()) { for (TaskInstance taskInstance : taskInstanceList) { String taskLogPath = taskInstance.getLogPath(); if (StringUtils.isEmpty(taskInstance.getHost())) { continue; } Host host = Host.of(taskInstance.getHost()); logClient.removeTaskLog(host.getIp(), host.getPort(), taskLogPath); } } } /** * recursive delete all task instance by process instance id * @param processInstanceId
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
*/ public void deleteWorkTaskInstanceByProcessInstanceId(int processInstanceId) { List<TaskInstance> taskInstanceList = findValidTaskListByProcessId(processInstanceId); if (CollectionUtils.isEmpty(taskInstanceList)) { return; } List<Integer> taskInstanceIdList = new ArrayList<>(); for (TaskInstance taskInstance : taskInstanceList) { taskInstanceIdList.add(taskInstance.getId()); } taskInstanceMapper.deleteBatchIds(taskInstanceIdList); } /** * recursive query sub process definition id by parent id. * * @param parentCode parentCode * @param ids ids */ public void recurseFindSubProcess(long parentCode, List<Long> ids) { List<TaskDefinition> taskNodeList = this.getTaskNodeListByDefinition(parentCode); if (taskNodeList != null && !taskNodeList.isEmpty()) { for (TaskDefinition taskNode : taskNodeList) { String parameter = taskNode.getTaskParams(); ObjectNode parameterJson = JSONUtils.parseObject(parameter); if (parameterJson.get(CMD_PARAM_SUB_PROCESS_DEFINE_CODE) != null) { SubProcessParameters subProcessParam = JSONUtils.parseObject(parameter, SubProcessParameters.class); ids.add(subProcessParam.getProcessDefinitionCode()); recurseFindSubProcess(subProcessParam.getProcessDefinitionCode(), ids); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} } /** * create recovery waiting thread command when thread pool is not enough for the process instance. * sub work process instance need not to create recovery command. * create recovery waiting thread command and delete origin command at the same time. * if the recovery command is exists, only update the field update_time * * @param originCommand originCommand * @param processInstance processInstance */ public void createRecoveryWaitingThreadCommand(Command originCommand, ProcessInstance processInstance) { if (processInstance.getIsSubProcess() == Flag.YES) { if (originCommand != null) { commandMapper.deleteById(originCommand.getId()); } return; } Map<String, String> cmdParam = new HashMap<>(); cmdParam.put(Constants.CMD_PARAM_RECOVERY_WAITING_THREAD, String.valueOf(processInstance.getId())); if (originCommand == null) { Command command = new Command( CommandType.RECOVER_WAITING_THREAD, processInstance.getTaskDependType(), processInstance.getFailureStrategy(), processInstance.getExecutorId(), processInstance.getProcessDefinition().getCode(), JSONUtils.toJsonString(cmdParam),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
processInstance.getWarningType(), processInstance.getWarningGroupId(), processInstance.getScheduleTime(), processInstance.getWorkerGroup(), processInstance.getEnvironmentCode(), processInstance.getProcessInstancePriority(), processInstance.getDryRun(), processInstance.getId(), processInstance.getProcessDefinitionVersion() ); saveCommand(command); return; } if (originCommand.getCommandType() == CommandType.RECOVER_WAITING_THREAD) { originCommand.setUpdateTime(new Date()); saveCommand(originCommand); } else { commandMapper.deleteById(originCommand.getId()); originCommand.setId(0); originCommand.setCommandType(CommandType.RECOVER_WAITING_THREAD); originCommand.setUpdateTime(new Date()); originCommand.setCommandParam(JSONUtils.toJsonString(cmdParam)); originCommand.setProcessInstancePriority(processInstance.getProcessInstancePriority()); saveCommand(originCommand); } } /** * get schedule time from command
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* * @param command command * @param cmdParam cmdParam map * @return date */ private Date getScheduleTime(Command command, Map<String, String> cmdParam) { Date scheduleTime = command.getScheduleTime(); if (scheduleTime == null && cmdParam != null && cmdParam.containsKey(CMDPARAM_COMPLEMENT_DATA_START_DATE)) { Date start = DateUtils.stringToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE)); Date end = DateUtils.stringToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE)); List<Schedule> schedules = queryReleaseSchedulerListByProcessDefinitionCode(command.getProcessDefinitionCode()); List<Date> complementDateList = CronUtils.getSelfFireDateList(start, end, schedules); if (complementDateList.size() > 0) { scheduleTime = complementDateList.get(0); } else { logger.error("set scheduler time error: complement date list is empty, command: {}", command.toString()); } } return scheduleTime; } /** * generate a new work process instance from command. * * @param processDefinition processDefinition * @param command command * @param cmdParam cmdParam map * @return process instance
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
*/ private ProcessInstance generateNewProcessInstance(ProcessDefinition processDefinition, Command command, Map<String, String> cmdParam) { ProcessInstance processInstance = new ProcessInstance(processDefinition); processInstance.setProcessDefinitionCode(processDefinition.getCode()); processInstance.setProcessDefinitionVersion(processDefinition.getVersion()); processInstance.setState(ExecutionStatus.RUNNING_EXECUTION); processInstance.setRecovery(Flag.NO); processInstance.setStartTime(new Date()); processInstance.setRestartTime(processInstance.getStartTime()); processInstance.setRunTimes(1); processInstance.setMaxTryTimes(0); processInstance.setCommandParam(command.getCommandParam()); processInstance.setCommandType(command.getCommandType()); processInstance.setIsSubProcess(Flag.NO); processInstance.setTaskDependType(command.getTaskDependType()); processInstance.setFailureStrategy(command.getFailureStrategy()); processInstance.setExecutorId(command.getExecutorId()); WarningType warningType = command.getWarningType() == null ? WarningType.NONE : command.getWarningType(); processInstance.setWarningType(warningType); Integer warningGroupId = command.getWarningGroupId() == null ? 0 : command.getWarningGroupId(); processInstance.setWarningGroupId(warningGroupId); processInstance.setDryRun(command.getDryRun()); if (command.getScheduleTime() != null) { processInstance.setScheduleTime(command.getScheduleTime()); } processInstance.setCommandStartTime(command.getStartTime()); processInstance.setLocations(processDefinition.getLocations());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
setGlobalParamIfCommanded(processDefinition, cmdParam); processInstance.setGlobalParams(ParameterUtils.curingGlobalParams( processDefinition.getGlobalParamMap(), processDefinition.getGlobalParamList(), getCommandTypeIfComplement(processInstance, command), processInstance.getScheduleTime())); processInstance.setProcessInstancePriority(command.getProcessInstancePriority()); String workerGroup = StringUtils.isBlank(command.getWorkerGroup()) ? Constants.DEFAULT_WORKER_GROUP : command.getWorkerGroup(); processInstance.setWorkerGroup(workerGroup); processInstance.setEnvironmentCode(Objects.isNull(command.getEnvironmentCode()) ? -1 : command.getEnvironmentCode()); processInstance.setTimeout(processDefinition.getTimeout()); processInstance.setTenantId(processDefinition.getTenantId()); return processInstance; } private void setGlobalParamIfCommanded(ProcessDefinition processDefinition, Map<String, String> cmdParam) { Map<String, String> startParamMap = new HashMap<>(); if (cmdParam != null && cmdParam.containsKey(Constants.CMD_PARAM_START_PARAMS)) { String startParamJson = cmdParam.get(Constants.CMD_PARAM_START_PARAMS); startParamMap = JSONUtils.toMap(startParamJson); } Map<String, String> fatherParamMap = new HashMap<>(); if (cmdParam != null && cmdParam.containsKey(Constants.CMD_PARAM_FATHER_PARAMS)) { String fatherParamJson = cmdParam.get(Constants.CMD_PARAM_FATHER_PARAMS); fatherParamMap = JSONUtils.toMap(fatherParamJson); } startParamMap.putAll(fatherParamMap);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (startParamMap.size() > 0 && processDefinition.getGlobalParamMap() != null) { for (Map.Entry<String, String> param : processDefinition.getGlobalParamMap().entrySet()) { String val = startParamMap.get(param.getKey()); if (val != null) { param.setValue(val); } } } } /** * get process tenant * there is tenant id in definition, use the tenant of the definition. * if there is not tenant id in the definiton or the tenant not exist * use definition creator's tenant. * * @param tenantId tenantId * @param userId userId * @return tenant */ public Tenant getTenantForProcess(int tenantId, int userId) { Tenant tenant = null; if (tenantId >= 0) { tenant = tenantMapper.queryById(tenantId); } if (userId == 0) { return null; } if (tenant == null) { User user = userMapper.selectById(userId);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
tenant = tenantMapper.queryById(user.getTenantId()); } return tenant; } /** * get an environment * use the code of the environment to find a environment. * * @param environmentCode environmentCode * @return Environment */ public Environment findEnvironmentByCode(Long environmentCode) { Environment environment = null; if (environmentCode >= 0) { environment = environmentMapper.queryByEnvironmentCode(environmentCode); } return environment; } /** * check command parameters is valid * * @param command command * @param cmdParam cmdParam map * @return whether command param is valid */ private Boolean checkCmdParam(Command command, Map<String, String> cmdParam) { if (command.getTaskDependType() == TaskDependType.TASK_ONLY || command.getTaskDependType() == TaskDependType.TASK_PRE) { if (cmdParam == null || !cmdParam.containsKey(Constants.CMD_PARAM_START_NODES) || cmdParam.get(Constants.CMD_PARAM_START_NODES).isEmpty()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
logger.error("command node depend type is {}, but start nodes is null ", command.getTaskDependType()); return false; } } return true; } /** * construct process instance according to one command. * * @param command command * @param host host * @return process instance */ private ProcessInstance constructProcessInstance(Command command, String host) { ProcessInstance processInstance; ProcessDefinition processDefinition; CommandType commandType = command.getCommandType(); processDefinition = this.findProcessDefinition(command.getProcessDefinitionCode(), command.getProcessDefinitionVersion()); if (processDefinition == null) { logger.error("cannot find the work process define! define code : {}", command.getProcessDefinitionCode()); return null; } Map<String, String> cmdParam = JSONUtils.toMap(command.getCommandParam()); int processInstanceId = command.getProcessInstanceId(); if (processInstanceId == 0) { processInstance = generateNewProcessInstance(processDefinition, command, cmdParam); } else { processInstance = this.findProcessInstanceDetailById(processInstanceId); if (processInstance == null) { return processInstance;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} } if (cmdParam != null) { CommandType commandTypeIfComplement = getCommandTypeIfComplement(processInstance, command); if (commandTypeIfComplement == CommandType.REPEAT_RUNNING) { setGlobalParamIfCommanded(processDefinition, cmdParam); } processInstance.setGlobalParams(ParameterUtils.curingGlobalParams( processDefinition.getGlobalParamMap(), processDefinition.getGlobalParamList(), commandTypeIfComplement, processInstance.getScheduleTime())); processInstance.setProcessDefinition(processDefinition); } if (processInstance.getCommandParam() != null) { Map<String, String> processCmdParam = JSONUtils.toMap(processInstance.getCommandParam()); for (Map.Entry<String, String> entry : processCmdParam.entrySet()) { if (!cmdParam.containsKey(entry.getKey())) { cmdParam.put(entry.getKey(), entry.getValue()); } } } if (cmdParam != null && cmdParam.containsKey(Constants.CMD_PARAM_SUB_PROCESS)) { processInstance.setCommandParam(command.getCommandParam()); } if (Boolean.FALSE.equals(checkCmdParam(command, cmdParam))) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
logger.error("command parameter check failed!"); return null; } if (command.getScheduleTime() != null) { processInstance.setScheduleTime(command.getScheduleTime()); } processInstance.setHost(host); processInstance.setRestartTime(new Date()); ExecutionStatus runStatus = ExecutionStatus.RUNNING_EXECUTION; int runTime = processInstance.getRunTimes(); switch (commandType) { case START_PROCESS: break; case START_FAILURE_TASK_PROCESS: List<Integer> failedList = this.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.FAILURE); List<Integer> toleranceList = this.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.NEED_FAULT_TOLERANCE); List<Integer> killedList = this.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.KILL); cmdParam.remove(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING); failedList.addAll(killedList); failedList.addAll(toleranceList); for (Integer taskId : failedList) { initTaskInstance(this.findTaskInstanceById(taskId)); } cmdParam.put(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING, String.join(Constants.COMMA, convertIntListToString(failedList))); processInstance.setCommandParam(JSONUtils.toJsonString(cmdParam)); processInstance.setRunTimes(runTime + 1); break; case START_CURRENT_TASK_PROCESS:
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
break; case RECOVER_WAITING_THREAD: break; case RECOVER_SUSPENDED_PROCESS: cmdParam.remove(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING); List<Integer> suspendedNodeList = this.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.PAUSE); List<Integer> stopNodeList = findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.KILL); suspendedNodeList.addAll(stopNodeList); for (Integer taskId : suspendedNodeList) { initTaskInstance(this.findTaskInstanceById(taskId)); } cmdParam.put(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING, String.join(",", convertIntListToString(suspendedNodeList))); processInstance.setCommandParam(JSONUtils.toJsonString(cmdParam)); processInstance.setRunTimes(runTime + 1); break; case RECOVER_TOLERANCE_FAULT_PROCESS: processInstance.setRecovery(Flag.YES); runStatus = processInstance.getState(); break; case COMPLEMENT_DATA: if (processInstance.getId() != 0) { List<TaskInstance> taskInstanceList = this.findValidTaskListByProcessId(processInstance.getId()); for (TaskInstance taskInstance : taskInstanceList) { taskInstance.setFlag(Flag.NO); this.updateTaskInstance(taskInstance);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} } break; case REPEAT_RUNNING: if (cmdParam.containsKey(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING)) { cmdParam.remove(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING); processInstance.setCommandParam(JSONUtils.toJsonString(cmdParam)); } List<TaskInstance> validTaskList = findValidTaskListByProcessId(processInstance.getId()); for (TaskInstance taskInstance : validTaskList) { taskInstance.setFlag(Flag.NO); updateTaskInstance(taskInstance); } processInstance.setStartTime(new Date()); processInstance.setRestartTime(processInstance.getStartTime()); processInstance.setEndTime(null); processInstance.setRunTimes(runTime + 1); initComplementDataParam(processDefinition, processInstance, cmdParam); break; case SCHEDULER: break; default: break; } processInstance.setState(runStatus); return processInstance; } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* get process definition by command * If it is a fault-tolerant command, get the specified version of ProcessDefinition through ProcessInstance * Otherwise, get the latest version of ProcessDefinition * * @return ProcessDefinition */ private ProcessDefinition getProcessDefinitionByCommand(long processDefinitionCode, Map<String, String> cmdParam) { if (cmdParam != null) { int processInstanceId = 0; if (cmdParam.containsKey(Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING)) { processInstanceId = Integer.parseInt(cmdParam.get(Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING)); } else if (cmdParam.containsKey(Constants.CMD_PARAM_SUB_PROCESS)) { processInstanceId = Integer.parseInt(cmdParam.get(Constants.CMD_PARAM_SUB_PROCESS)); } else if (cmdParam.containsKey(Constants.CMD_PARAM_RECOVERY_WAITING_THREAD)) { processInstanceId = Integer.parseInt(cmdParam.get(Constants.CMD_PARAM_RECOVERY_WAITING_THREAD)); } if (processInstanceId != 0) { ProcessInstance processInstance = this.findProcessInstanceDetailById(processInstanceId); if (processInstance == null) { return null; } return processDefineLogMapper.queryByDefinitionCodeAndVersion( processInstance.getProcessDefinitionCode(), processInstance.getProcessDefinitionVersion()); } } return processDefineMapper.queryByCode(processDefinitionCode); } /** * return complement data if the process start with complement data *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @param processInstance processInstance * @param command command * @return command type */ private CommandType getCommandTypeIfComplement(ProcessInstance processInstance, Command command) { if (CommandType.COMPLEMENT_DATA == processInstance.getCmdTypeIfComplement()) { return CommandType.COMPLEMENT_DATA; } else { return command.getCommandType(); } } /** * initialize complement data parameters * * @param processDefinition processDefinition * @param processInstance processInstance * @param cmdParam cmdParam */ private void initComplementDataParam(ProcessDefinition processDefinition, ProcessInstance processInstance, Map<String, String> cmdParam) { if (!processInstance.isComplementData()) { return; } Date start = DateUtils.stringToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE)); Date end = DateUtils.stringToDate(cmdParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE)); List<Schedule> listSchedules = queryReleaseSchedulerListByProcessDefinitionCode(processInstance.getProcessDefinitionCode()); List<Date> complementDate = CronUtils.getSelfFireDateList(start, end, listSchedules); if (complementDate.size() > 0 && Flag.NO == processInstance.getIsSubProcess()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
processInstance.setScheduleTime(complementDate.get(0)); } processInstance.setGlobalParams(ParameterUtils.curingGlobalParams( processDefinition.getGlobalParamMap(), processDefinition.getGlobalParamList(), CommandType.COMPLEMENT_DATA, processInstance.getScheduleTime())); } /** * set sub work process parameters. * handle sub work process instance, update relation table and command parameters * set sub work process flag, extends parent work process command parameters * * @param subProcessInstance subProcessInstance */ public void setSubProcessParam(ProcessInstance subProcessInstance) { String cmdParam = subProcessInstance.getCommandParam(); if (StringUtils.isEmpty(cmdParam)) { return; } Map<String, String> paramMap = JSONUtils.toMap(cmdParam); if (paramMap.containsKey(CMD_PARAM_SUB_PROCESS) && CMD_PARAM_EMPTY_SUB_PROCESS.equals(paramMap.get(CMD_PARAM_SUB_PROCESS))) { paramMap.remove(CMD_PARAM_SUB_PROCESS); paramMap.put(CMD_PARAM_SUB_PROCESS, String.valueOf(subProcessInstance.getId())); subProcessInstance.setCommandParam(JSONUtils.toJsonString(paramMap)); subProcessInstance.setIsSubProcess(Flag.YES); this.saveProcessInstance(subProcessInstance); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
String parentInstanceId = paramMap.get(CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID); if (StringUtils.isNotEmpty(parentInstanceId)) { ProcessInstance parentInstance = findProcessInstanceDetailById(Integer.parseInt(parentInstanceId)); if (parentInstance != null) { subProcessInstance.setGlobalParams( joinGlobalParams(parentInstance.getGlobalParams(), subProcessInstance.getGlobalParams())); this.saveProcessInstance(subProcessInstance); } else { logger.error("sub process command params error, cannot find parent instance: {} ", cmdParam); } } ProcessInstanceMap processInstanceMap = JSONUtils.parseObject(cmdParam, ProcessInstanceMap.class); if (processInstanceMap == null || processInstanceMap.getParentProcessInstanceId() == 0) { return; } processInstanceMap.setProcessInstanceId(subProcessInstance.getId()); this.updateWorkProcessInstanceMap(processInstanceMap); } /** * join parent global params into sub process. * only the keys doesn't in sub process global would be joined. * * @param parentGlobalParams parentGlobalParams * @param subGlobalParams subGlobalParams * @return global params join */ private String joinGlobalParams(String parentGlobalParams, String subGlobalParams) { List<Property> parentPropertyList = JSONUtils.toList(parentGlobalParams, Property.class); List<Property> subPropertyList = JSONUtils.toList(subGlobalParams, Property.class);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
subPropertyList = new ArrayList<>(subPropertyList); Map<String, String> subMap = subPropertyList.stream().collect(Collectors.toMap(Property::getProp, Property::getValue)); for (Property parent : parentPropertyList) { if (!subMap.containsKey(parent.getProp())) { subPropertyList.add(parent); } } return JSONUtils.toJsonString(subPropertyList); } /** * initialize task instance * * @param taskInstance taskInstance */ private void initTaskInstance(TaskInstance taskInstance) { if (!taskInstance.isSubProcess() && (taskInstance.getState().typeIsCancel() || taskInstance.getState().typeIsFailure())) { taskInstance.setFlag(Flag.NO); updateTaskInstance(taskInstance); return; } taskInstance.setState(ExecutionStatus.SUBMITTED_SUCCESS); updateTaskInstance(taskInstance); } /** * retry submit task to db */ public TaskInstance submitTaskWithRetry(ProcessInstance processInstance, TaskInstance taskInstance, int commitRetryTimes, int commitInterval) { int retryTimes = 1;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
TaskInstance task = null; while (retryTimes <= commitRetryTimes) { try { task = SpringApplicationContext.getBean(ProcessService.class).submitTask(processInstance, taskInstance); if (task != null && task.getId() != 0) { break; } logger.error("task commit to db failed , taskId {} has already retry {} times, please check the database", taskInstance.getId(), retryTimes); Thread.sleep(commitInterval); } catch (Exception e) { logger.error("task commit to mysql failed", e); } retryTimes += 1; } return task; } /** * submit task to db * submit sub process to command * * @param processInstance processInstance * @param taskInstance taskInstance * @return task instance */ @Transactional(rollbackFor = Exception.class) public TaskInstance submitTask(ProcessInstance processInstance, TaskInstance taskInstance) { logger.info("start submit task : {}, instance id:{}, state: {}", taskInstance.getName(), taskInstance.getProcessInstanceId(), processInstance.getState());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
TaskInstance task = submitTaskInstanceToDB(taskInstance, processInstance); if (task == null) { logger.error("end submit task to db error, task name:{}, process id:{} state: {} ", taskInstance.getName(), taskInstance.getProcessInstance(), processInstance.getState()); return null; } if (!task.getState().typeIsFinished()) { createSubWorkProcess(processInstance, task); } logger.info("end submit task to db successfully:{} {} state:{} complete, instance id:{} state: {} ", taskInstance.getId(), taskInstance.getName(), task.getState(), processInstance.getId(), processInstance.getState()); return task; } /** * set work process instance map * consider o * repeat running does not generate new sub process instance * set map {parent instance id, task instance id, 0(child instance id)} * * @param parentInstance parentInstance * @param parentTask parentTask * @return process instance map */ private ProcessInstanceMap setProcessInstanceMap(ProcessInstance parentInstance, TaskInstance parentTask) { ProcessInstanceMap processMap = findWorkProcessMapByParent(parentInstance.getId(), parentTask.getId()); if (processMap != null) { return processMap; } if (parentInstance.getCommandType() == CommandType.REPEAT_RUNNING) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
processMap = findPreviousTaskProcessMap(parentInstance, parentTask); if (processMap != null) { processMap.setParentTaskInstanceId(parentTask.getId()); updateWorkProcessInstanceMap(processMap); return processMap; } } processMap = new ProcessInstanceMap(); processMap.setParentProcessInstanceId(parentInstance.getId()); processMap.setParentTaskInstanceId(parentTask.getId()); createWorkProcessInstanceMap(processMap); return processMap; } /** * find previous task work process map. * * @param parentProcessInstance parentProcessInstance * @param parentTask parentTask * @return process instance map */ private ProcessInstanceMap findPreviousTaskProcessMap(ProcessInstance parentProcessInstance, TaskInstance parentTask) { Integer preTaskId = 0; List<TaskInstance> preTaskList = this.findPreviousTaskListByWorkProcessId(parentProcessInstance.getId()); for (TaskInstance task : preTaskList) { if (task.getName().equals(parentTask.getName())) { preTaskId = task.getId(); ProcessInstanceMap map = findWorkProcessMapByParent(parentProcessInstance.getId(), preTaskId); if (map != null) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return map; } } } logger.info("sub process instance is not found,parent task:{},parent instance:{}", parentTask.getId(), parentProcessInstance.getId()); return null; } /** * create sub work process command * * @param parentProcessInstance parentProcessInstance * @param task task */ public void createSubWorkProcess(ProcessInstance parentProcessInstance, TaskInstance task) { if (!task.isSubProcess()) { return; } ProcessInstanceMap instanceMap = findWorkProcessMapByParent(parentProcessInstance.getId(), task.getId()); if (null != instanceMap && CommandType.RECOVER_TOLERANCE_FAULT_PROCESS == parentProcessInstance.getCommandType()) { return; } instanceMap = setProcessInstanceMap(parentProcessInstance, task); ProcessInstance childInstance = null; if (instanceMap.getProcessInstanceId() != 0) { childInstance = findProcessInstanceById(instanceMap.getProcessInstanceId()); } Command subProcessCommand = createSubProcessCommand(parentProcessInstance, childInstance, instanceMap, task);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
updateSubProcessDefinitionByParent(parentProcessInstance, subProcessCommand.getProcessDefinitionCode()); initSubInstanceState(childInstance); createCommand(subProcessCommand); logger.info("sub process command created: {} ", subProcessCommand); } /** * complement data needs transform parent parameter to child. */ private String getSubWorkFlowParam(ProcessInstanceMap instanceMap, ProcessInstance parentProcessInstance, Map<String, String> fatherParams) { String processMapStr = JSONUtils.toJsonString(instanceMap); Map<String, String> cmdParam = JSONUtils.toMap(processMapStr); if (parentProcessInstance.isComplementData()) { Map<String, String> parentParam = JSONUtils.toMap(parentProcessInstance.getCommandParam()); String endTime = parentParam.get(CMDPARAM_COMPLEMENT_DATA_END_DATE); String startTime = parentParam.get(CMDPARAM_COMPLEMENT_DATA_START_DATE); cmdParam.put(CMDPARAM_COMPLEMENT_DATA_END_DATE, endTime); cmdParam.put(CMDPARAM_COMPLEMENT_DATA_START_DATE, startTime); processMapStr = JSONUtils.toJsonString(cmdParam); } if (fatherParams.size() != 0) { cmdParam.put(CMD_PARAM_FATHER_PARAMS, JSONUtils.toJsonString(fatherParams)); processMapStr = JSONUtils.toJsonString(cmdParam); } return processMapStr; } public Map<String, String> getGlobalParamMap(String globalParams) { List<Property> propList; Map<String, String> globalParamMap = new HashMap<>(); if (StringUtils.isNotEmpty(globalParams)) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
propList = JSONUtils.toList(globalParams, Property.class); globalParamMap = propList.stream().collect(Collectors.toMap(Property::getProp, Property::getValue)); } return globalParamMap; } /** * create sub work process command */ public Command createSubProcessCommand(ProcessInstance parentProcessInstance, ProcessInstance childInstance, ProcessInstanceMap instanceMap, TaskInstance task) { CommandType commandType = getSubCommandType(parentProcessInstance, childInstance); Map<String, String> subProcessParam = JSONUtils.toMap(task.getTaskParams()); long childDefineCode = 0L; if (subProcessParam.containsKey(Constants.CMD_PARAM_SUB_PROCESS_DEFINE_CODE)) { childDefineCode = Long.parseLong(subProcessParam.get(Constants.CMD_PARAM_SUB_PROCESS_DEFINE_CODE)); } ProcessDefinition subProcessDefinition = processDefineMapper.queryByCode(childDefineCode); Object localParams = subProcessParam.get(Constants.LOCAL_PARAMS); List<Property> allParam = JSONUtils.toList(JSONUtils.toJsonString(localParams), Property.class); Map<String, String> globalMap = this.getGlobalParamMap(parentProcessInstance.getGlobalParams()); Map<String, String> fatherParams = new HashMap<>(); if (CollectionUtils.isNotEmpty(allParam)) { for (Property info : allParam) { fatherParams.put(info.getProp(), globalMap.get(info.getProp())); } } String processParam = getSubWorkFlowParam(instanceMap, parentProcessInstance, fatherParams); int subProcessInstanceId = childInstance == null ? 0 : childInstance.getId();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return new Command( commandType, TaskDependType.TASK_POST, parentProcessInstance.getFailureStrategy(), parentProcessInstance.getExecutorId(), subProcessDefinition.getCode(), processParam, parentProcessInstance.getWarningType(), parentProcessInstance.getWarningGroupId(), parentProcessInstance.getScheduleTime(), task.getWorkerGroup(), task.getEnvironmentCode(), parentProcessInstance.getProcessInstancePriority(), parentProcessInstance.getDryRun(), subProcessInstanceId, subProcessDefinition.getVersion() ); } /** * initialize sub work flow state * child instance state would be initialized when 'recovery from pause/stop/failure' */ private void initSubInstanceState(ProcessInstance childInstance) { if (childInstance != null) { childInstance.setState(ExecutionStatus.RUNNING_EXECUTION); updateProcessInstance(childInstance); } } /** * get sub work flow command type
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* child instance exist: child command = fatherCommand * child instance not exists: child command = fatherCommand[0] */ private CommandType getSubCommandType(ProcessInstance parentProcessInstance, ProcessInstance childInstance) { CommandType commandType = parentProcessInstance.getCommandType(); if (childInstance == null) { String fatherHistoryCommand = parentProcessInstance.getHistoryCmd(); commandType = CommandType.valueOf(fatherHistoryCommand.split(Constants.COMMA)[0]); } return commandType; } /** * update sub process definition * * @param parentProcessInstance parentProcessInstance * @param childDefinitionCode childDefinitionId */ private void updateSubProcessDefinitionByParent(ProcessInstance parentProcessInstance, long childDefinitionCode) { ProcessDefinition fatherDefinition = this.findProcessDefinition(parentProcessInstance.getProcessDefinitionCode(), parentProcessInstance.getProcessDefinitionVersion()); ProcessDefinition childDefinition = this.findProcessDefinitionByCode(childDefinitionCode); if (childDefinition != null && fatherDefinition != null) { childDefinition.setWarningGroupId(fatherDefinition.getWarningGroupId()); processDefineMapper.updateById(childDefinition); } } /** * submit task to mysql * * @param taskInstance taskInstance
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @param processInstance processInstance * @return task instance */ public TaskInstance submitTaskInstanceToDB(TaskInstance taskInstance, ProcessInstance processInstance) { ExecutionStatus processInstanceState = processInstance.getState(); if (taskInstance.getState().typeIsFailure()) { if (taskInstance.isSubProcess()) { taskInstance.setRetryTimes(taskInstance.getRetryTimes() + 1); } else { if (processInstanceState != ExecutionStatus.READY_STOP && processInstanceState != ExecutionStatus.READY_PAUSE) { taskInstance.setFlag(Flag.NO); updateTaskInstance(taskInstance); if (taskInstance.getState() != ExecutionStatus.NEED_FAULT_TOLERANCE) { taskInstance.setRetryTimes(taskInstance.getRetryTimes() + 1); } taskInstance.setSubmitTime(null); taskInstance.setLogPath(null); taskInstance.setExecutePath(null); taskInstance.setStartTime(null); taskInstance.setEndTime(null); taskInstance.setFlag(Flag.YES); taskInstance.setHost(null); taskInstance.setId(0); } } } taskInstance.setExecutorId(processInstance.getExecutorId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
taskInstance.setProcessInstancePriority(processInstance.getProcessInstancePriority()); taskInstance.setState(getSubmitTaskState(taskInstance, processInstance)); if (taskInstance.getSubmitTime() == null) { taskInstance.setSubmitTime(new Date()); } if (taskInstance.getFirstSubmitTime() == null) { taskInstance.setFirstSubmitTime(taskInstance.getSubmitTime()); } boolean saveResult = saveTaskInstance(taskInstance); if (!saveResult) { return null; } return taskInstance; } /** * get submit task instance state by the work process state * cannot modify the task state when running/kill/submit success, or this * task instance is already exists in task queue . * return pause if work process state is ready pause * return stop if work process state is ready stop * if all of above are not satisfied, return submit success * * @param taskInstance taskInstance * @param processInstance processInstance * @return process instance state */ public ExecutionStatus getSubmitTaskState(TaskInstance taskInstance, ProcessInstance processInstance) { ExecutionStatus state = taskInstance.getState();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if ( state == ExecutionStatus.RUNNING_EXECUTION || state == ExecutionStatus.DELAY_EXECUTION || state == ExecutionStatus.KILL ) { return state; } if (processInstance.getState() == ExecutionStatus.READY_PAUSE) { state = ExecutionStatus.PAUSE; } else if (processInstance.getState() == ExecutionStatus.READY_STOP || !checkProcessStrategy(taskInstance, processInstance)) { state = ExecutionStatus.KILL; } else { state = ExecutionStatus.SUBMITTED_SUCCESS; } return state; } /** * check process instance strategy * * @param taskInstance taskInstance * @return check strategy result */ private boolean checkProcessStrategy(TaskInstance taskInstance, ProcessInstance processInstance) { FailureStrategy failureStrategy = processInstance.getFailureStrategy(); if (failureStrategy == FailureStrategy.CONTINUE) { return true;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} List<TaskInstance> taskInstances = this.findValidTaskListByProcessId(taskInstance.getProcessInstanceId()); for (TaskInstance task : taskInstances) { if (task.getState() == ExecutionStatus.FAILURE && task.getRetryTimes() >= task.getMaxRetryTimes()) { return false; } } return true; } /** * insert or update work process instance to data base * * @param processInstance processInstance */ public void saveProcessInstance(ProcessInstance processInstance) { if (processInstance == null) { logger.error("save error, process instance is null!"); return; } if (processInstance.getId() != 0) { processInstanceMapper.updateById(processInstance); } else { processInstanceMapper.insert(processInstance); } } /** * insert or update command * * @param command command
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @return save command result */ public int saveCommand(Command command) { if (command.getId() != 0) { return commandMapper.updateById(command); } else { return commandMapper.insert(command); } } /** * insert or update task instance * * @param taskInstance taskInstance * @return save task instance result */ public boolean saveTaskInstance(TaskInstance taskInstance) { if (taskInstance.getId() != 0) { return updateTaskInstance(taskInstance); } else { return createTaskInstance(taskInstance); } } /** * insert task instance * * @param taskInstance taskInstance * @return create task instance result */ public boolean createTaskInstance(TaskInstance taskInstance) { int count = taskInstanceMapper.insert(taskInstance);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return count > 0; } /** * update task instance * * @param taskInstance taskInstance * @return update task instance result */ public boolean updateTaskInstance(TaskInstance taskInstance) { int count = taskInstanceMapper.updateById(taskInstance); return count > 0; } /** * find task instance by id * * @param taskId task id * @return task intance */ public TaskInstance findTaskInstanceById(Integer taskId) { return taskInstanceMapper.selectById(taskId); } /** * package task instance */ public void packageTaskInstance(TaskInstance taskInstance, ProcessInstance processInstance) { taskInstance.setProcessInstance(processInstance); taskInstance.setProcessDefine(processInstance.getProcessDefinition()); TaskDefinition taskDefinition = this.findTaskDefinition( taskInstance.getTaskCode(), taskInstance.getTaskDefinitionVersion());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
this.updateTaskDefinitionResources(taskDefinition); taskInstance.setTaskDefine(taskDefinition); } /** * Update {@link ResourceInfo} information in {@link TaskDefinition} * * @param taskDefinition the given {@link TaskDefinition} */ public void updateTaskDefinitionResources(TaskDefinition taskDefinition) { Map<String, Object> taskParameters = JSONUtils.parseObject( taskDefinition.getTaskParams(), new TypeReference<Map<String, Object>>() { }); if (taskParameters != null) { if (taskParameters.containsKey("mainJar")) { Object mainJarObj = taskParameters.get("mainJar"); ResourceInfo mainJar = JSONUtils.parseObject( JSONUtils.toJsonString(mainJarObj), ResourceInfo.class); ResourceInfo resourceInfo = updateResourceInfo(mainJar); if (resourceInfo != null) { taskParameters.put("mainJar", resourceInfo); } } if (taskParameters.containsKey("resourceList")) { String resourceListStr = JSONUtils.toJsonString(taskParameters.get("resourceList")); List<ResourceInfo> resourceInfos = JSONUtils.toList(resourceListStr, ResourceInfo.class);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
List<ResourceInfo> updatedResourceInfos = resourceInfos .stream() .map(this::updateResourceInfo) .filter(Objects::nonNull) .collect(Collectors.toList()); taskParameters.put("resourceList", updatedResourceInfos); } taskDefinition.setTaskParams(JSONUtils.toJsonString(taskParameters)); } } /** * update {@link ResourceInfo} by given original ResourceInfo * * @param res origin resource info * @return {@link ResourceInfo} */ private ResourceInfo updateResourceInfo(ResourceInfo res) { ResourceInfo resourceInfo = null; if (res != null) { int resourceId = res.getId(); if (resourceId <= 0) { logger.error("invalid resourceId, {}", resourceId); return null; } resourceInfo = new ResourceInfo(); Resource resource = getResourceById(resourceId); resourceInfo.setId(resourceId);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
resourceInfo.setRes(resource.getFileName()); resourceInfo.setResourceName(resource.getFullName()); if (logger.isInfoEnabled()) { logger.info("updated resource info {}", JSONUtils.toJsonString(resourceInfo)); } } return resourceInfo; } /** * get id list by task state * * @param instanceId instanceId * @param state state * @return task instance states */ public List<Integer> findTaskIdByInstanceState(int instanceId, ExecutionStatus state) { return taskInstanceMapper.queryTaskByProcessIdAndState(instanceId, state.ordinal()); } /** * find valid task list by process definition id * * @param processInstanceId processInstanceId * @return task instance list */ public List<TaskInstance> findValidTaskListByProcessId(Integer processInstanceId) { return taskInstanceMapper.findValidTaskListByProcessId(processInstanceId, Flag.YES); } /** * find previous task list by work process id
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* * @param processInstanceId processInstanceId * @return task instance list */ public List<TaskInstance> findPreviousTaskListByWorkProcessId(Integer processInstanceId) { return taskInstanceMapper.findValidTaskListByProcessId(processInstanceId, Flag.NO); } /** * update work process instance map * * @param processInstanceMap processInstanceMap * @return update process instance result */ public int updateWorkProcessInstanceMap(ProcessInstanceMap processInstanceMap) { return processInstanceMapMapper.updateById(processInstanceMap); } /** * create work process instance map * * @param processInstanceMap processInstanceMap * @return create process instance result */ public int createWorkProcessInstanceMap(ProcessInstanceMap processInstanceMap) { int count = 0; if (processInstanceMap != null) { return processInstanceMapMapper.insert(processInstanceMap); } return count; } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* find work process map by parent process id and parent task id. * * @param parentWorkProcessId parentWorkProcessId * @param parentTaskId parentTaskId * @return process instance map */ public ProcessInstanceMap findWorkProcessMapByParent(Integer parentWorkProcessId, Integer parentTaskId) { return processInstanceMapMapper.queryByParentId(parentWorkProcessId, parentTaskId); } /** * delete work process map by parent process id * * @param parentWorkProcessId parentWorkProcessId * @return delete process map result */ public int deleteWorkProcessMapByParentId(int parentWorkProcessId) { return processInstanceMapMapper.deleteByParentProcessId(parentWorkProcessId); } /** * find sub process instance * * @param parentProcessId parentProcessId * @param parentTaskId parentTaskId * @return process instance */ public ProcessInstance findSubProcessInstance(Integer parentProcessId, Integer parentTaskId) { ProcessInstance processInstance = null; ProcessInstanceMap processInstanceMap = processInstanceMapMapper.queryByParentId(parentProcessId, parentTaskId); if (processInstanceMap == null || processInstanceMap.getProcessInstanceId() == 0) { return processInstance;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} processInstance = findProcessInstanceById(processInstanceMap.getProcessInstanceId()); return processInstance; } /** * find parent process instance * * @param subProcessId subProcessId * @return process instance */ public ProcessInstance findParentProcessInstance(Integer subProcessId) { ProcessInstance processInstance = null; ProcessInstanceMap processInstanceMap = processInstanceMapMapper.queryBySubProcessId(subProcessId); if (processInstanceMap == null || processInstanceMap.getProcessInstanceId() == 0) { return processInstance; } processInstance = findProcessInstanceById(processInstanceMap.getParentProcessInstanceId()); return processInstance; } /** * change task state * * @param state state * @param startTime startTime * @param host host * @param executePath executePath * @param logPath logPath */ public void changeTaskState(TaskInstance taskInstance, ExecutionStatus state, Date startTime, String host, String executePath,
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
String logPath) { taskInstance.setState(state); taskInstance.setStartTime(startTime); taskInstance.setHost(host); taskInstance.setExecutePath(executePath); taskInstance.setLogPath(logPath); saveTaskInstance(taskInstance); } /** * update process instance * * @param processInstance processInstance * @return update process instance result */ public int updateProcessInstance(ProcessInstance processInstance) { return processInstanceMapper.updateById(processInstance); } /** * change task state * * @param state state * @param endTime endTime * @param varPool varPool */ public void changeTaskState(TaskInstance taskInstance, ExecutionStatus state, Date endTime, int processId, String appIds, String varPool) { taskInstance.setPid(processId);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
taskInstance.setAppLink(appIds); taskInstance.setState(state); taskInstance.setEndTime(endTime); taskInstance.setVarPool(varPool); changeOutParam(taskInstance); saveTaskInstance(taskInstance); } /** * for show in page of taskInstance */ public void changeOutParam(TaskInstance taskInstance) { if (StringUtils.isEmpty(taskInstance.getVarPool())) { return; } List<Property> properties = JSONUtils.toList(taskInstance.getVarPool(), Property.class); if (CollectionUtils.isEmpty(properties)) { return; } Map<String, Object> taskParams = JSONUtils.parseObject(taskInstance.getTaskParams(), new TypeReference<Map<String, Object>>() { }); Object localParams = taskParams.get(LOCAL_PARAMS); if (localParams == null) { return; } List<Property> allParam = JSONUtils.toList(JSONUtils.toJsonString(localParams), Property.class); Map<String, String> outProperty = new HashMap<>(); for (Property info : properties) { if (info.getDirect() == Direct.OUT) { outProperty.put(info.getProp(), info.getValue());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} } for (Property info : allParam) { if (info.getDirect() == Direct.OUT) { String paramName = info.getProp(); info.setValue(outProperty.get(paramName)); } } taskParams.put(LOCAL_PARAMS, allParam); taskInstance.setTaskParams(JSONUtils.toJsonString(taskParams)); } /** * convert integer list to string list * * @param intList intList * @return string list */ public List<String> convertIntListToString(List<Integer> intList) { if (intList == null) { return new ArrayList<>(); } List<String> result = new ArrayList<>(intList.size()); for (Integer intVar : intList) { result.add(String.valueOf(intVar)); } return result; } /** * query schedule by id *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @param id id * @return schedule */ public Schedule querySchedule(int id) { return scheduleMapper.selectById(id); } /** * query Schedule by processDefinitionCode * * @param processDefinitionCode processDefinitionCode * @see Schedule */ public List<Schedule> queryReleaseSchedulerListByProcessDefinitionCode(long processDefinitionCode) { return scheduleMapper.queryReleaseSchedulerListByProcessDefinitionCode(processDefinitionCode); } /** * query need failover process instance * * @param host host * @return process instance list */ public List<ProcessInstance> queryNeedFailoverProcessInstances(String host) { return processInstanceMapper.queryByHostAndStatus(host, stateArray); } public List<String> queryNeedFailoverProcessInstanceHost() { return processInstanceMapper.queryNeedFailoverProcessInstanceHost(stateArray); } /** * process need failover process instance *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @param processInstance processInstance */ @Transactional(rollbackFor = RuntimeException.class) public void processNeedFailoverProcessInstances(ProcessInstance processInstance) { processInstance.setHost(Constants.NULL); processInstanceMapper.updateById(processInstance); ProcessDefinition processDefinition = findProcessDefinition(processInstance.getProcessDefinitionCode(), processInstance.getProcessDefinitionVersion()); Command cmd = new Command(); cmd.setProcessDefinitionCode(processDefinition.getCode()); cmd.setProcessDefinitionVersion(processDefinition.getVersion()); cmd.setProcessInstanceId(processInstance.getId()); cmd.setCommandParam(String.format("{\"%s\":%d}", Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING, processInstance.getId())); cmd.setExecutorId(processInstance.getExecutorId()); cmd.setCommandType(CommandType.RECOVER_TOLERANCE_FAULT_PROCESS); createCommand(cmd); } /** * query all need failover task instances by host * * @param host host * @return task instance list */ public List<TaskInstance> queryNeedFailoverTaskInstances(String host) { return taskInstanceMapper.queryByHostAndStatus(host, stateArray); } /** * find data source by id
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* * @param id id * @return datasource */ public DataSource findDataSourceById(int id) { return dataSourceMapper.selectById(id); } /** * update process instance state by id * * @param processInstanceId processInstanceId * @param executionStatus executionStatus * @return update process result */ public int updateProcessInstanceState(Integer processInstanceId, ExecutionStatus executionStatus) { ProcessInstance instance = processInstanceMapper.selectById(processInstanceId); instance.setState(executionStatus); return processInstanceMapper.updateById(instance); } /** * find process instance by the task id * * @param taskId taskId * @return process instance */ public ProcessInstance findProcessInstanceByTaskId(int taskId) { TaskInstance taskInstance = taskInstanceMapper.selectById(taskId); if (taskInstance != null) { return processInstanceMapper.selectById(taskInstance.getProcessInstanceId()); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return null; } /** * find udf function list by id list string * * @param ids ids * @return udf function list */ public List<UdfFunc> queryUdfFunListByIds(int[] ids) { return udfFuncMapper.queryUdfByIdStr(ids, null); } /** * find tenant code by resource name * * @param resName resource name * @param resourceType resource type * @return tenant code */ public String queryTenantCodeByResName(String resName, ResourceType resourceType) { String fullName = resName.startsWith("/") ? resName : String.format("/%s", resName); List<Resource> resourceList = resourceMapper.queryResource(fullName, resourceType.ordinal()); if (CollectionUtils.isEmpty(resourceList)) { return StringUtils.EMPTY; } int userId = resourceList.get(0).getUserId(); User user = userMapper.selectById(userId); if (Objects.isNull(user)) { return StringUtils.EMPTY; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
Tenant tenant = tenantMapper.queryById(user.getTenantId()); if (Objects.isNull(tenant)) { return StringUtils.EMPTY; } return tenant.getTenantCode(); } /** * find schedule list by process define codes. * * @param codes codes * @return schedule list */ public List<Schedule> selectAllByProcessDefineCode(long[] codes) { return scheduleMapper.selectAllByProcessDefineArray(codes); } /** * find last scheduler process instance in the date interval * * @param definitionCode definitionCode * @param dateInterval dateInterval * @return process instance */ public ProcessInstance findLastSchedulerProcessInterval(Long definitionCode, DateInterval dateInterval) { return processInstanceMapper.queryLastSchedulerProcess(definitionCode, dateInterval.getStartTime(), dateInterval.getEndTime()); } /** * find last manual process instance interval *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @param definitionCode process definition code * @param dateInterval dateInterval * @return process instance */ public ProcessInstance findLastManualProcessInterval(Long definitionCode, DateInterval dateInterval) { return processInstanceMapper.queryLastManualProcess(definitionCode, dateInterval.getStartTime(), dateInterval.getEndTime()); } /** * find last running process instance * * @param definitionCode process definition code * @param startTime start time * @param endTime end time * @return process instance */ public ProcessInstance findLastRunningProcess(Long definitionCode, Date startTime, Date endTime) { return processInstanceMapper.queryLastRunningProcess(definitionCode, startTime, endTime, stateArray); } /** * query user queue by process instance * * @param processInstance processInstance * @return queue */ public String queryUserQueueByProcessInstance(ProcessInstance processInstance) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
String queue = ""; if (processInstance == null) { return queue; } User executor = userMapper.selectById(processInstance.getExecutorId()); if (executor != null) { queue = executor.getQueue(); } return queue; } /** * query project name and user name by processInstanceId. * * @param processInstanceId processInstanceId * @return projectName and userName */ public ProjectUser queryProjectWithUserByProcessInstanceId(int processInstanceId) { return projectMapper.queryProjectWithUserByProcessInstanceId(processInstanceId); } /** * get task worker group * * @param taskInstance taskInstance * @return workerGroupId */ public String getTaskWorkerGroup(TaskInstance taskInstance) { String workerGroup = taskInstance.getWorkerGroup(); if (StringUtils.isNotBlank(workerGroup)) { return workerGroup; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
int processInstanceId = taskInstance.getProcessInstanceId(); ProcessInstance processInstance = findProcessInstanceById(processInstanceId); if (processInstance != null) { return processInstance.getWorkerGroup(); } logger.info("task : {} will use default worker group", taskInstance.getId()); return Constants.DEFAULT_WORKER_GROUP; } /** * get have perm project list * * @param userId userId * @return project list */ public List<Project> getProjectListHavePerm(int userId) { List<Project> createProjects = projectMapper.queryProjectCreatedByUser(userId); List<Project> authedProjects = projectMapper.queryAuthedProjectListByUserId(userId); if (createProjects == null) { createProjects = new ArrayList<>(); } if (authedProjects != null) { createProjects.addAll(authedProjects); } return createProjects; } /** * list unauthorized udf function * * @param userId user id * @param needChecks data source id array
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* @return unauthorized udf function list */ public <T> List<T> listUnauthorized(int userId, T[] needChecks, AuthorizationType authorizationType) { List<T> resultList = new ArrayList<>(); if (Objects.nonNull(needChecks) && needChecks.length > 0) { Set<T> originResSet = new HashSet<>(Arrays.asList(needChecks)); switch (authorizationType) { case RESOURCE_FILE_ID: case UDF_FILE: List<Resource> ownUdfResources = resourceMapper.listAuthorizedResourceById(userId, needChecks); addAuthorizedResources(ownUdfResources, userId); Set<Integer> authorizedResourceFiles = ownUdfResources.stream().map(Resource::getId).collect(toSet()); originResSet.removeAll(authorizedResourceFiles); break; case RESOURCE_FILE_NAME: List<Resource> ownResources = resourceMapper.listAuthorizedResource(userId, needChecks); addAuthorizedResources(ownResources, userId); Set<String> authorizedResources = ownResources.stream().map(Resource::getFullName).collect(toSet()); originResSet.removeAll(authorizedResources); break; case DATASOURCE: Set<Integer> authorizedDatasources = dataSourceMapper.listAuthorizedDataSource(userId, needChecks).stream().map(DataSource::getId).collect(toSet()); originResSet.removeAll(authorizedDatasources); break; case UDF: Set<Integer> authorizedUdfs = udfFuncMapper.listAuthorizedUdfFunc(userId, needChecks).stream().map(UdfFunc::getId).collect(toSet()); originResSet.removeAll(authorizedUdfs); break; default: break;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} resultList.addAll(originResSet); } return resultList; } /** * get user by user id * * @param userId user id * @return User */ public User getUserById(int userId) { return userMapper.selectById(userId); } /** * get resource by resource id * * @param resourceId resource id * @return Resource */ public Resource getResourceById(int resourceId) { return resourceMapper.selectById(resourceId); } /** * list resources by ids * * @param resIds resIds * @return resource list */ public List<Resource> listResourceByIds(Integer[] resIds) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return resourceMapper.listResourceByIds(resIds); } /** * format task app id in task instance */ public String formatTaskAppId(TaskInstance taskInstance) { ProcessInstance processInstance = findProcessInstanceById(taskInstance.getProcessInstanceId()); if (processInstance == null) { return ""; } ProcessDefinition definition = findProcessDefinition(processInstance.getProcessDefinitionCode(), processInstance.getProcessDefinitionVersion()); if (definition == null) { return ""; } return String.format("%s_%s_%s", definition.getId(), processInstance.getId(), taskInstance.getId()); } /** * switch process definition version to process definition log version */ public int switchVersion(ProcessDefinition processDefinition, ProcessDefinitionLog processDefinitionLog) { if (null == processDefinition || null == processDefinitionLog) { return Constants.DEFINITION_FAILURE; } processDefinitionLog.setId(processDefinition.getId()); processDefinitionLog.setReleaseState(ReleaseState.OFFLINE); processDefinitionLog.setFlag(Flag.YES); int result = processDefineMapper.updateById(processDefinitionLog); if (result > 0) { result = switchProcessTaskRelationVersion(processDefinitionLog); if (result <= 0) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return Constants.DEFINITION_FAILURE; } } return result; } public int switchProcessTaskRelationVersion(ProcessDefinition processDefinition) { List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryByProcessCode(processDefinition.getProjectCode(), processDefinition.getCode()); if (!processTaskRelationList.isEmpty()) { processTaskRelationMapper.deleteByCode(processDefinition.getProjectCode(), processDefinition.getCode()); } List<ProcessTaskRelationLog> processTaskRelationLogList = processTaskRelationLogMapper.queryByProcessCodeAndVersion(processDefinition.getCode(), processDefinition.getVersion()); return processTaskRelationMapper.batchInsert(processTaskRelationLogList); } /** * get resource ids * * @param taskDefinition taskDefinition * @return resource ids */ public String getResourceIds(TaskDefinition taskDefinition) { Set<Integer> resourceIds = null; AbstractParameters params = TaskParametersUtils.getParameters(taskDefinition.getTaskType(), taskDefinition.getTaskParams()); if (params != null && CollectionUtils.isNotEmpty(params.getResourceFilesList())) { resourceIds = params.getResourceFilesList(). stream() .filter(t -> t.getId() != 0) .map(ResourceInfo::getId) .collect(Collectors.toSet()); } if (CollectionUtils.isEmpty(resourceIds)) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return StringUtils.EMPTY; } return StringUtils.join(resourceIds, ","); } public int saveTaskDefine(User operator, long projectCode, List<TaskDefinitionLog> taskDefinitionLogs, Boolean syncDefine) { Date now = new Date(); List<TaskDefinitionLog> newTaskDefinitionLogs = new ArrayList<>(); List<TaskDefinitionLog> updateTaskDefinitionLogs = new ArrayList<>(); for (TaskDefinitionLog taskDefinitionLog : taskDefinitionLogs) { taskDefinitionLog.setProjectCode(projectCode); taskDefinitionLog.setUpdateTime(now); taskDefinitionLog.setOperateTime(now); taskDefinitionLog.setOperator(operator.getId()); taskDefinitionLog.setResourceIds(getResourceIds(taskDefinitionLog)); if (taskDefinitionLog.getCode() > 0 && taskDefinitionLog.getVersion() > 0) { TaskDefinitionLog definitionCodeAndVersion = taskDefinitionLogMapper .queryByDefinitionCodeAndVersion(taskDefinitionLog.getCode(), taskDefinitionLog.getVersion()); if (definitionCodeAndVersion != null) { if (!taskDefinitionLog.equals(definitionCodeAndVersion)) { taskDefinitionLog.setUserId(definitionCodeAndVersion.getUserId()); Integer version = taskDefinitionLogMapper.queryMaxVersionForDefinition(taskDefinitionLog.getCode()); taskDefinitionLog.setVersion(version + 1); taskDefinitionLog.setCreateTime(definitionCodeAndVersion.getCreateTime()); updateTaskDefinitionLogs.add(taskDefinitionLog); } continue; } } taskDefinitionLog.setUserId(operator.getId()); taskDefinitionLog.setVersion(Constants.VERSION_FIRST);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
taskDefinitionLog.setCreateTime(now); if (taskDefinitionLog.getCode() == 0) { try { taskDefinitionLog.setCode(CodeGenerateUtils.getInstance().genCode()); } catch (CodeGenerateException e) { logger.error("Task code get error, ", e); return Constants.DEFINITION_FAILURE; } } newTaskDefinitionLogs.add(taskDefinitionLog); } int insertResult = 0; int updateResult = 0; for (TaskDefinitionLog taskDefinitionToUpdate : updateTaskDefinitionLogs) { TaskDefinition task = taskDefinitionMapper.queryByCode(taskDefinitionToUpdate.getCode()); if (task == null) { newTaskDefinitionLogs.add(taskDefinitionToUpdate); } else { insertResult += taskDefinitionLogMapper.insert(taskDefinitionToUpdate); if (Boolean.TRUE.equals(syncDefine)) { taskDefinitionToUpdate.setId(task.getId()); updateResult += taskDefinitionMapper.updateById(taskDefinitionToUpdate); } else { updateResult++; } } } if (!newTaskDefinitionLogs.isEmpty()) { insertResult += taskDefinitionLogMapper.batchInsert(newTaskDefinitionLogs); if (Boolean.TRUE.equals(syncDefine)) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
updateResult += taskDefinitionMapper.batchInsert(newTaskDefinitionLogs); } else { updateResult += newTaskDefinitionLogs.size(); } } return (insertResult & updateResult) > 0 ? 1 : Constants.EXIT_CODE_SUCCESS; } /** * save processDefinition (including create or update processDefinition) */ public int saveProcessDefine(User operator, ProcessDefinition processDefinition, Boolean syncDefine, Boolean isFromProcessDefine) { ProcessDefinitionLog processDefinitionLog = new ProcessDefinitionLog(processDefinition); Integer version = processDefineLogMapper.queryMaxVersionForDefinition(processDefinition.getCode()); int insertVersion = version == null || version == 0 ? Constants.VERSION_FIRST : version + 1; processDefinitionLog.setVersion(insertVersion); processDefinitionLog.setReleaseState(isFromProcessDefine ? ReleaseState.OFFLINE : ReleaseState.ONLINE); processDefinitionLog.setOperator(operator.getId()); processDefinitionLog.setOperateTime(processDefinition.getUpdateTime()); int insertLog = processDefineLogMapper.insert(processDefinitionLog); int result = 1; if (Boolean.TRUE.equals(syncDefine)) { if (0 == processDefinition.getId()) { result = processDefineMapper.insert(processDefinitionLog); } else { processDefinitionLog.setId(processDefinition.getId()); result = processDefineMapper.updateById(processDefinitionLog); } } return (insertLog & result) > 0 ? insertVersion : 0; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
/** * save task relations */ public int saveTaskRelation(User operator, long projectCode, long processDefinitionCode, int processDefinitionVersion, List<ProcessTaskRelationLog> taskRelationList, List<TaskDefinitionLog> taskDefinitionLogs, Boolean syncDefine) { if (taskRelationList.isEmpty()) { return Constants.EXIT_CODE_SUCCESS; } Map<Long, TaskDefinitionLog> taskDefinitionLogMap = null; if (CollectionUtils.isNotEmpty(taskDefinitionLogs)) { taskDefinitionLogMap = taskDefinitionLogs.stream() .collect(Collectors.toMap(TaskDefinition::getCode, taskDefinitionLog -> taskDefinitionLog)); } Date now = new Date(); for (ProcessTaskRelationLog processTaskRelationLog : taskRelationList) { processTaskRelationLog.setProjectCode(projectCode); processTaskRelationLog.setProcessDefinitionCode(processDefinitionCode); processTaskRelationLog.setProcessDefinitionVersion(processDefinitionVersion); if (taskDefinitionLogMap != null) { TaskDefinitionLog preTaskDefinitionLog = taskDefinitionLogMap.get(processTaskRelationLog.getPreTaskCode()); if (preTaskDefinitionLog != null) { processTaskRelationLog.setPreTaskVersion(preTaskDefinitionLog.getVersion()); } TaskDefinitionLog postTaskDefinitionLog = taskDefinitionLogMap.get(processTaskRelationLog.getPostTaskCode()); if (postTaskDefinitionLog != null) { processTaskRelationLog.setPostTaskVersion(postTaskDefinitionLog.getVersion()); } } processTaskRelationLog.setCreateTime(now);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
processTaskRelationLog.setUpdateTime(now); processTaskRelationLog.setOperator(operator.getId()); processTaskRelationLog.setOperateTime(now); } int insert = taskRelationList.size(); if (Boolean.TRUE.equals(syncDefine)) { List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryByProcessCode(projectCode, processDefinitionCode); if (!processTaskRelationList.isEmpty()) { Set<Integer> processTaskRelationSet = processTaskRelationList.stream().map(ProcessTaskRelation::hashCode).collect(toSet()); Set<Integer> taskRelationSet = taskRelationList.stream().map(ProcessTaskRelationLog::hashCode).collect(toSet()); boolean result = CollectionUtils.isEqualCollection(processTaskRelationSet, taskRelationSet); if (result) { return Constants.EXIT_CODE_SUCCESS; } processTaskRelationMapper.deleteByCode(projectCode, processDefinitionCode); } insert = processTaskRelationMapper.batchInsert(taskRelationList); } int resultLog = processTaskRelationLogMapper.batchInsert(taskRelationList); return (insert & resultLog) > 0 ? Constants.EXIT_CODE_SUCCESS : Constants.EXIT_CODE_FAILURE; } public boolean isTaskOnline(long taskCode) { List<ProcessTaskRelation> processTaskRelationList = processTaskRelationMapper.queryByTaskCode(taskCode); if (!processTaskRelationList.isEmpty()) { Set<Long> processDefinitionCodes = processTaskRelationList .stream() .map(ProcessTaskRelation::getProcessDefinitionCode) .collect(Collectors.toSet()); List<ProcessDefinition> processDefinitionList = processDefineMapper.queryByCodes(processDefinitionCodes);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
for (ProcessDefinition processDefinition : processDefinitionList) { if (processDefinition.getReleaseState() == ReleaseState.ONLINE) { return true; } } } return false; } /** * Generate the DAG Graph based on the process definition id * Use temporarily before refactoring taskNode * * @param processDefinition process definition * @return dag graph */ public DAG<String, TaskNode, TaskNodeRelation> genDagGraph(ProcessDefinition processDefinition) { List<ProcessTaskRelation> taskRelations = this.findRelationByCode(processDefinition.getCode(), processDefinition.getVersion()); List<TaskNode> taskNodeList = transformTask(taskRelations, Lists.newArrayList()); ProcessDag processDag = DagHelper.getProcessDag(taskNodeList, new ArrayList<>(taskRelations)); return DagHelper.buildDagGraph(processDag); } /** * generate DagData */ public DagData genDagData(ProcessDefinition processDefinition) { List<ProcessTaskRelation> taskRelations = this.findRelationByCode(processDefinition.getCode(), processDefinition.getVersion()); List<TaskDefinitionLog> taskDefinitionLogList = genTaskDefineList(taskRelations); List<TaskDefinition> taskDefinitions = taskDefinitionLogList.stream().map(t -> (TaskDefinition) t).collect(Collectors.toList()); return new DagData(processDefinition, taskRelations, taskDefinitions);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} public List<TaskDefinitionLog> genTaskDefineList(List<ProcessTaskRelation> processTaskRelations) { Set<TaskDefinition> taskDefinitionSet = new HashSet<>(); for (ProcessTaskRelation processTaskRelation : processTaskRelations) { if (processTaskRelation.getPreTaskCode() > 0) { taskDefinitionSet.add(new TaskDefinition(processTaskRelation.getPreTaskCode(), processTaskRelation.getPreTaskVersion())); } if (processTaskRelation.getPostTaskCode() > 0) { taskDefinitionSet.add(new TaskDefinition(processTaskRelation.getPostTaskCode(), processTaskRelation.getPostTaskVersion())); } } if (taskDefinitionSet.isEmpty()) { return Lists.newArrayList(); } return taskDefinitionLogMapper.queryByTaskDefinitions(taskDefinitionSet); } public List<TaskDefinitionLog> getTaskDefineLogListByRelation(List<ProcessTaskRelation> processTaskRelations) { List<TaskDefinitionLog> taskDefinitionLogs = new ArrayList<>(); Map<Long, Integer> taskCodeVersionMap = new HashMap<>(); for (ProcessTaskRelation processTaskRelation : processTaskRelations) { if (processTaskRelation.getPreTaskCode() > 0) { taskCodeVersionMap.put(processTaskRelation.getPreTaskCode(), processTaskRelation.getPreTaskVersion()); } if (processTaskRelation.getPostTaskCode() > 0) { taskCodeVersionMap.put(processTaskRelation.getPostTaskCode(), processTaskRelation.getPostTaskVersion()); } } taskCodeVersionMap.forEach((code,version) -> { taskDefinitionLogs.add((TaskDefinitionLog) this.findTaskDefinition(code, version)); });
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
return taskDefinitionLogs; } /** * find task definition by code and version */ public TaskDefinition findTaskDefinition(long taskCode, int taskDefinitionVersion) { return taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(taskCode, taskDefinitionVersion); } /** * find process task relation list by process */ public List<ProcessTaskRelation> findRelationByCode(long processDefinitionCode, int processDefinitionVersion) { List<ProcessTaskRelationLog> processTaskRelationLogList = processTaskRelationLogMapper.queryByProcessCodeAndVersion(processDefinitionCode, processDefinitionVersion); return processTaskRelationLogList.stream().map(r -> (ProcessTaskRelation) r).collect(Collectors.toList()); } /** * add authorized resources * * @param ownResources own resources * @param userId userId */ private void addAuthorizedResources(List<Resource> ownResources, int userId) { List<Integer> relationResourceIds = resourceUserMapper.queryResourcesIdListByUserIdAndPerm(userId, 7); List<Resource> relationResources = CollectionUtils.isNotEmpty(relationResourceIds) ? resourceMapper.queryResourceListById(relationResourceIds) : new ArrayList<>(); ownResources.addAll(relationResources); } /** * Use temporarily before refactoring taskNode */ public List<TaskNode> transformTask(List<ProcessTaskRelation> taskRelationList, List<TaskDefinitionLog> taskDefinitionLogs) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
Map<Long, List<Long>> taskCodeMap = new HashMap<>(); for (ProcessTaskRelation processTaskRelation : taskRelationList) { taskCodeMap.compute(processTaskRelation.getPostTaskCode(), (k, v) -> { if (v == null) { v = new ArrayList<>(); } if (processTaskRelation.getPreTaskCode() != 0L) { v.add(processTaskRelation.getPreTaskCode()); } return v; }); } if (CollectionUtils.isEmpty(taskDefinitionLogs)) { taskDefinitionLogs = genTaskDefineList(taskRelationList); } Map<Long, TaskDefinitionLog> taskDefinitionLogMap = taskDefinitionLogs.stream() .collect(Collectors.toMap(TaskDefinitionLog::getCode, taskDefinitionLog -> taskDefinitionLog)); List<TaskNode> taskNodeList = new ArrayList<>(); for (Entry<Long, List<Long>> code : taskCodeMap.entrySet()) { TaskDefinitionLog taskDefinitionLog = taskDefinitionLogMap.get(code.getKey()); if (taskDefinitionLog != null) { TaskNode taskNode = new TaskNode(); taskNode.setCode(taskDefinitionLog.getCode()); taskNode.setVersion(taskDefinitionLog.getVersion()); taskNode.setName(taskDefinitionLog.getName()); taskNode.setDesc(taskDefinitionLog.getDescription()); taskNode.setType(taskDefinitionLog.getTaskType().toUpperCase()); taskNode.setRunFlag(taskDefinitionLog.getFlag() == Flag.YES ? Constants.FLOWNODE_RUN_FLAG_NORMAL : Constants.FLOWNODE_RUN_FLAG_FORBIDDEN); taskNode.setMaxRetryTimes(taskDefinitionLog.getFailRetryTimes()); taskNode.setRetryInterval(taskDefinitionLog.getFailRetryInterval());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
Map<String, Object> taskParamsMap = taskNode.taskParamsToJsonObj(taskDefinitionLog.getTaskParams()); taskNode.setConditionResult(JSONUtils.toJsonString(taskParamsMap.get(Constants.CONDITION_RESULT))); taskNode.setSwitchResult(JSONUtils.toJsonString(taskParamsMap.get(Constants.SWITCH_RESULT))); taskNode.setDependence(JSONUtils.toJsonString(taskParamsMap.get(Constants.DEPENDENCE))); taskParamsMap.remove(Constants.CONDITION_RESULT); taskParamsMap.remove(Constants.DEPENDENCE); taskNode.setParams(JSONUtils.toJsonString(taskParamsMap)); taskNode.setTaskInstancePriority(taskDefinitionLog.getTaskPriority()); taskNode.setWorkerGroup(taskDefinitionLog.getWorkerGroup()); taskNode.setEnvironmentCode(taskDefinitionLog.getEnvironmentCode()); taskNode.setTimeout(JSONUtils.toJsonString(new TaskTimeoutParameter(taskDefinitionLog.getTimeoutFlag() == TimeoutFlag.OPEN, taskDefinitionLog.getTimeoutNotifyStrategy(), taskDefinitionLog.getTimeout()))); taskNode.setDelayTime(taskDefinitionLog.getDelayTime()); taskNode.setPreTasks(JSONUtils.toJsonString(code.getValue().stream().map(taskDefinitionLogMap::get).map(TaskDefinition::getCode).collect(Collectors.toList()))); taskNode.setTaskGroupId(taskDefinitionLog.getTaskGroupId()); taskNode.setTaskGroupPriority(taskDefinitionLog.getTaskGroupPriority()); taskNodeList.add(taskNode); } } return taskNodeList; } public Map<ProcessInstance, TaskInstance> notifyProcessList(int processId) { HashMap<ProcessInstance, TaskInstance> processTaskMap = new HashMap<>(); ProcessInstanceMap processInstanceMap = processInstanceMapMapper.queryBySubProcessId(processId); if (processInstanceMap == null) { return processTaskMap; } ProcessInstance fatherProcess = this.findProcessInstanceById(processInstanceMap.getParentProcessInstanceId());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
TaskInstance fatherTask = this.findTaskInstanceById(processInstanceMap.getParentTaskInstanceId()); if (fatherProcess != null) { processTaskMap.put(fatherProcess, fatherTask); } return processTaskMap; } /** * the first time (when submit the task ) get the resource of the task group * @param taskId task id * @param taskName * @param groupId * @param processId * @param priority * @return */ public boolean acquireTaskGroup(int taskId, String taskName, int groupId, int processId, int priority) { TaskGroup taskGroup = taskGroupMapper.selectById(groupId); if (taskGroup == null) { return true; } if (taskGroup.getStatus() == Flag.NO.getCode()) { return true; } TaskGroupQueue taskGroupQueue = this.taskGroupQueueMapper.queryByTaskId(taskId); if (taskGroupQueue == null) { taskGroupQueue = insertIntoTaskGroupQueue(taskId, taskName, groupId, processId, priority, TaskGroupQueueStatus.WAIT_QUEUE); } else {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (taskGroupQueue.getStatus() == TaskGroupQueueStatus.ACQUIRE_SUCCESS) { return true; } taskGroupQueue.setInQueue(Flag.NO.getCode()); taskGroupQueue.setStatus(TaskGroupQueueStatus.WAIT_QUEUE); this.taskGroupQueueMapper.updateById(taskGroupQueue); } List<TaskGroupQueue> highPriorityTasks = taskGroupQueueMapper.queryHighPriorityTasks(groupId, priority, TaskGroupQueueStatus.WAIT_QUEUE.getCode()); if (CollectionUtils.isNotEmpty(highPriorityTasks)) { this.taskGroupQueueMapper.updateInQueue(Flag.NO.getCode(), taskGroupQueue.getId()); return false; } int count = taskGroupMapper.selectAvailableCountById(groupId); if (count == 1 && robTaskGroupResouce(taskGroupQueue)) { return true; } this.taskGroupQueueMapper.updateInQueue(Flag.NO.getCode(), taskGroupQueue.getId()); return false; } /** * try to get the task group resource(when other task release the resource) * @param taskGroupQueue * @return */ public boolean robTaskGroupResouce(TaskGroupQueue taskGroupQueue) { TaskGroup taskGroup = taskGroupMapper.selectById(taskGroupQueue.getGroupId()); int affectedCount = taskGroupMapper.updateTaskGroupResource(taskGroup.getId(),taskGroupQueue.getId(), TaskGroupQueueStatus.WAIT_QUEUE.getCode());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
if (affectedCount > 0) { taskGroupQueue.setStatus(TaskGroupQueueStatus.ACQUIRE_SUCCESS); this.taskGroupQueueMapper.updateById(taskGroupQueue); this.taskGroupQueueMapper.updateInQueue(Flag.NO.getCode(), taskGroupQueue.getId()); return true; } return false; } public boolean acquireTaskGroupAgain(TaskGroupQueue taskGroupQueue) { return robTaskGroupResouce(taskGroupQueue); } public void releaseAllTaskGroup(int processInstanceId) { List<TaskInstance> taskInstances = this.taskInstanceMapper.loadAllInfosNoRelease(processInstanceId, TaskGroupQueueStatus.ACQUIRE_SUCCESS.getCode()); for (TaskInstance info : taskInstances) { releaseTaskGroup(info); } } /** * release the TGQ resource when the corresponding task is finished. * * @return the result code and msg */ public TaskInstance releaseTaskGroup(TaskInstance taskInstance) { TaskGroup taskGroup = taskGroupMapper.selectById(taskInstance.getTaskGroupId()); if (taskGroup == null) { return null; } TaskGroupQueue thisTaskGroupQueue = this.taskGroupQueueMapper.queryByTaskId(taskInstance.getId()); if (thisTaskGroupQueue.getStatus() == TaskGroupQueueStatus.RELEASE) { return null;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
} try { while (taskGroupMapper.releaseTaskGroupResource(taskGroup.getId(), taskGroup.getUseSize() , thisTaskGroupQueue.getId(), TaskGroupQueueStatus.ACQUIRE_SUCCESS.getCode()) != 1) { thisTaskGroupQueue = this.taskGroupQueueMapper.queryByTaskId(taskInstance.getId()); if (thisTaskGroupQueue.getStatus() == TaskGroupQueueStatus.RELEASE) { return null; } taskGroup = taskGroupMapper.selectById(taskInstance.getTaskGroupId()); } } catch (Exception e) { logger.error("release the task group error",e); } logger.info("updateTask:{}",taskInstance.getName()); changeTaskGroupQueueStatus(taskInstance.getId(), TaskGroupQueueStatus.RELEASE); TaskGroupQueue taskGroupQueue = this.taskGroupQueueMapper.queryTheHighestPriorityTasks(taskGroup.getId(), TaskGroupQueueStatus.WAIT_QUEUE.getCode(), Flag.NO.getCode(), Flag.NO.getCode()); if (taskGroupQueue == null) { return null; } while (this.taskGroupQueueMapper.updateInQueueCAS(Flag.NO.getCode(), Flag.YES.getCode(), taskGroupQueue.getId()) != 1) { taskGroupQueue = this.taskGroupQueueMapper.queryTheHighestPriorityTasks(taskGroup.getId(), TaskGroupQueueStatus.WAIT_QUEUE.getCode(), Flag.NO.getCode(), Flag.NO.getCode()); if (taskGroupQueue == null) { return null; } } return this.taskInstanceMapper.selectById(taskGroupQueue.getTaskId()); } /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
* release the TGQ resource when the corresponding task is finished. * * @param taskId task id * @return the result code and msg */ public void changeTaskGroupQueueStatus(int taskId, TaskGroupQueueStatus status) { TaskGroupQueue taskGroupQueue = taskGroupQueueMapper.queryByTaskId(taskId); taskGroupQueue.setStatus(status); taskGroupQueue.setUpdateTime(new Date(System.currentTimeMillis())); taskGroupQueueMapper.updateById(taskGroupQueue); } /** * insert into task group queue * * @param taskId task id * @param taskName task name * @param groupId group id * @param processId process id * @param priority priority * @return result and msg code */ public TaskGroupQueue insertIntoTaskGroupQueue(Integer taskId, String taskName, Integer groupId, Integer processId, Integer priority, TaskGroupQueueStatus status) { TaskGroupQueue taskGroupQueue = new TaskGroupQueue(taskId, taskName, groupId, processId, priority, status); taskGroupQueue.setCreateTime(new Date()); taskGroupQueue.setUpdateTime(new Date()); taskGroupQueueMapper.insert(taskGroupQueue); return taskGroupQueue; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,962
[Bug] [dolphinscheduler-api] The global parameters of the sub_process node are not passed to the associated workflow task
### 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 1. Create workflow A and the task is shell_ 1. Global parameter setting id = 1 ![image](https://user-images.githubusercontent.com/95271106/149119943-2e8cd71e-8c85-446e-a0f6-a4579b58e329.png) ![image](https://user-images.githubusercontent.com/95271106/149095105-be527c91-01bf-4813-b1be-397b6de9efa3.png) 2. Sub node B is associated with workflow A ![image](https://user-images.githubusercontent.com/95271106/149119233-df76f327-9c46-4581-8cdf-f5904042febc.png) 3. set id = 3 of the global parameter for the Sub node B , Run Sub node B, shell_1'id is 1, should be 3 ![image](https://user-images.githubusercontent.com/95271106/149118848-4101e85b-3826-45b2-8c13-e5168374dd40.png) ### What you expected to happen . ### How to reproduce . ### Anything else _No response_ ### Version 2.0.2 ### 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/7962
https://github.com/apache/dolphinscheduler/pull/7973
53e012441048322f6b29e911aa02ca40ef80486f
ecaeadea3359d365824eb2f52d414765d2192c98
2022-01-12T08:56:37Z
java
2022-01-12T13:53:22Z
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
public int updateTaskGroupQueueStatus(Integer taskId, int status) { return taskGroupQueueMapper.updateStatusByTaskId(taskId, status); } public int updateTaskGroupQueue(TaskGroupQueue taskGroupQueue) { return taskGroupQueueMapper.updateById(taskGroupQueue); } public TaskGroupQueue loadTaskGroupQueue(int taskId) { return this.taskGroupQueueMapper.queryByTaskId(taskId); } public void sendStartTask2Master(ProcessInstance processInstance,int taskId, org.apache.dolphinscheduler.remote.command.CommandType taskType) { String host = processInstance.getHost(); String address = host.split(":")[0]; int port = Integer.parseInt(host.split(":")[1]); TaskEventChangeCommand taskEventChangeCommand = new TaskEventChangeCommand( processInstance.getId(), taskId ); stateEventCallbackService.sendResult(address, port, taskEventChangeCommand.convert2Command(taskType)); } public ProcessInstance loadNextProcess4Serial(long code, int state) { return this.processInstanceMapper.loadNextProcess4Serial(code, state); } private void deleteCommandWithCheck(int commandId) { int delete = this.commandMapper.deleteById(commandId); if (delete != 1) { throw new ServiceException("delete command fail, id:" + commandId); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,977
[Bug] [API] There's a wrong prompt in the class of TaskGroupServiceImpl when starting to set the status of a task group as the value '1'.
### 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 When trying to invoke the function 'startTaskGroup' in the class of 'TaskGroupServiceImpl' it will has a wrong prompt if the task group's status is '1'. ![image](https://user-images.githubusercontent.com/4928204/149245570-492f9b47-2f64-4fb6-ab04-0d4b3bb00995.png) ![image](https://user-images.githubusercontent.com/4928204/149245917-1b9eb1d0-7bdf-4783-af91-004d1f7307e4.png) ### What you expected to happen I expect that the prompt should be 'The task group has already been started.' when the operated task group's status is '1'. ### How to reproduce You can call this function and pass in the parameter of id of a task group, the status of which is '1'. ### 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/7977
https://github.com/apache/dolphinscheduler/pull/7978
6dcf53c4d98d3cb5d26206f53006b41cc9b59a35
23068e9d21a847a5aa22dd1f655198f0d0d89f1f
2022-01-13T01:01:30Z
java
2022-01-13T05:03:05Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.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.enums; import java.util.Locale; import java.util.Optional; import org.springframework.context.i18n.LocaleContextHolder; /** * status enum // todo #4855 One category one interval */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,977
[Bug] [API] There's a wrong prompt in the class of TaskGroupServiceImpl when starting to set the status of a task group as the value '1'.
### 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 When trying to invoke the function 'startTaskGroup' in the class of 'TaskGroupServiceImpl' it will has a wrong prompt if the task group's status is '1'. ![image](https://user-images.githubusercontent.com/4928204/149245570-492f9b47-2f64-4fb6-ab04-0d4b3bb00995.png) ![image](https://user-images.githubusercontent.com/4928204/149245917-1b9eb1d0-7bdf-4783-af91-004d1f7307e4.png) ### What you expected to happen I expect that the prompt should be 'The task group has already been started.' when the operated task group's status is '1'. ### How to reproduce You can call this function and pass in the parameter of id of a task group, the status of which is '1'. ### 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/7977
https://github.com/apache/dolphinscheduler/pull/7978
6dcf53c4d98d3cb5d26206f53006b41cc9b59a35
23068e9d21a847a5aa22dd1f655198f0d0d89f1f
2022-01-13T01:01:30Z
java
2022-01-13T05:03:05Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
public enum Status { SUCCESS(0, "success", "成功"), INTERNAL_SERVER_ERROR_ARGS(10000, "Internal Server Error: {0}", "服务端异常: {0}"), REQUEST_PARAMS_NOT_VALID_ERROR(10001, "request parameter {0} is not valid", "请求参数[{0}]无效"), TASK_TIMEOUT_PARAMS_ERROR(10002, "task timeout parameter is not valid", "任务超时参数无效"), USER_NAME_EXIST(10003, "user name already exists", "用户名已存在"), USER_NAME_NULL(10004, "user name is null", "用户名不能为空"), HDFS_OPERATION_ERROR(10006, "hdfs operation error", "hdfs操作错误"), TASK_INSTANCE_NOT_FOUND(10008, "task instance not found", "任务实例不存在"), OS_TENANT_CODE_EXIST(10009, "os tenant code {0} already exists", "操作系统租户[{0}]已存在"), USER_NOT_EXIST(10010, "user {0} not exists", "用户[{0}]不存在"), ALERT_GROUP_NOT_EXIST(10011, "alarm group not found", "告警组不存在"), ALERT_GROUP_EXIST(10012, "alarm group already exists", "告警组名称已存在"), USER_NAME_PASSWD_ERROR(10013, "user name or password error", "用户名或密码错误"), LOGIN_SESSION_FAILED(10014, "create session failed!", "创建session失败"), DATASOURCE_EXIST(10015, "data source name already exists", "数据源名称已存在"), DATASOURCE_CONNECT_FAILED(10016, "data source connection failed", "建立数据源连接失败"), TENANT_NOT_EXIST(10017, "tenant not exists", "租户不存在"), PROJECT_NOT_FOUND(10018, "project {0} not found ", "项目[{0}]不存在"), PROJECT_ALREADY_EXISTS(10019, "project {0} already exists", "项目名称[{0}]已存在"), TASK_INSTANCE_NOT_EXISTS(10020, "task instance {0} does not exist", "任务实例[{0}]不存在"), TASK_INSTANCE_NOT_SUB_WORKFLOW_INSTANCE(10021, "task instance {0} is not sub process instance", "任务实例[{0}]不是子流程实例"), SCHEDULE_CRON_NOT_EXISTS(10022, "scheduler crontab {0} does not exist", "调度配置定时表达式[{0}]不存在"), SCHEDULE_CRON_ONLINE_FORBID_UPDATE(10023, "online status does not allow update operations", "调度配置上线状态不允许修改"), SCHEDULE_CRON_CHECK_FAILED(10024, "scheduler crontab expression validation failure: {0}", "调度配置定时表达式验证失败: {0}"), MASTER_NOT_EXISTS(10025, "master does not exist", "无可用master节点"), SCHEDULE_STATUS_UNKNOWN(10026, "unknown status: {0}", "未知状态: {0}"), CREATE_ALERT_GROUP_ERROR(10027, "create alert group error", "创建告警组错误"), QUERY_ALL_ALERTGROUP_ERROR(10028, "query all alertgroup error", "查询告警组错误"), LIST_PAGING_ALERT_GROUP_ERROR(10029, "list paging alert group error", "分页查询告警组错误"),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,977
[Bug] [API] There's a wrong prompt in the class of TaskGroupServiceImpl when starting to set the status of a task group as the value '1'.
### 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 When trying to invoke the function 'startTaskGroup' in the class of 'TaskGroupServiceImpl' it will has a wrong prompt if the task group's status is '1'. ![image](https://user-images.githubusercontent.com/4928204/149245570-492f9b47-2f64-4fb6-ab04-0d4b3bb00995.png) ![image](https://user-images.githubusercontent.com/4928204/149245917-1b9eb1d0-7bdf-4783-af91-004d1f7307e4.png) ### What you expected to happen I expect that the prompt should be 'The task group has already been started.' when the operated task group's status is '1'. ### How to reproduce You can call this function and pass in the parameter of id of a task group, the status of which is '1'. ### 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/7977
https://github.com/apache/dolphinscheduler/pull/7978
6dcf53c4d98d3cb5d26206f53006b41cc9b59a35
23068e9d21a847a5aa22dd1f655198f0d0d89f1f
2022-01-13T01:01:30Z
java
2022-01-13T05:03:05Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
UPDATE_ALERT_GROUP_ERROR(10030, "update alert group error", "更新告警组错误"), DELETE_ALERT_GROUP_ERROR(10031, "delete alert group error", "删除告警组错误"), ALERT_GROUP_GRANT_USER_ERROR(10032, "alert group grant user error", "告警组授权用户错误"), CREATE_DATASOURCE_ERROR(10033, "create datasource error", "创建数据源错误"), UPDATE_DATASOURCE_ERROR(10034, "update datasource error", "更新数据源错误"), QUERY_DATASOURCE_ERROR(10035, "query datasource error", "查询数据源错误"), CONNECT_DATASOURCE_FAILURE(10036, "connect datasource failure", "建立数据源连接失败"), CONNECTION_TEST_FAILURE(10037, "connection test failure", "测试数据源连接失败"), DELETE_DATA_SOURCE_FAILURE(10038, "delete data source failure", "删除数据源失败"), VERIFY_DATASOURCE_NAME_FAILURE(10039, "verify datasource name failure", "验证数据源名称失败"), UNAUTHORIZED_DATASOURCE(10040, "unauthorized datasource", "未经授权的数据源"), AUTHORIZED_DATA_SOURCE(10041, "authorized data source", "授权数据源失败"), LOGIN_SUCCESS(10042, "login success", "登录成功"), USER_LOGIN_FAILURE(10043, "user login failure", "用户登录失败"), LIST_WORKERS_ERROR(10044, "list workers error", "查询worker列表错误"), LIST_MASTERS_ERROR(10045, "list masters error", "查询master列表错误"), UPDATE_PROJECT_ERROR(10046, "update project error", "更新项目信息错误"), QUERY_PROJECT_DETAILS_BY_CODE_ERROR(10047, "query project details by code error", "查询项目详细信息错误"), CREATE_PROJECT_ERROR(10048, "create project error", "创建项目错误"), LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR(10049, "login user query project list paging error", "分页查询项目列表错误"), DELETE_PROJECT_ERROR(10050, "delete project error", "删除项目错误"), QUERY_UNAUTHORIZED_PROJECT_ERROR(10051, "query unauthorized project error", "查询未授权项目错误"), QUERY_AUTHORIZED_PROJECT(10052, "query authorized project", "查询授权项目错误"), QUERY_QUEUE_LIST_ERROR(10053, "query queue list error", "查询队列列表错误"), CREATE_RESOURCE_ERROR(10054, "create resource error", "创建资源错误"), UPDATE_RESOURCE_ERROR(10055, "update resource error", "更新资源错误"), QUERY_RESOURCES_LIST_ERROR(10056, "query resources list error", "查询资源列表错误"), QUERY_RESOURCES_LIST_PAGING(10057, "query resources list paging", "分页查询资源列表错误"), DELETE_RESOURCE_ERROR(10058, "delete resource error", "删除资源错误"), VERIFY_RESOURCE_BY_NAME_AND_TYPE_ERROR(10059, "verify resource by name and type error", "资源名称或类型验证错误"),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,977
[Bug] [API] There's a wrong prompt in the class of TaskGroupServiceImpl when starting to set the status of a task group as the value '1'.
### 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 When trying to invoke the function 'startTaskGroup' in the class of 'TaskGroupServiceImpl' it will has a wrong prompt if the task group's status is '1'. ![image](https://user-images.githubusercontent.com/4928204/149245570-492f9b47-2f64-4fb6-ab04-0d4b3bb00995.png) ![image](https://user-images.githubusercontent.com/4928204/149245917-1b9eb1d0-7bdf-4783-af91-004d1f7307e4.png) ### What you expected to happen I expect that the prompt should be 'The task group has already been started.' when the operated task group's status is '1'. ### How to reproduce You can call this function and pass in the parameter of id of a task group, the status of which is '1'. ### 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/7977
https://github.com/apache/dolphinscheduler/pull/7978
6dcf53c4d98d3cb5d26206f53006b41cc9b59a35
23068e9d21a847a5aa22dd1f655198f0d0d89f1f
2022-01-13T01:01:30Z
java
2022-01-13T05:03:05Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
VIEW_RESOURCE_FILE_ON_LINE_ERROR(10060, "view resource file online error", "查看资源文件错误"), CREATE_RESOURCE_FILE_ON_LINE_ERROR(10061, "create resource file online error", "创建资源文件错误"), RESOURCE_FILE_IS_EMPTY(10062, "resource file is empty", "资源文件内容不能为空"), EDIT_RESOURCE_FILE_ON_LINE_ERROR(10063, "edit resource file online error", "更新资源文件错误"), DOWNLOAD_RESOURCE_FILE_ERROR(10064, "download resource file error", "下载资源文件错误"), CREATE_UDF_FUNCTION_ERROR(10065, "create udf function error", "创建UDF函数错误"), VIEW_UDF_FUNCTION_ERROR(10066, "view udf function error", "查询UDF函数错误"), UPDATE_UDF_FUNCTION_ERROR(10067, "update udf function error", "更新UDF函数错误"), QUERY_UDF_FUNCTION_LIST_PAGING_ERROR(10068, "query udf function list paging error", "分页查询UDF函数列表错误"), QUERY_DATASOURCE_BY_TYPE_ERROR(10069, "query datasource by type error", "查询数据源信息错误"), VERIFY_UDF_FUNCTION_NAME_ERROR(10070, "verify udf function name error", "UDF函数名称验证错误"), DELETE_UDF_FUNCTION_ERROR(10071, "delete udf function error", "删除UDF函数错误"), AUTHORIZED_FILE_RESOURCE_ERROR(10072, "authorized file resource error", "授权资源文件错误"), AUTHORIZE_RESOURCE_TREE(10073, "authorize resource tree display error", "授权资源目录树错误"), UNAUTHORIZED_UDF_FUNCTION_ERROR(10074, "unauthorized udf function error", "查询未授权UDF函数错误"), AUTHORIZED_UDF_FUNCTION_ERROR(10075, "authorized udf function error", "授权UDF函数错误"), CREATE_SCHEDULE_ERROR(10076, "create schedule error", "创建调度配置错误"), UPDATE_SCHEDULE_ERROR(10077, "update schedule error", "更新调度配置错误"), PUBLISH_SCHEDULE_ONLINE_ERROR(10078, "publish schedule online error", "上线调度配置错误"), OFFLINE_SCHEDULE_ERROR(10079, "offline schedule error", "下线调度配置错误"), QUERY_SCHEDULE_LIST_PAGING_ERROR(10080, "query schedule list paging error", "分页查询调度配置列表错误"), QUERY_SCHEDULE_LIST_ERROR(10081, "query schedule list error", "查询调度配置列表错误"), QUERY_TASK_LIST_PAGING_ERROR(10082, "query task list paging error", "分页查询任务列表错误"), QUERY_TASK_RECORD_LIST_PAGING_ERROR(10083, "query task record list paging error", "分页查询任务记录错误"), CREATE_TENANT_ERROR(10084, "create tenant error", "创建租户错误"), QUERY_TENANT_LIST_PAGING_ERROR(10085, "query tenant list paging error", "分页查询租户列表错误"), QUERY_TENANT_LIST_ERROR(10086, "query tenant list error", "查询租户列表错误"), UPDATE_TENANT_ERROR(10087, "update tenant error", "更新租户错误"), DELETE_TENANT_BY_ID_ERROR(10088, "delete tenant by id error", "删除租户错误"), VERIFY_OS_TENANT_CODE_ERROR(10089, "verify os tenant code error", "操作系统租户验证错误"),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,977
[Bug] [API] There's a wrong prompt in the class of TaskGroupServiceImpl when starting to set the status of a task group as the value '1'.
### 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 When trying to invoke the function 'startTaskGroup' in the class of 'TaskGroupServiceImpl' it will has a wrong prompt if the task group's status is '1'. ![image](https://user-images.githubusercontent.com/4928204/149245570-492f9b47-2f64-4fb6-ab04-0d4b3bb00995.png) ![image](https://user-images.githubusercontent.com/4928204/149245917-1b9eb1d0-7bdf-4783-af91-004d1f7307e4.png) ### What you expected to happen I expect that the prompt should be 'The task group has already been started.' when the operated task group's status is '1'. ### How to reproduce You can call this function and pass in the parameter of id of a task group, the status of which is '1'. ### 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/7977
https://github.com/apache/dolphinscheduler/pull/7978
6dcf53c4d98d3cb5d26206f53006b41cc9b59a35
23068e9d21a847a5aa22dd1f655198f0d0d89f1f
2022-01-13T01:01:30Z
java
2022-01-13T05:03:05Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
CREATE_USER_ERROR(10090, "create user error", "创建用户错误"), QUERY_USER_LIST_PAGING_ERROR(10091, "query user list paging error", "分页查询用户列表错误"), UPDATE_USER_ERROR(10092, "update user error", "更新用户错误"), DELETE_USER_BY_ID_ERROR(10093, "delete user by id error", "删除用户错误"), GRANT_PROJECT_ERROR(10094, "grant project error", "授权项目错误"), GRANT_RESOURCE_ERROR(10095, "grant resource error", "授权资源错误"), GRANT_UDF_FUNCTION_ERROR(10096, "grant udf function error", "授权UDF函数错误"), GRANT_DATASOURCE_ERROR(10097, "grant datasource error", "授权数据源错误"), GET_USER_INFO_ERROR(10098, "get user info error", "获取用户信息错误"), USER_LIST_ERROR(10099, "user list error", "查询用户列表错误"), VERIFY_USERNAME_ERROR(10100, "verify username error", "用户名验证错误"), UNAUTHORIZED_USER_ERROR(10101, "unauthorized user error", "查询未授权用户错误"), AUTHORIZED_USER_ERROR(10102, "authorized user error", "查询授权用户错误"), QUERY_TASK_INSTANCE_LOG_ERROR(10103, "view task instance log error", "查询任务实例日志错误"), DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR(10104, "download task instance log file error", "下载任务日志文件错误"), CREATE_PROCESS_DEFINITION_ERROR(10105, "create process definition error", "创建工作流错误"), VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR(10106, "verify process definition name unique error", "工作流定义名称验证错误"), UPDATE_PROCESS_DEFINITION_ERROR(10107, "update process definition error", "更新工作流定义错误"), RELEASE_PROCESS_DEFINITION_ERROR(10108, "release process definition error", "上线工作流错误"), QUERY_DETAIL_OF_PROCESS_DEFINITION_ERROR(10109, "query detail of process definition error", "查询工作流详细信息错误"), QUERY_PROCESS_DEFINITION_LIST(10110, "query process definition list", "查询工作流列表错误"), ENCAPSULATION_TREEVIEW_STRUCTURE_ERROR(10111, "encapsulation treeview structure error", "查询工作流树形图数据错误"), GET_TASKS_LIST_BY_PROCESS_DEFINITION_ID_ERROR(10112, "get tasks list by process definition id error", "查询工作流定义节点信息错误"), QUERY_PROCESS_INSTANCE_LIST_PAGING_ERROR(10113, "query process instance list paging error", "分页查询工作流实例列表错误"), QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_ERROR(10114, "query task list by process instance id error", "查询任务实例列表错误"), UPDATE_PROCESS_INSTANCE_ERROR(10115, "update process instance error", "更新工作流实例错误"), QUERY_PROCESS_INSTANCE_BY_ID_ERROR(10116, "query process instance by id error", "查询工作流实例错误"), DELETE_PROCESS_INSTANCE_BY_ID_ERROR(10117, "delete process instance by id error", "删除工作流实例错误"), QUERY_SUB_PROCESS_INSTANCE_DETAIL_INFO_BY_TASK_ID_ERROR(10118, "query sub process instance detail info by task id error", "查询子流程任务实例错误"), QUERY_PARENT_PROCESS_INSTANCE_DETAIL_INFO_BY_SUB_PROCESS_INSTANCE_ID_ERROR(10119, "query parent process instance detail info by sub process instance id error", "查询子流程该工作流实例错误"),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,977
[Bug] [API] There's a wrong prompt in the class of TaskGroupServiceImpl when starting to set the status of a task group as the value '1'.
### 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 When trying to invoke the function 'startTaskGroup' in the class of 'TaskGroupServiceImpl' it will has a wrong prompt if the task group's status is '1'. ![image](https://user-images.githubusercontent.com/4928204/149245570-492f9b47-2f64-4fb6-ab04-0d4b3bb00995.png) ![image](https://user-images.githubusercontent.com/4928204/149245917-1b9eb1d0-7bdf-4783-af91-004d1f7307e4.png) ### What you expected to happen I expect that the prompt should be 'The task group has already been started.' when the operated task group's status is '1'. ### How to reproduce You can call this function and pass in the parameter of id of a task group, the status of which is '1'. ### 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/7977
https://github.com/apache/dolphinscheduler/pull/7978
6dcf53c4d98d3cb5d26206f53006b41cc9b59a35
23068e9d21a847a5aa22dd1f655198f0d0d89f1f
2022-01-13T01:01:30Z
java
2022-01-13T05:03:05Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
QUERY_PROCESS_INSTANCE_ALL_VARIABLES_ERROR(10120, "query process instance all variables error", "查询工作流自定义变量信息错误"), ENCAPSULATION_PROCESS_INSTANCE_GANTT_STRUCTURE_ERROR(10121, "encapsulation process instance gantt structure error", "查询工作流实例甘特图数据错误"), QUERY_PROCESS_DEFINITION_LIST_PAGING_ERROR(10122, "query process definition list paging error", "分页查询工作流定义列表错误"), SIGN_OUT_ERROR(10123, "sign out error", "退出错误"), OS_TENANT_CODE_HAS_ALREADY_EXISTS(10124, "os tenant code has already exists", "操作系统租户已存在"), IP_IS_EMPTY(10125, "ip is empty", "IP地址不能为空"), SCHEDULE_CRON_REALEASE_NEED_NOT_CHANGE(10126, "schedule release is already {0}", "调度配置上线错误[{0}]"), CREATE_QUEUE_ERROR(10127, "create queue error", "创建队列错误"), QUEUE_NOT_EXIST(10128, "queue {0} not exists", "队列ID[{0}]不存在"), QUEUE_VALUE_EXIST(10129, "queue value {0} already exists", "队列值[{0}]已存在"), QUEUE_NAME_EXIST(10130, "queue name {0} already exists", "队列名称[{0}]已存在"), UPDATE_QUEUE_ERROR(10131, "update queue error", "更新队列信息错误"), NEED_NOT_UPDATE_QUEUE(10132, "no content changes, no updates are required", "数据未变更,不需要更新队列信息"), VERIFY_QUEUE_ERROR(10133, "verify queue error", "验证队列信息错误"), NAME_NULL(10134, "name must be not null", "名称不能为空"), NAME_EXIST(10135, "name {0} already exists", "名称[{0}]已存在"), SAVE_ERROR(10136, "save error", "保存错误"), DELETE_PROJECT_ERROR_DEFINES_NOT_NULL(10137, "please delete the process definitions in project first!", "请先删除全部工作流定义"), BATCH_DELETE_PROCESS_INSTANCE_BY_IDS_ERROR(10117, "batch delete process instance by ids {0} error", "批量删除工作流实例错误: {0}"), PREVIEW_SCHEDULE_ERROR(10139, "preview schedule error", "预览调度配置错误"), PARSE_TO_CRON_EXPRESSION_ERROR(10140, "parse cron to cron expression error", "解析调度表达式错误"), SCHEDULE_START_TIME_END_TIME_SAME(10141, "The start time must not be the same as the end", "开始时间不能和结束时间一样"), DELETE_TENANT_BY_ID_FAIL(10142, "delete tenant by id fail, for there are {0} process instances in executing using it", "删除租户失败,有[{0}]个运行中的工作流实例正在使用"), DELETE_TENANT_BY_ID_FAIL_DEFINES(10143, "delete tenant by id fail, for there are {0} process definitions using it", "删除租户失败,有[{0}]个工作流定义正在使用"), DELETE_TENANT_BY_ID_FAIL_USERS(10144, "delete tenant by id fail, for there are {0} users using it", "删除租户失败,有[{0}]个用户正在使用"), DELETE_WORKER_GROUP_BY_ID_FAIL(10145, "delete worker group by id fail, for there are {0} process instances in executing using it", "删除Worker分组失败,有[{0}]个运行中的工作流实例正在使用"), QUERY_WORKER_GROUP_FAIL(10146, "query worker group fail ", "查询worker分组失败"), DELETE_WORKER_GROUP_FAIL(10147, "delete worker group fail ", "删除worker分组失败"), USER_DISABLED(10148, "The current user is disabled", "当前用户已停用"), COPY_PROCESS_DEFINITION_ERROR(10149, "copy process definition from {0} to {1} error : {2}", "从{0}复制工作流到{1}错误 : {2}"),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,977
[Bug] [API] There's a wrong prompt in the class of TaskGroupServiceImpl when starting to set the status of a task group as the value '1'.
### 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 When trying to invoke the function 'startTaskGroup' in the class of 'TaskGroupServiceImpl' it will has a wrong prompt if the task group's status is '1'. ![image](https://user-images.githubusercontent.com/4928204/149245570-492f9b47-2f64-4fb6-ab04-0d4b3bb00995.png) ![image](https://user-images.githubusercontent.com/4928204/149245917-1b9eb1d0-7bdf-4783-af91-004d1f7307e4.png) ### What you expected to happen I expect that the prompt should be 'The task group has already been started.' when the operated task group's status is '1'. ### How to reproduce You can call this function and pass in the parameter of id of a task group, the status of which is '1'. ### 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/7977
https://github.com/apache/dolphinscheduler/pull/7978
6dcf53c4d98d3cb5d26206f53006b41cc9b59a35
23068e9d21a847a5aa22dd1f655198f0d0d89f1f
2022-01-13T01:01:30Z
java
2022-01-13T05:03:05Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
MOVE_PROCESS_DEFINITION_ERROR(10150, "move process definition from {0} to {1} error : {2}", "从{0}移动工作流到{1}错误 : {2}"), SWITCH_PROCESS_DEFINITION_VERSION_ERROR(10151, "Switch process definition version error", "切换工作流版本出错"), SWITCH_PROCESS_DEFINITION_VERSION_NOT_EXIST_PROCESS_DEFINITION_ERROR(10152 , "Switch process definition version error: not exists process definition, [process definition id {0}]", "切换工作流版本出错:工作流不存在,[工作流id {0}]"), SWITCH_PROCESS_DEFINITION_VERSION_NOT_EXIST_PROCESS_DEFINITION_VERSION_ERROR(10153 , "Switch process definition version error: not exists process definition version, [process definition id {0}] [version number {1}]", "切换工作流版本出错:工作流版本信息不存在,[工作流id {0}] [版本号 {1}]"), QUERY_PROCESS_DEFINITION_VERSIONS_ERROR(10154, "query process definition versions error", "查询工作流历史版本信息出错"), DELETE_PROCESS_DEFINITION_VERSION_ERROR(10156, "delete process definition version error", "删除工作流历史版本出错"), QUERY_USER_CREATED_PROJECT_ERROR(10157, "query user created project error error", "查询用户创建的项目错误"), PROCESS_DEFINITION_CODES_IS_EMPTY(10158, "process definition codes is empty", "工作流CODES不能为空"), BATCH_COPY_PROCESS_DEFINITION_ERROR(10159, "batch copy process definition error", "复制工作流错误"), BATCH_MOVE_PROCESS_DEFINITION_ERROR(10160, "batch move process definition error", "移动工作流错误"), QUERY_WORKFLOW_LINEAGE_ERROR(10161, "query workflow lineage error", "查询血缘失败"), QUERY_AUTHORIZED_AND_USER_CREATED_PROJECT_ERROR(10162, "query authorized and user created project error error", "查询授权的和用户创建的项目错误"), DELETE_PROCESS_DEFINITION_BY_CODE_FAIL(10163, "delete process definition by code fail, for there are {0} process instances in executing using it", "删除工作流定义失败,有[{0}]个运行中的工作流实例正在使用"), CHECK_OS_TENANT_CODE_ERROR(10164, "Please enter the English os tenant code", "请输入英文操作系统租户"), FORCE_TASK_SUCCESS_ERROR(10165, "force task success error", "强制成功任务实例错误"), TASK_INSTANCE_STATE_OPERATION_ERROR(10166, "the status of task instance {0} is {1},Cannot perform force success operation", "任务实例[{0}]的状态是[{1}],无法执行强制成功操作"), DATASOURCE_TYPE_NOT_EXIST(10167, "data source type not exist", "数据源类型不存在"), PROCESS_DEFINITION_NAME_EXIST(10168, "process definition name {0} already exists", "工作流定义名称[{0}]已存在"), DATASOURCE_DB_TYPE_ILLEGAL(10169, "datasource type illegal", "数据源类型参数不合法"), DATASOURCE_PORT_ILLEGAL(10170, "datasource port illegal", "数据源端口参数不合法"), DATASOURCE_OTHER_PARAMS_ILLEGAL(10171, "datasource other params illegal", "数据源其他参数不合法"), DATASOURCE_NAME_ILLEGAL(10172, "datasource name illegal", "数据源名称不合法"), DATASOURCE_HOST_ILLEGAL(10173, "datasource host illegal", "数据源HOST不合法"), DELETE_WORKER_GROUP_NOT_EXIST(10174, "delete worker group not exist ", "删除worker分组不存在"), CREATE_WORKER_GROUP_FORBIDDEN_IN_DOCKER(10175, "create worker group forbidden in docker ", "创建worker分组在docker中禁止"), DELETE_WORKER_GROUP_FORBIDDEN_IN_DOCKER(10176, "delete worker group forbidden in docker ", "删除worker分组在docker中禁止"), WORKER_ADDRESS_INVALID(10177, "worker address {0} invalid", "worker地址[{0}]无效"), QUERY_WORKER_ADDRESS_LIST_FAIL(10178, "query worker address list fail ", "查询worker地址列表失败"),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,977
[Bug] [API] There's a wrong prompt in the class of TaskGroupServiceImpl when starting to set the status of a task group as the value '1'.
### 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 When trying to invoke the function 'startTaskGroup' in the class of 'TaskGroupServiceImpl' it will has a wrong prompt if the task group's status is '1'. ![image](https://user-images.githubusercontent.com/4928204/149245570-492f9b47-2f64-4fb6-ab04-0d4b3bb00995.png) ![image](https://user-images.githubusercontent.com/4928204/149245917-1b9eb1d0-7bdf-4783-af91-004d1f7307e4.png) ### What you expected to happen I expect that the prompt should be 'The task group has already been started.' when the operated task group's status is '1'. ### How to reproduce You can call this function and pass in the parameter of id of a task group, the status of which is '1'. ### 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/7977
https://github.com/apache/dolphinscheduler/pull/7978
6dcf53c4d98d3cb5d26206f53006b41cc9b59a35
23068e9d21a847a5aa22dd1f655198f0d0d89f1f
2022-01-13T01:01:30Z
java
2022-01-13T05:03:05Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
TRANSFORM_PROJECT_OWNERSHIP(10179, "Please transform project ownership [{0}]", "请先转移项目所有权[{0}]"), QUERY_ALERT_GROUP_ERROR(10180, "query alert group error", "查询告警组错误"), CURRENT_LOGIN_USER_TENANT_NOT_EXIST(10181, "the tenant of the currently login user is not specified", "未指定当前登录用户的租户"), REVOKE_PROJECT_ERROR(10182, "revoke project error", "撤销项目授权错误"), QUERY_AUTHORIZED_USER(10183, "query authorized user error", "查询拥有项目权限的用户错误"), PROJECT_NOT_EXIST(10190, "This project was not found. Please refresh page.", "该项目不存在,请刷新页面"), UDF_FUNCTION_NOT_EXIST(20001, "UDF function not found", "UDF函数不存在"), UDF_FUNCTION_EXISTS(20002, "UDF function already exists", "UDF函数已存在"), RESOURCE_NOT_EXIST(20004, "resource not exist", "资源不存在"), RESOURCE_EXIST(20005, "resource already exists", "资源已存在"), RESOURCE_SUFFIX_NOT_SUPPORT_VIEW(20006, "resource suffix do not support online viewing", "资源文件后缀不支持查看"), RESOURCE_SIZE_EXCEED_LIMIT(20007, "upload resource file size exceeds limit", "上传资源文件大小超过限制"), RESOURCE_SUFFIX_FORBID_CHANGE(20008, "resource suffix not allowed to be modified", "资源文件后缀不支持修改"), UDF_RESOURCE_SUFFIX_NOT_JAR(20009, "UDF resource suffix name must be jar", "UDF资源文件后缀名只支持[jar]"), HDFS_COPY_FAIL(20010, "hdfs copy {0} -> {1} fail", "hdfs复制失败:[{0}] -> [{1}]"), RESOURCE_FILE_EXIST(20011, "resource file {0} already exists in hdfs,please delete it or change name!", "资源文件[{0}]在hdfs中已存在,请删除或修改资源名"), RESOURCE_FILE_NOT_EXIST(20012, "resource file {0} not exists in hdfs!", "资源文件[{0}]在hdfs中不存在"), UDF_RESOURCE_IS_BOUND(20013, "udf resource file is bound by UDF functions:{0}", "udf函数绑定了资源文件[{0}]"), RESOURCE_IS_USED(20014, "resource file is used by process definition", "资源文件被上线的流程定义使用了"), PARENT_RESOURCE_NOT_EXIST(20015, "parent resource not exist", "父资源文件不存在"), RESOURCE_NOT_EXIST_OR_NO_PERMISSION(20016, "resource not exist or no permission,please view the task node and remove error resource", "请检查任务节点并移除无权限或者已删除的资源"), RESOURCE_IS_AUTHORIZED(20017, "resource is authorized to user {0},suffix not allowed to be modified", "资源文件已授权其他用户[{0}],后缀不允许修改"), USER_NO_OPERATION_PERM(30001, "user has no operation privilege", "当前用户没有操作权限"), USER_NO_OPERATION_PROJECT_PERM(30002, "user {0} is not has project {1} permission", "当前用户[{0}]没有[{1}]项目的操作权限"), PROCESS_INSTANCE_NOT_EXIST(50001, "process instance {0} does not exist", "工作流实例[{0}]不存在"), PROCESS_INSTANCE_EXIST(50002, "process instance {0} already exists", "工作流实例[{0}]已存在"), PROCESS_DEFINE_NOT_EXIST(50003, "process definition {0} does not exist", "工作流定义[{0}]不存在"), PROCESS_DEFINE_NOT_RELEASE(50004, "process definition {0} not on line", "工作流定义[{0}]不是上线状态"), PROCESS_INSTANCE_ALREADY_CHANGED(50005, "the status of process instance {0} is already {1}", "工作流实例[{0}]的状态已经是[{1}]"), PROCESS_INSTANCE_STATE_OPERATION_ERROR(50006, "the status of process instance {0} is {1},Cannot perform {2} operation", "工作流实例[{0}]的状态是[{1}],无法执行[{2}]操作"),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,977
[Bug] [API] There's a wrong prompt in the class of TaskGroupServiceImpl when starting to set the status of a task group as the value '1'.
### 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 When trying to invoke the function 'startTaskGroup' in the class of 'TaskGroupServiceImpl' it will has a wrong prompt if the task group's status is '1'. ![image](https://user-images.githubusercontent.com/4928204/149245570-492f9b47-2f64-4fb6-ab04-0d4b3bb00995.png) ![image](https://user-images.githubusercontent.com/4928204/149245917-1b9eb1d0-7bdf-4783-af91-004d1f7307e4.png) ### What you expected to happen I expect that the prompt should be 'The task group has already been started.' when the operated task group's status is '1'. ### How to reproduce You can call this function and pass in the parameter of id of a task group, the status of which is '1'. ### 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/7977
https://github.com/apache/dolphinscheduler/pull/7978
6dcf53c4d98d3cb5d26206f53006b41cc9b59a35
23068e9d21a847a5aa22dd1f655198f0d0d89f1f
2022-01-13T01:01:30Z
java
2022-01-13T05:03:05Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
SUB_PROCESS_INSTANCE_NOT_EXIST(50007, "the task belong to process instance does not exist", "子工作流实例不存在"), PROCESS_DEFINE_NOT_ALLOWED_EDIT(50008, "process definition {0} does not allow edit", "工作流定义[{0}]不允许修改"), PROCESS_INSTANCE_EXECUTING_COMMAND(50009, "process instance {0} is executing the command, please wait ...", "工作流实例[{0}]正在执行命令,请稍等..."), PROCESS_INSTANCE_NOT_SUB_PROCESS_INSTANCE(50010, "process instance {0} is not sub process instance", "工作流实例[{0}]不是子工作流实例"), TASK_INSTANCE_STATE_COUNT_ERROR(50011, "task instance state count error", "查询各状态任务实例数错误"), COUNT_PROCESS_INSTANCE_STATE_ERROR(50012, "count process instance state error", "查询各状态流程实例数错误"), COUNT_PROCESS_DEFINITION_USER_ERROR(50013, "count process definition user error", "查询各用户流程定义数错误"), START_PROCESS_INSTANCE_ERROR(50014, "start process instance error", "运行工作流实例错误"), BATCH_START_PROCESS_INSTANCE_ERROR(50014, "batch start process instance error: {0}", "批量运行工作流实例错误: {0}"), EXECUTE_PROCESS_INSTANCE_ERROR(50015, "execute process instance error", "操作工作流实例错误"), CHECK_PROCESS_DEFINITION_ERROR(50016, "check process definition error", "工作流定义错误"), QUERY_RECIPIENTS_AND_COPYERS_BY_PROCESS_DEFINITION_ERROR(50017, "query recipients and copyers by process definition error", "查询收件人和抄送人错误"), DATA_IS_NOT_VALID(50017, "data {0} not valid", "数据[{0}]无效"), DATA_IS_NULL(50018, "data {0} is null", "数据[{0}]不能为空"), PROCESS_NODE_HAS_CYCLE(50019, "process node has cycle", "流程节点间存在循环依赖"), PROCESS_NODE_S_PARAMETER_INVALID(50020, "process node {0} parameter invalid", "流程节点[{0}]参数无效"), PROCESS_DEFINE_STATE_ONLINE(50021, "process definition [{0}] is already on line", "工作流定义[{0}]已上线"), DELETE_PROCESS_DEFINE_BY_CODE_ERROR(50022, "delete process definition by code error", "删除工作流定义错误"), SCHEDULE_CRON_STATE_ONLINE(50023, "the status of schedule {0} is already on line", "调度配置[{0}]已上线"), DELETE_SCHEDULE_CRON_BY_ID_ERROR(50024, "delete schedule by id error", "删除调度配置错误"), BATCH_DELETE_PROCESS_DEFINE_ERROR(50025, "batch delete process definition error", "批量删除工作流定义错误"), BATCH_DELETE_PROCESS_DEFINE_BY_CODES_ERROR(50026, "batch delete process definition by codes {0} error", "批量删除工作流定义[{0}]错误"), TENANT_NOT_SUITABLE(50027, "there is not any tenant suitable, please choose a tenant available.", "没有合适的租户,请选择可用的租户"), EXPORT_PROCESS_DEFINE_BY_ID_ERROR(50028, "export process definition by id error", "导出工作流定义错误"), BATCH_EXPORT_PROCESS_DEFINE_BY_IDS_ERROR(50028, "batch export process definition by ids error", "批量导出工作流定义错误"), IMPORT_PROCESS_DEFINE_ERROR(50029, "import process definition error", "导入工作流定义错误"), TASK_DEFINE_NOT_EXIST(50030, "task definition [{0}] does not exist", "任务定义[{0}]不存在"), CREATE_PROCESS_TASK_RELATION_ERROR(50032, "create process task relation error", "创建工作流任务关系错误"), PROCESS_TASK_RELATION_NOT_EXIST(50033, "process task relation [{0}] does not exist", "工作流任务关系[{0}]不存在"), PROCESS_TASK_RELATION_EXIST(50034, "process task relation is already exist, processCode:[{0}]", "工作流任务关系已存在, processCode:[{0}]"),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,977
[Bug] [API] There's a wrong prompt in the class of TaskGroupServiceImpl when starting to set the status of a task group as the value '1'.
### 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 When trying to invoke the function 'startTaskGroup' in the class of 'TaskGroupServiceImpl' it will has a wrong prompt if the task group's status is '1'. ![image](https://user-images.githubusercontent.com/4928204/149245570-492f9b47-2f64-4fb6-ab04-0d4b3bb00995.png) ![image](https://user-images.githubusercontent.com/4928204/149245917-1b9eb1d0-7bdf-4783-af91-004d1f7307e4.png) ### What you expected to happen I expect that the prompt should be 'The task group has already been started.' when the operated task group's status is '1'. ### How to reproduce You can call this function and pass in the parameter of id of a task group, the status of which is '1'. ### 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/7977
https://github.com/apache/dolphinscheduler/pull/7978
6dcf53c4d98d3cb5d26206f53006b41cc9b59a35
23068e9d21a847a5aa22dd1f655198f0d0d89f1f
2022-01-13T01:01:30Z
java
2022-01-13T05:03:05Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
PROCESS_DAG_IS_EMPTY(50035, "process dag is empty", "工作流dag是空"), CHECK_PROCESS_TASK_RELATION_ERROR(50036, "check process task relation error", "工作流任务关系参数错误"), CREATE_TASK_DEFINITION_ERROR(50037, "create task definition error", "创建任务错误"), UPDATE_TASK_DEFINITION_ERROR(50038, "update task definition error", "更新任务定义错误"), QUERY_TASK_DEFINITION_VERSIONS_ERROR(50039, "query task definition versions error", "查询任务历史版本信息出错"), SWITCH_TASK_DEFINITION_VERSION_ERROR(50040, "Switch task definition version error", "切换任务版本出错"), DELETE_TASK_DEFINITION_VERSION_ERROR(50041, "delete task definition version error", "删除任务历史版本出错"), DELETE_TASK_DEFINE_BY_CODE_ERROR(50042, "delete task definition by code error", "删除任务定义错误"), QUERY_DETAIL_OF_TASK_DEFINITION_ERROR(50043, "query detail of task definition error", "查询任务详细信息错误"), QUERY_TASK_DEFINITION_LIST_PAGING_ERROR(50044, "query task definition list paging error", "分页查询任务定义列表错误"), TASK_DEFINITION_NAME_EXISTED(50045, "task definition name [{0}] already exists", "任务定义名称[{0}]已经存在"), RELEASE_TASK_DEFINITION_ERROR(50046, "release task definition error", "上线任务错误"), MOVE_PROCESS_TASK_RELATION_ERROR(50047, "move process task relation error", "移动任务到其他工作流错误"), DELETE_TASK_PROCESS_RELATION_ERROR(50048, "delete process task relation error", "删除工作流任务关系错误"), QUERY_TASK_PROCESS_RELATION_ERROR(50049, "query process task relation error", "查询工作流任务关系错误"), TASK_DEFINE_STATE_ONLINE(50050, "task definition [{0}] is already on line", "任务定义[{0}]已上线"), TASK_HAS_DOWNSTREAM(50051, "Task exists downstream [{0}] dependence", "任务存在下游[{0}]依赖"), TASK_HAS_UPSTREAM(50052, "Task [{0}] exists upstream dependence", "任务[{0}]存在上游依赖"), MAIN_TABLE_USING_VERSION(50053, "the version that the master table is using", "主表正在使用该版本"), PROJECT_PROCESS_NOT_MATCH(50054, "the project and the process is not match", "项目和工作流不匹配"), DELETE_EDGE_ERROR(50055, "delete edge error", "删除工作流任务连接线错误"), NOT_SUPPORT_UPDATE_TASK_DEFINITION(50056, "task state does not support modification", "当前任务不支持修改"), NOT_SUPPORT_COPY_TASK_TYPE(50057, "task type [{0}] does not support copy", "不支持复制的任务类型[{0}]"), HDFS_NOT_STARTUP(60001, "hdfs not startup", "hdfs未启用"), /** * for monitor */ QUERY_DATABASE_STATE_ERROR(70001, "query database state error", "查询数据库状态错误"), CREATE_ACCESS_TOKEN_ERROR(70010, "create access token error", "创建访问token错误"), GENERATE_TOKEN_ERROR(70011, "generate token error", "生成token错误"),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,977
[Bug] [API] There's a wrong prompt in the class of TaskGroupServiceImpl when starting to set the status of a task group as the value '1'.
### 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 When trying to invoke the function 'startTaskGroup' in the class of 'TaskGroupServiceImpl' it will has a wrong prompt if the task group's status is '1'. ![image](https://user-images.githubusercontent.com/4928204/149245570-492f9b47-2f64-4fb6-ab04-0d4b3bb00995.png) ![image](https://user-images.githubusercontent.com/4928204/149245917-1b9eb1d0-7bdf-4783-af91-004d1f7307e4.png) ### What you expected to happen I expect that the prompt should be 'The task group has already been started.' when the operated task group's status is '1'. ### How to reproduce You can call this function and pass in the parameter of id of a task group, the status of which is '1'. ### 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/7977
https://github.com/apache/dolphinscheduler/pull/7978
6dcf53c4d98d3cb5d26206f53006b41cc9b59a35
23068e9d21a847a5aa22dd1f655198f0d0d89f1f
2022-01-13T01:01:30Z
java
2022-01-13T05:03:05Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
QUERY_ACCESSTOKEN_LIST_PAGING_ERROR(70012, "query access token list paging error", "分页查询访问token列表错误"), UPDATE_ACCESS_TOKEN_ERROR(70013, "update access token error", "更新访问token错误"), DELETE_ACCESS_TOKEN_ERROR(70014, "delete access token error", "删除访问token错误"), ACCESS_TOKEN_NOT_EXIST(70015, "access token not exist", "访问token不存在"), QUERY_ACCESSTOKEN_BY_USER_ERROR(70016, "query access token by user error", "查询访问指定用户的token错误"), COMMAND_STATE_COUNT_ERROR(80001, "task instance state count error", "查询各状态任务实例数错误"), NEGTIVE_SIZE_NUMBER_ERROR(80002, "query size number error", "查询size错误"), START_TIME_BIGGER_THAN_END_TIME_ERROR(80003, "start time bigger than end time error", "开始时间在结束时间之后错误"), QUEUE_COUNT_ERROR(90001, "queue count error", "查询队列数据错误"), KERBEROS_STARTUP_STATE(100001, "get kerberos startup state error", "获取kerberos启动状态错误"), //plugin PLUGIN_NOT_A_UI_COMPONENT(110001, "query plugin error, this plugin has no UI component", "查询插件错误,此插件无UI组件"), QUERY_PLUGINS_RESULT_IS_NULL(110002, "query plugins result is null", "查询插件为空"), QUERY_PLUGINS_ERROR(110003, "query plugins error", "查询插件错误"), QUERY_PLUGIN_DETAIL_RESULT_IS_NULL(110004, "query plugin detail result is null", "查询插件详情结果为空"), UPDATE_ALERT_PLUGIN_INSTANCE_ERROR(110005, "update alert plugin instance error", "更新告警组和告警组插件实例错误"), DELETE_ALERT_PLUGIN_INSTANCE_ERROR(110006, "delete alert plugin instance error", "删除告警组和告警组插件实例错误"), GET_ALERT_PLUGIN_INSTANCE_ERROR(110007, "get alert plugin instance error", "获取告警组和告警组插件实例错误"), CREATE_ALERT_PLUGIN_INSTANCE_ERROR(110008, "create alert plugin instance error", "创建告警组和告警组插件实例错误"), QUERY_ALL_ALERT_PLUGIN_INSTANCE_ERROR(110009, "query all alert plugin instance error", "查询所有告警实例失败"), PLUGIN_INSTANCE_ALREADY_EXIT(110010, "plugin instance already exit", "该告警插件实例已存在"), LIST_PAGING_ALERT_PLUGIN_INSTANCE_ERROR(110011, "query plugin instance page error", "分页查询告警实例失败"), DELETE_ALERT_PLUGIN_INSTANCE_ERROR_HAS_ALERT_GROUP_ASSOCIATED(110012, "failed to delete the alert instance, there is an alarm group associated with this alert instance", "删除告警实例失败,存在与此告警实例关联的警报组"), PROCESS_DEFINITION_VERSION_IS_USED(110013,"this process definition version is used","此工作流定义版本被使用"), CREATE_ENVIRONMENT_ERROR(120001, "create environment error", "创建环境失败"), ENVIRONMENT_NAME_EXISTS(120002,"this enviroment name [{0}] already exists","环境名称[{0}]已经存在"), ENVIRONMENT_NAME_IS_NULL(120003,"this enviroment name shouldn't be empty.","环境名称不能为空"), ENVIRONMENT_CONFIG_IS_NULL(120004,"this enviroment config shouldn't be empty.","环境配置信息不能为空"), UPDATE_ENVIRONMENT_ERROR(120005, "update environment [{0}] info error", "更新环境[{0}]信息失败"),
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,977
[Bug] [API] There's a wrong prompt in the class of TaskGroupServiceImpl when starting to set the status of a task group as the value '1'.
### 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 When trying to invoke the function 'startTaskGroup' in the class of 'TaskGroupServiceImpl' it will has a wrong prompt if the task group's status is '1'. ![image](https://user-images.githubusercontent.com/4928204/149245570-492f9b47-2f64-4fb6-ab04-0d4b3bb00995.png) ![image](https://user-images.githubusercontent.com/4928204/149245917-1b9eb1d0-7bdf-4783-af91-004d1f7307e4.png) ### What you expected to happen I expect that the prompt should be 'The task group has already been started.' when the operated task group's status is '1'. ### How to reproduce You can call this function and pass in the parameter of id of a task group, the status of which is '1'. ### 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/7977
https://github.com/apache/dolphinscheduler/pull/7978
6dcf53c4d98d3cb5d26206f53006b41cc9b59a35
23068e9d21a847a5aa22dd1f655198f0d0d89f1f
2022-01-13T01:01:30Z
java
2022-01-13T05:03:05Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
DELETE_ENVIRONMENT_ERROR(120006, "delete environment error", "删除环境信息失败"), DELETE_ENVIRONMENT_RELATED_TASK_EXISTS(120007, "this environment has been used in tasks,so you can't delete it.", "该环境已经被任务使用,所以不能删除该环境信息"), QUERY_ENVIRONMENT_BY_NAME_ERROR(1200008, "not found environment [{0}] ", "查询环境名称[{0}]信息不存在"), QUERY_ENVIRONMENT_BY_CODE_ERROR(1200009, "not found environment [{0}] ", "查询环境编码[{0}]不存在"), QUERY_ENVIRONMENT_ERROR(1200010, "login user query environment error", "分页查询环境列表错误"), VERIFY_ENVIRONMENT_ERROR(1200011, "verify environment error", "验证环境信息错误"), TASK_GROUP_NAME_EXSIT(130001,"this task group name is repeated in a project","该任务组名称在一个项目中已经使用"), TASK_GROUP_SIZE_ERROR(130002,"task group size error","任务组大小应该为大于1的整数"), TASK_GROUP_STATUS_ERROR(130003,"task group status error","任务组已经被关闭"), TASK_GROUP_FULL(130004,"task group is full","任务组已经满了"), TASK_GROUP_USED_SIZE_ERROR(130005,"the used size number of task group is dirty","任务组使用的容量发生了变化"), TASK_GROUP_QUEUE_RELEASE_ERROR(130006,"relase task group queue failed","任务组资源释放时出现了错误"), TASK_GROUP_QUEUE_AWAKE_ERROR(130007,"awake waiting task failed","任务组使唤醒等待任务时发生了错误"), CREATE_TASK_GROUP_ERROR(130008,"create task group error","创建任务组错误"), UPDATE_TASK_GROUP_ERROR(130009,"update task group list error","更新任务组错误"), QUERY_TASK_GROUP_LIST_ERROR(130010,"query task group list error","查询任务组列表错误"), CLOSE_TASK_GROUP_ERROR(130011,"close task group error","关闭任务组错误"), START_TASK_GROUP_ERROR(130012,"start task group error","启动任务组错误"), QUERY_TASK_GROUP_QUEUE_LIST_ERROR(130013,"query task group queue list error","查询任务组队列列表错误"), TASK_GROUP_CACHE_START_FAILED(130014,"cache start failed","任务组相关的缓存启动失败"), ENVIRONMENT_WORKER_GROUPS_IS_INVALID(130015, "environment worker groups is invalid format", "环境关联的工作组参数解析错误"), UPDATE_ENVIRONMENT_WORKER_GROUP_RELATION_ERROR(130016,"You can't modify the worker group, because the worker group [{0}] and this environment [{1}] already be used in the task [{2}]", "您不能修改工作组选项,因为该工作组 [{0}] 和 该环境 [{1}] 已经被用在任务 [{2}] 中"), TASK_GROUP_QUEUE_ALREADY_START(130017, "task group queue already start", "节点已经获取任务组资源"), NOT_ALLOW_TO_DISABLE_OWN_ACCOUNT(130020, "Not allow to disable your own account", "不能停用自己的账号"), NOT_ALLOW_TO_DELETE_DEFAULT_ALARM_GROUP(130030, "Not allow to delete the default alarm group ", "不能删除默认告警组"), ; private final int code; private final String enMsg; private final String zhMsg;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
7,977
[Bug] [API] There's a wrong prompt in the class of TaskGroupServiceImpl when starting to set the status of a task group as the value '1'.
### 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 When trying to invoke the function 'startTaskGroup' in the class of 'TaskGroupServiceImpl' it will has a wrong prompt if the task group's status is '1'. ![image](https://user-images.githubusercontent.com/4928204/149245570-492f9b47-2f64-4fb6-ab04-0d4b3bb00995.png) ![image](https://user-images.githubusercontent.com/4928204/149245917-1b9eb1d0-7bdf-4783-af91-004d1f7307e4.png) ### What you expected to happen I expect that the prompt should be 'The task group has already been started.' when the operated task group's status is '1'. ### How to reproduce You can call this function and pass in the parameter of id of a task group, the status of which is '1'. ### 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/7977
https://github.com/apache/dolphinscheduler/pull/7978
6dcf53c4d98d3cb5d26206f53006b41cc9b59a35
23068e9d21a847a5aa22dd1f655198f0d0d89f1f
2022-01-13T01:01:30Z
java
2022-01-13T05:03:05Z
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
Status(int code, String enMsg, String zhMsg) { this.code = code; this.enMsg = enMsg; this.zhMsg = zhMsg; } public int getCode() { return this.code; } public String getMsg() { if (Locale.SIMPLIFIED_CHINESE.getLanguage().equals(LocaleContextHolder.getLocale().getLanguage())) { return this.zhMsg; } else { return this.enMsg; } } /** * Retrieve Status enum entity by status code. * @param code * @return */ public static Optional<StatutatusBy(int code) { for (Status status : Status.values()) { if (code == status.getCode()) { return Optional.of(status); } } return Optional.empty(); } }