You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/02 12:56:10 UTC

[GitHub] [dolphinscheduler] amaoisnb opened a new pull request, #11759: Feature 6586

amaoisnb opened a new pull request, #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759

   
   [Feature-6586][Server]add some ds process definition demo when init
   1.add some ds process definition demo when init, to display what task type can run and make user easy to
   use ds.
   2.need configure the JVM parameters (-Ddemo=true) to turn on the StandaloneServer service 
   3.need modify the tenant information in it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1009159865


##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProxyProcessDefinitionController.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.tools.demo;
+
+import org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum;
+import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import org.apache.dolphinscheduler.common.utils.OkHttpUtils;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ProxyProcessDefinitionController {
+
+    @Value("${demo.api-server-port}")
+    private String ServerPort;
+
+    public ProxyResult createProcessDefinition(String token,
+                                               long projectCode,
+                                               String name,
+                                               String description,
+                                               String globalParams,
+                                               String locations,
+                                               int timeout,
+                                               String tenantCode,
+                                               String taskRelationJson,
+                                               String taskDefinitionJson,
+                                               ProcessExecutionTypeEnum executionType) {
+        ProxyResult proxyResult = new ProxyResult();
+        String url =
+                "http://localhost:" + ServerPort + "/dolphinscheduler/projects/" + projectCode + "/process-definition";

Review Comment:
   Has been modified



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1296271467

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11759)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [98 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list)  
   [![40.8%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20plus-16px.png '40.8%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list) [40.8% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] kezhenxu94 commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r996275590


##########
dolphinscheduler-common/pom.xml:
##########
@@ -319,6 +319,15 @@
             <artifactId>netty-all</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>

Review Comment:
   You don't need this, please remove them



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/CreateProcessDemo.java:
##########
@@ -0,0 +1,61 @@
+/*
+ * 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.tools.demo;
+
+
+
+

Review Comment:
   Why so many blank lines?



##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OkHttpUtils.java:
##########
@@ -0,0 +1,130 @@
+/*
+ * 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.common.utils;
+
+import org.apache.http.HttpStatus;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import javax.annotation.Nullable;
+
+import lombok.NonNull;
+import okhttp3.HttpUrl;
+import okhttp3.MediaType;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+
+import org.apache.dolphinscheduler.spi.utils.JSONUtils;
+
+
+public class OkHttpUtils {

Review Comment:
   Please, don't add everything to common module, move this to the module it needs.



##########
dolphinscheduler-common/pom.xml:
##########
@@ -319,6 +319,15 @@
             <artifactId>netty-all</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+        </dependency>

Review Comment:
   Why are you adding a duplicate dependency just the same as line 411? Can you please check whether it exists before adding one?



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProxyResult.java:
##########
@@ -0,0 +1,87 @@
+package org.apache.dolphinscheduler.tools.demo;
+
+
+public class ProxyResult<T> {
+    /**
+     * status
+     */

Review Comment:
   Remove all these useless JavaDoc



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] zhongjiajie commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1285077538

   I have an other suggestion about add example workflow for DolphinScheduler, using Python API. It is already have example in more of the task type, and it define with code, most likely to ORM instead of sql, which is more stable and maintainable.
   
   all we have to do is add a new docker image, and run all examples in Python API to export all example to target database, 
   or directly install python api and run all examples. do you guys think that will be a better solution?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
caishunfeng commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1005123955


##########
dolphinscheduler-tools/src/main/resources/application.yaml:
##########
@@ -34,6 +34,12 @@ spring:
       leak-detection-threshold: 0
       initialization-fail-timeout: 1
 
+create-demo:
+  tenant-code: default
+
+server:
+  port: 5173

Review Comment:
   ```suggestion
   demo:
     tenant-code: default
     api-server-port: 5173
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
caishunfeng commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r963186960


##########
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionControllerTest.java:
##########
@@ -1,423 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.dolphinscheduler.api.controller;
-
-import org.apache.dolphinscheduler.api.enums.Status;
-import org.apache.dolphinscheduler.api.service.impl.ProcessDefinitionServiceImpl;
-import org.apache.dolphinscheduler.api.utils.PageInfo;
-import org.apache.dolphinscheduler.api.utils.Result;
-import org.apache.dolphinscheduler.common.Constants;
-import org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum;
-import org.apache.dolphinscheduler.common.enums.ReleaseState;
-import org.apache.dolphinscheduler.common.enums.UserType;
-import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
-import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog;
-import org.apache.dolphinscheduler.dao.entity.Resource;
-import org.apache.dolphinscheduler.dao.entity.User;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.springframework.mock.web.MockHttpServletResponse;
-
-/**
- * process definition controller test
- */
-@RunWith(MockitoJUnitRunner.Silent.class)

Review Comment:
   Why remove this UT case?



##########
dolphinscheduler-server/pom.xml:
##########
@@ -44,6 +45,10 @@
             <artifactId>mockito-core</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.dolphinscheduler</groupId>
+            <artifactId>dolphinscheduler-api</artifactId>

Review Comment:
   The server should not depend on api-server.



##########
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/demo/DemoContants.java:
##########
@@ -0,0 +1,121 @@
+package org.apache.dolphinscheduler.server.demo;
+
+public class DemoContants {
+    public static final String [] SHELL_taskDefinitionJson = {"[{\"code\":",

Review Comment:
   Replace with Java Object  is better, because users can update it easily, and if someone change the Jave class, such as `TaskDefinition`, then he will update this too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] SbloodyS commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
SbloodyS commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r962150548


##########
dolphinscheduler-standalone-server/src/main/bin/start.sh:
##########
@@ -36,4 +36,4 @@ done
 
 java $JAVA_OPTS \
   -cp "$DOLPHINSCHEDULER_HOME/conf":"$CP" \
-  org.apache.dolphinscheduler.StandaloneServer
+  org.apache.dolphinscheduler.StandaloneServer

Review Comment:
   Please remove unnessnary change.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
caishunfeng commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1008706108


##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/CreateProcessDemo.java:
##########
@@ -0,0 +1,41 @@
+package org.apache.dolphinscheduler.tools.demo;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.FilterType;
+import org.springframework.context.annotation.Profile;
+import org.springframework.stereotype.Component;
+
+@SpringBootApplication
+@ComponentScan(value = "org.apache.dolphinscheduler", excludeFilters = {
+        @ComponentScan.Filter(type = FilterType.REGEX, pattern = {
+                "org.apache.dolphinscheduler.tools.datasource.*",

Review Comment:
   Why need to exclude these?



##########
docs/configs/docsdev.js:
##########
@@ -1013,6 +1017,10 @@ export default {
                         title: '扩/缩容',
                         link: '/zh-cn/docs/dev/user_doc/guide/expansion-reduction.html',
                     },
+                    {
+                        title: '初始化工作流',

Review Comment:
   ```suggestion
                           title: 'Demo',
   ```



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProcessDefinitionDemo.java:
##########
@@ -0,0 +1,778 @@
+package org.apache.dolphinscheduler.tools.demo;
+
+import static org.apache.dolphinscheduler.common.enums.ConditionType.NONE;
+import static org.apache.dolphinscheduler.common.enums.Flag.YES;
+import static org.apache.dolphinscheduler.common.enums.Priority.MEDIUM;
+import static org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum.PARALLEL;
+
+import org.apache.dolphinscheduler.common.enums.TimeoutFlag;
+import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils;
+import org.apache.dolphinscheduler.common.utils.DateUtils;
+import org.apache.dolphinscheduler.common.utils.EncryptionUtils;
+import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import org.apache.dolphinscheduler.dao.entity.AccessToken;
+import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog;
+import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog;
+import org.apache.dolphinscheduler.dao.entity.Project;
+import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog;
+import org.apache.dolphinscheduler.dao.entity.User;
+import org.apache.dolphinscheduler.dao.mapper.AccessTokenMapper;
+import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
+import org.apache.dolphinscheduler.dao.mapper.UserMapper;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ProcessDefinitionDemo {
+
+    private static final Logger logger = LoggerFactory.getLogger(ProcessDefinitionDemo.class);
+
+    @Value("${demo.tenant-code}")
+    private String tenantCode;
+
+    @Autowired
+    private ProjectMapper projectMapper;
+
+    @Autowired
+    private UserMapper userMapper;
+
+    @Autowired
+    private AccessTokenMapper accessTokenMapper;
+
+    @Autowired
+    private ProxyProcessDefinitionController proxyProcessDefinitionController;
+
+    public void createProcessDefinitionDemo() throws Exception {
+        //get user
+        User loginUser = userMapper.selectById("1");
+        Date now = new Date();
+
+        //create demo tenantCode
+        CreateDemoTenant createDemoTenant = new CreateDemoTenant();
+        createDemoTenant.createTenantCode(tenantCode);
+
+        //create and get demo projectCode
+        Project project = projectMapper.queryByName("demo");
+        if (project != null) {
+            logger.warn("Project {} already exists.", project.getName());
+        }
+        try {
+            project = Project
+                .builder()
+                .name("demo")
+                .code(CodeGenerateUtils.getInstance().genCode())
+                .description("")
+                .userId(loginUser.getId())
+                .userName(loginUser.getUserName())
+                .createTime(now)
+                .updateTime(now)
+                .build();
+        } catch (CodeGenerateUtils.CodeGenerateException e) {
+            logger.error("create project error", e);
+        }
+        if (projectMapper.insert(project) > 0) {
+            logger.info("create project success");
+        } else {
+            throw new Exception("create project error");
+        }
+        Long projectCode = project.getCode();
+
+        // generate access token
+        String expireTime = "2050-09-30 15:59:23";
+        String token = EncryptionUtils.getMd5(1 + expireTime + System.currentTimeMillis());
+        AccessToken accessToken = new AccessToken();
+        accessToken.setUserId(1);
+        accessToken.setExpireTime(DateUtils.stringToDate(expireTime));
+        accessToken.setToken(token);
+        accessToken.setCreateTime(new Date());
+        accessToken.setUpdateTime(new Date());
+
+        int insert = accessTokenMapper.insert(accessToken);
+
+        if (insert > 0) {
+            logger.info("create access token success");
+        } else {
+            logger.info("create access token error");
+        }
+
+        //creat process definition demo
+        //shell demo
+        ProxyResult shellResult = shellDemo(token, projectCode, tenantCode);
+        logger.info("create shell demo " + shellResult.getMsg());

Review Comment:
   other same



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/CreateDemoTenant.java:
##########
@@ -0,0 +1,38 @@
+package org.apache.dolphinscheduler.tools.demo;
+
+import org.apache.dolphinscheduler.dao.entity.Tenant;
+import org.apache.dolphinscheduler.dao.mapper.TenantMapper;
+
+import java.util.Date;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class CreateDemoTenant {
+
+    private static final Logger logger = LoggerFactory.getLogger(CreateDemoTenant.class);
+    @Autowired
+    private TenantMapper tenantMapper;
+
+    public void createTenantCode(String tenantCode){
+        Date now = new Date();
+
+        if( !tenantCode.equals("default")){
+            Boolean existTenant = tenantMapper.existTenant(tenantCode);
+            if( !Boolean.TRUE.equals(existTenant) ){
+                Tenant tenant = new Tenant();
+                tenant.setTenantCode(tenantCode);
+                tenant.setQueueId(1);
+                tenant.setDescription("");
+                tenant.setCreateTime(now);
+                tenant.setUpdateTime(now);
+                // save
+                tenantMapper.insert(tenant);
+                logger.info("create tenant success");
+            }else {
+                logger.info("os tenant code already exists");

Review Comment:
   ```suggestion
                   logger.warn("os tenant code already exists");
   ```



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProcessDefinitionDemo.java:
##########
@@ -0,0 +1,778 @@
+package org.apache.dolphinscheduler.tools.demo;
+
+import static org.apache.dolphinscheduler.common.enums.ConditionType.NONE;
+import static org.apache.dolphinscheduler.common.enums.Flag.YES;
+import static org.apache.dolphinscheduler.common.enums.Priority.MEDIUM;
+import static org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum.PARALLEL;
+
+import org.apache.dolphinscheduler.common.enums.TimeoutFlag;
+import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils;
+import org.apache.dolphinscheduler.common.utils.DateUtils;
+import org.apache.dolphinscheduler.common.utils.EncryptionUtils;
+import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import org.apache.dolphinscheduler.dao.entity.AccessToken;
+import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog;
+import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog;
+import org.apache.dolphinscheduler.dao.entity.Project;
+import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog;
+import org.apache.dolphinscheduler.dao.entity.User;
+import org.apache.dolphinscheduler.dao.mapper.AccessTokenMapper;
+import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
+import org.apache.dolphinscheduler.dao.mapper.UserMapper;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ProcessDefinitionDemo {
+
+    private static final Logger logger = LoggerFactory.getLogger(ProcessDefinitionDemo.class);
+
+    @Value("${demo.tenant-code}")
+    private String tenantCode;
+
+    @Autowired
+    private ProjectMapper projectMapper;
+
+    @Autowired
+    private UserMapper userMapper;
+
+    @Autowired
+    private AccessTokenMapper accessTokenMapper;
+
+    @Autowired
+    private ProxyProcessDefinitionController proxyProcessDefinitionController;
+
+    public void createProcessDefinitionDemo() throws Exception {
+        //get user
+        User loginUser = userMapper.selectById("1");
+        Date now = new Date();
+
+        //create demo tenantCode
+        CreateDemoTenant createDemoTenant = new CreateDemoTenant();
+        createDemoTenant.createTenantCode(tenantCode);
+
+        //create and get demo projectCode
+        Project project = projectMapper.queryByName("demo");
+        if (project != null) {
+            logger.warn("Project {} already exists.", project.getName());
+        }
+        try {
+            project = Project
+                .builder()
+                .name("demo")
+                .code(CodeGenerateUtils.getInstance().genCode())
+                .description("")
+                .userId(loginUser.getId())
+                .userName(loginUser.getUserName())
+                .createTime(now)
+                .updateTime(now)
+                .build();
+        } catch (CodeGenerateUtils.CodeGenerateException e) {
+            logger.error("create project error", e);
+        }
+        if (projectMapper.insert(project) > 0) {
+            logger.info("create project success");
+        } else {
+            throw new Exception("create project error");
+        }
+        Long projectCode = project.getCode();
+
+        // generate access token
+        String expireTime = "2050-09-30 15:59:23";
+        String token = EncryptionUtils.getMd5(1 + expireTime + System.currentTimeMillis());
+        AccessToken accessToken = new AccessToken();
+        accessToken.setUserId(1);
+        accessToken.setExpireTime(DateUtils.stringToDate(expireTime));
+        accessToken.setToken(token);
+        accessToken.setCreateTime(new Date());
+        accessToken.setUpdateTime(new Date());
+
+        int insert = accessTokenMapper.insert(accessToken);
+
+        if (insert > 0) {
+            logger.info("create access token success");
+        } else {
+            logger.info("create access token error");
+        }
+
+        //creat process definition demo
+        //shell demo
+        ProxyResult shellResult = shellDemo(token, projectCode, tenantCode);
+        logger.info("create shell demo " + shellResult.getMsg());

Review Comment:
   ```suggestion
           logger.info("create shell demo {}", shellResult.getMsg());
   ```



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProcessDefinitionDemo.java:
##########
@@ -0,0 +1,778 @@
+package org.apache.dolphinscheduler.tools.demo;
+
+import static org.apache.dolphinscheduler.common.enums.ConditionType.NONE;
+import static org.apache.dolphinscheduler.common.enums.Flag.YES;
+import static org.apache.dolphinscheduler.common.enums.Priority.MEDIUM;
+import static org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum.PARALLEL;
+
+import org.apache.dolphinscheduler.common.enums.TimeoutFlag;
+import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils;
+import org.apache.dolphinscheduler.common.utils.DateUtils;
+import org.apache.dolphinscheduler.common.utils.EncryptionUtils;
+import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import org.apache.dolphinscheduler.dao.entity.AccessToken;
+import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog;
+import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog;
+import org.apache.dolphinscheduler.dao.entity.Project;
+import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog;
+import org.apache.dolphinscheduler.dao.entity.User;
+import org.apache.dolphinscheduler.dao.mapper.AccessTokenMapper;
+import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
+import org.apache.dolphinscheduler.dao.mapper.UserMapper;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ProcessDefinitionDemo {
+
+    private static final Logger logger = LoggerFactory.getLogger(ProcessDefinitionDemo.class);
+
+    @Value("${demo.tenant-code}")
+    private String tenantCode;
+
+    @Autowired
+    private ProjectMapper projectMapper;
+
+    @Autowired
+    private UserMapper userMapper;
+
+    @Autowired
+    private AccessTokenMapper accessTokenMapper;
+
+    @Autowired
+    private ProxyProcessDefinitionController proxyProcessDefinitionController;
+
+    public void createProcessDefinitionDemo() throws Exception {
+        //get user
+        User loginUser = userMapper.selectById("1");
+        Date now = new Date();
+
+        //create demo tenantCode
+        CreateDemoTenant createDemoTenant = new CreateDemoTenant();
+        createDemoTenant.createTenantCode(tenantCode);
+
+        //create and get demo projectCode
+        Project project = projectMapper.queryByName("demo");
+        if (project != null) {
+            logger.warn("Project {} already exists.", project.getName());
+        }
+        try {
+            project = Project
+                .builder()
+                .name("demo")
+                .code(CodeGenerateUtils.getInstance().genCode())
+                .description("")
+                .userId(loginUser.getId())
+                .userName(loginUser.getUserName())
+                .createTime(now)
+                .updateTime(now)
+                .build();
+        } catch (CodeGenerateUtils.CodeGenerateException e) {
+            logger.error("create project error", e);
+        }
+        if (projectMapper.insert(project) > 0) {
+            logger.info("create project success");
+        } else {
+            throw new Exception("create project error");
+        }
+        Long projectCode = project.getCode();
+
+        // generate access token
+        String expireTime = "2050-09-30 15:59:23";
+        String token = EncryptionUtils.getMd5(1 + expireTime + System.currentTimeMillis());
+        AccessToken accessToken = new AccessToken();
+        accessToken.setUserId(1);
+        accessToken.setExpireTime(DateUtils.stringToDate(expireTime));
+        accessToken.setToken(token);
+        accessToken.setCreateTime(new Date());
+        accessToken.setUpdateTime(new Date());
+
+        int insert = accessTokenMapper.insert(accessToken);
+
+        if (insert > 0) {
+            logger.info("create access token success");
+        } else {
+            logger.info("create access token error");
+        }
+
+        //creat process definition demo
+        //shell demo
+        ProxyResult shellResult = shellDemo(token, projectCode, tenantCode);
+        logger.info("create shell demo " + shellResult.getMsg());
+
+        //subprocess demo
+        LinkedHashMap<String, Object> subProcess = (LinkedHashMap<String, Object>) shellResult.getData();
+        String subProcessCode = String.valueOf(subProcess.get("code")) ;
+        ProxyResult subProcessResult = subProcessDemo (token, projectCode, tenantCode, subProcessCode);
+        logger.info("create subprocess demo " + subProcessResult.getMsg());
+
+        //switch demo
+        ProxyResult switchResult = swicthDemo (token, projectCode, tenantCode);
+        logger.info("create switch demo " + switchResult.getMsg());
+
+        //condition demo
+        ProxyResult conditionResult = conditionDemo (token, projectCode, tenantCode);
+        logger.info("create condition demo " + conditionResult.getMsg());
+
+        //dependent demo
+        LinkedHashMap<String, Object> switchProcess = (LinkedHashMap<String, Object>) switchResult.getData();
+        String switchProcessCode = String.valueOf(switchProcess.get("code")) ;
+        ProxyResult dependentResult = dependentProxyResultDemo (token, projectCode, tenantCode, subProcessCode, switchProcessCode);
+        logger.info("create dependent demo " + dependentResult.getMsg());
+
+        //parameter context demo
+        ProxyResult parameterContextResult = parameterContextDemo (token, projectCode, tenantCode);
+        logger.info("create parameter context demo " + parameterContextResult.getMsg());
+
+        //clear log demo
+        ProxyResult clearLogResult = clearLogDemo (token, projectCode, tenantCode);
+        logger.info("create clear log demo " + clearLogResult.getMsg());
+
+    }
+
+    public ProxyResult clearLogDemo(String token, long projectCode, String tenantCode){
+
+        //get demo taskcode
+        List<Long> taskCodes = new ArrayList<>();
+        try {
+            for (int i = 0; i < 1; i++) {
+                taskCodes.add(CodeGenerateUtils.getInstance().genCode());
+            }
+        } catch (CodeGenerateUtils.CodeGenerateException e) {
+            logger.error("task code get error, ", e);
+        }
+        String taskCodeFirst = String.valueOf(taskCodes.get(0)).replaceAll("\\[|\\]", "");
+        String absolutePath = System.getProperty("user.dir");
+
+        ProcessDefinitionLog processDefinitionLog = new ProcessDefinitionLog();
+        processDefinitionLog.setName("demo_clear_log");
+        processDefinitionLog.setDescription("Clear the DS log files from 30 days ago");
+        processDefinitionLog.setGlobalParams("[]");
+        processDefinitionLog.setLocations(DemoContants.CLEAR_LOG_locations[0] + taskCodeFirst + DemoContants.CLEAR_LOG_locations[1]);
+        processDefinitionLog.setTimeout(0);
+
+        List<ProcessTaskRelationLog> processTaskRelationLogs = new ArrayList<>();
+        for (int i = 0; i < 1; i++) {
+            ProcessTaskRelationLog processTaskRelationLog = new ProcessTaskRelationLog();
+            processTaskRelationLog.setName("");
+            processTaskRelationLog.setConditionType(NONE);
+            processTaskRelationLog.setConditionParams("{}");
+            processTaskRelationLogs.add(processTaskRelationLog);
+        }
+        ProcessTaskRelationLog processTaskRelationLogFirst = processTaskRelationLogs.get(0);
+        processTaskRelationLogFirst.setPreTaskCode(0);
+        processTaskRelationLogFirst.setPreTaskVersion(0);
+        processTaskRelationLogFirst.setPostTaskCode(taskCodes.get(0));
+        processTaskRelationLogFirst.setPostTaskVersion(1);
+
+        String taskRelationJson = JSONUtils.toJsonString(processTaskRelationLogs);
+
+        List<TaskDefinitionLog> taskDefinitionLogs = new ArrayList<>();
+        for (int i = 0; i < 1; i++) {
+            TaskDefinitionLog taskDefinitionLog = new TaskDefinitionLog();
+            taskDefinitionLog.setFlag(YES);
+            taskDefinitionLog.setDelayTime(0);
+            taskDefinitionLog.setEnvironmentCode(-1);
+            taskDefinitionLog.setFailRetryInterval(1);
+            taskDefinitionLog.setFailRetryTimes(0);
+            taskDefinitionLog.setTaskPriority(MEDIUM);
+            taskDefinitionLog.setTimeout(0);
+            taskDefinitionLog.setTimeoutFlag(TimeoutFlag.CLOSE);
+            taskDefinitionLog.setTimeoutNotifyStrategy(null);
+            taskDefinitionLog.setWorkerGroup("default");
+            taskDefinitionLog.setTaskType("SHELL");
+            taskDefinitionLogs.add(taskDefinitionLog);
+        }
+        TaskDefinitionLog taskDefinitionLogFirst = taskDefinitionLogs.get(0);
+        taskDefinitionLogFirst.setCode(taskCodes.get(0));
+        taskDefinitionLogFirst.setName("Clear log node");
+        taskDefinitionLogFirst.setDescription("");
+        taskDefinitionLogFirst.setTaskParams("{\"localParams\":[],\"rawScript\":\"cd cd " + absolutePath + "\\r\\nfind ./logs/ -mtime +30 -name \\\"*.log\\\" -exec rm -rf {} \\\\;\",\"resourceList\":[]}");
+
+        String taskDefinitionJson = JSONUtils.toJsonString(taskDefinitionLogs);
+
+        ProxyResult ProxyResult = proxyProcessDefinitionController.createProcessDefinition(token, projectCode,
+            processDefinitionLog.getName(),
+            processDefinitionLog.getDescription(),
+            processDefinitionLog.getGlobalParams(),
+            processDefinitionLog.getLocations(),
+            processDefinitionLog.getTimeout(),
+            tenantCode,
+            taskRelationJson,
+            taskDefinitionJson,
+            PARALLEL);
+        return ProxyResult;
+    }
+    public ProxyResult dependentProxyResultDemo(String token, long projectCode, String tenantCode, String shellProcessCode, String switchProcessCode){
+
+        //get demo taskcode
+        List<Long> taskCodes = new ArrayList<>();
+        try {
+            for (int i = 0; i < 2; i++) {
+                taskCodes.add(CodeGenerateUtils.getInstance().genCode());
+            }
+        } catch (CodeGenerateUtils.CodeGenerateException e) {
+            logger.error("task code get error, ", e);
+        }
+        String taskCodeFirst = String.valueOf(taskCodes.get(0)).replaceAll("\\[|\\]", "");
+        String taskCodeSecond = String.valueOf(taskCodes.get(1)).replaceAll("\\[|\\]", "");
+
+        ProcessDefinitionLog processDefinitionLog = new ProcessDefinitionLog();
+        processDefinitionLog.setName("demo_dependent");
+        processDefinitionLog.setDescription("Check the completion of daily tasks");
+        processDefinitionLog.setGlobalParams("[]");
+        processDefinitionLog.setLocations(DemoContants.DEPENDENT_locations[0] + taskCodeFirst + DemoContants.DEPENDENT_locations[1] + taskCodeSecond + DemoContants.DEPENDENT_locations[2]);
+        processDefinitionLog.setTimeout(0);
+
+        List<ProcessTaskRelationLog> processTaskRelationLogs = new ArrayList<>();
+        for (int i = 0; i < 2; i++) {
+            ProcessTaskRelationLog processTaskRelationLog = new ProcessTaskRelationLog();
+            processTaskRelationLog.setName("");
+            processTaskRelationLog.setConditionType(NONE);
+            processTaskRelationLog.setConditionParams("{}");
+            processTaskRelationLogs.add(processTaskRelationLog);
+        }
+        ProcessTaskRelationLog processTaskRelationLogFirst = processTaskRelationLogs.get(0);
+        processTaskRelationLogFirst.setPreTaskCode(0);
+        processTaskRelationLogFirst.setPreTaskVersion(0);
+        processTaskRelationLogFirst.setPostTaskCode(taskCodes.get(0));
+        processTaskRelationLogFirst.setPostTaskVersion(1);
+
+        ProcessTaskRelationLog processTaskRelationLogSecond = processTaskRelationLogs.get(1);
+        processTaskRelationLogSecond.setPreTaskCode(taskCodes.get(0));
+        processTaskRelationLogSecond.setPreTaskVersion(1);
+        processTaskRelationLogSecond.setPostTaskCode(taskCodes.get(1));
+        processTaskRelationLogSecond.setPostTaskVersion(1);
+
+        String taskRelationJson = JSONUtils.toJsonString(processTaskRelationLogs);
+
+        List<TaskDefinitionLog> taskDefinitionLogs = new ArrayList<>();
+        for (int i = 0; i < 2; i++) {
+            TaskDefinitionLog taskDefinitionLog = new TaskDefinitionLog();
+            taskDefinitionLog.setFlag(YES);
+            taskDefinitionLog.setDelayTime(0);
+            taskDefinitionLog.setEnvironmentCode(-1);
+            taskDefinitionLog.setFailRetryInterval(1);
+            taskDefinitionLog.setFailRetryTimes(0);
+            taskDefinitionLog.setTaskPriority(MEDIUM);
+            taskDefinitionLog.setTimeout(0);
+            taskDefinitionLog.setTimeoutFlag(TimeoutFlag.CLOSE);
+            taskDefinitionLog.setTimeoutNotifyStrategy(null);
+            taskDefinitionLog.setWorkerGroup("default");
+            taskDefinitionLogs.add(taskDefinitionLog);
+        }
+        TaskDefinitionLog taskDefinitionLogFirst = taskDefinitionLogs.get(0);
+        taskDefinitionLogFirst.setCode(taskCodes.get(0));
+        taskDefinitionLogFirst.setName("Weekly report task");
+        taskDefinitionLogFirst.setDescription("The weekly report task requires the demo_shell and demo_switch tasks to be successfully executed every day of the last week");
+        taskDefinitionLogFirst.setTaskParams("{\"localParams\":[],\"resourceList\":[],\"dependence\":{\"relation\":\"AND\",\"dependTaskList\":[{\"relation\":\"AND\",\"dependItemList\":[{\"projectCode\":"+projectCode+",\"definitionCode\":"+shellProcessCode+",\"depTaskCode\":0,\"cycle\":\"day\",\"dateValue\":\"last1Days\",\"state\":null},{\"projectCode\":"+projectCode+",\"definitionCode\":"+switchProcessCode+",\"depTaskCode\":0,\"cycle\":\"day\",\"dateValue\":\"last1Days\",\"state\":null}]}]}}");
+        taskDefinitionLogFirst.setTaskType("DEPENDENT");
+
+        TaskDefinitionLog taskDefinitionLogSecond = taskDefinitionLogs.get(1);
+        taskDefinitionLogSecond.setCode(taskCodes.get(1));
+        taskDefinitionLogSecond.setName("Weekly Report Task Result");
+        taskDefinitionLogSecond.setDescription("Result report after the completion of the weekly report task");
+        taskDefinitionLogSecond.setTaskParams("{\"localParams\":[],\"rawScript\":\"echo \\\"end of report\\\"\",\"resourceList\":[]}");
+        taskDefinitionLogSecond.setTaskType("SHELL");
+        String taskDefinitionJson = JSONUtils.toJsonString(taskDefinitionLogs);
+
+        ProxyResult ProxyResult = proxyProcessDefinitionController.createProcessDefinition(token, projectCode,
+            processDefinitionLog.getName(),
+            processDefinitionLog.getDescription(),
+            processDefinitionLog.getGlobalParams(),
+            processDefinitionLog.getLocations(),
+            processDefinitionLog.getTimeout(),
+            tenantCode,
+            taskRelationJson,
+            taskDefinitionJson,
+            PARALLEL);
+        return ProxyResult;
+    }
+    public ProxyResult parameterContextDemo(String token, long projectCode, String tenantCode){
+
+        //get demo taskcode
+        List<Long> taskCodes = new ArrayList<>();
+        try {
+            for (int i = 0; i < 2; i++) {
+                taskCodes.add(CodeGenerateUtils.getInstance().genCode());
+            }
+        } catch (CodeGenerateUtils.CodeGenerateException e) {
+            logger.error("task code get error, ", e);
+        }
+        String taskCodeFirst = String.valueOf(taskCodes.get(0)).replaceAll("\\[|\\]", "");
+        String taskCodeSecond = String.valueOf(taskCodes.get(1)).replaceAll("\\[|\\]", "");
+
+        ProcessDefinitionLog processDefinitionLog = new ProcessDefinitionLog();
+        processDefinitionLog.setName("demo_parameter_context");
+        processDefinitionLog.setDescription("Upstream and downstream task node parameter transfer");
+        processDefinitionLog.setGlobalParams(DemoContants.PARAMETER_CONTEXT_PARAMS);
+        processDefinitionLog.setLocations(DemoContants.PARAMETER_CONTEXT_locations[0] + taskCodeFirst + DemoContants.PARAMETER_CONTEXT_locations[1] + taskCodeSecond + DemoContants.PARAMETER_CONTEXT_locations[2]);
+        processDefinitionLog.setTimeout(0);
+
+        List<ProcessTaskRelationLog> processTaskRelationLogs = new ArrayList<>();
+        for (int i = 0; i < 2; i++) {
+            ProcessTaskRelationLog processTaskRelationLog = new ProcessTaskRelationLog();
+            processTaskRelationLog.setName("");
+            processTaskRelationLog.setConditionType(NONE);
+            processTaskRelationLog.setConditionParams("{}");
+            processTaskRelationLogs.add(processTaskRelationLog);
+        }
+        ProcessTaskRelationLog processTaskRelationLogFirst = processTaskRelationLogs.get(0);
+        processTaskRelationLogFirst.setPreTaskCode(0);
+        processTaskRelationLogFirst.setPreTaskVersion(0);
+        processTaskRelationLogFirst.setPostTaskCode(taskCodes.get(0));
+        processTaskRelationLogFirst.setPostTaskVersion(1);
+
+        ProcessTaskRelationLog processTaskRelationLogSecond = processTaskRelationLogs.get(1);
+        processTaskRelationLogSecond.setPreTaskCode(taskCodes.get(0));
+        processTaskRelationLogSecond.setPreTaskVersion(1);
+        processTaskRelationLogSecond.setPostTaskCode(taskCodes.get(1));
+        processTaskRelationLogSecond.setPostTaskVersion(1);
+
+        String taskRelationJson = JSONUtils.toJsonString(processTaskRelationLogs);
+
+        List<TaskDefinitionLog> taskDefinitionLogs = new ArrayList<>();
+        for (int i = 0; i < 2; i++) {
+            TaskDefinitionLog taskDefinitionLog = new TaskDefinitionLog();
+            taskDefinitionLog.setFlag(YES);
+            taskDefinitionLog.setDelayTime(0);
+            taskDefinitionLog.setEnvironmentCode(-1);
+            taskDefinitionLog.setFailRetryInterval(1);
+            taskDefinitionLog.setFailRetryTimes(0);
+            taskDefinitionLog.setTaskPriority(MEDIUM);
+            taskDefinitionLog.setTimeout(0);
+            taskDefinitionLog.setTimeoutFlag(TimeoutFlag.CLOSE);
+            taskDefinitionLog.setTimeoutNotifyStrategy(null);
+            taskDefinitionLog.setWorkerGroup("default");
+            taskDefinitionLog.setTaskType("SHELL");
+            taskDefinitionLogs.add(taskDefinitionLog);
+        }
+        TaskDefinitionLog taskDefinitionLogFirst = taskDefinitionLogs.get(0);
+        taskDefinitionLogFirst.setCode(taskCodes.get(0));
+        taskDefinitionLogFirst.setName("Upstream task node");
+        taskDefinitionLogFirst.setDescription("Create a local parameter and pass the assignment to the downstream");
+        taskDefinitionLogFirst.setTaskParams("{\"localParams\":[{\"prop\":\"value\",\"direct\":\"IN\",\"type\":\"VARCHAR\",\"value\":\"0\"},{\"prop\":\"output\",\"direct\":\"OUT\",\"type\":\"VARCHAR\",\"value\":\"\"}],\"rawScript\":\"echo \\\"====Node start====\\\"\\r\\necho '${setValue(output=1)}'\\r\\n\\r\\necho ${output}\\r\\necho ${value}\\r\\n\\r\\necho \\\"====Node end====\\\"\",\"resourceList\":[]}");
+
+        TaskDefinitionLog taskDefinitionLogSecond = taskDefinitionLogs.get(1);
+        taskDefinitionLogSecond.setCode(taskCodes.get(1));
+        taskDefinitionLogSecond.setName("Downstream task node");
+        taskDefinitionLogSecond.setDescription("Test outputs the parameters passed by the upstream task");
+        taskDefinitionLogSecond.setTaskParams("{\"localParams\":[],\"rawScript\":\"echo \\\"====node start====\\\"\\r\\n\\r\\necho ${output}\\r\\n\\r\\necho ${value}\\r\\n\\r\\necho \\\"====Node end====\\\"\",\"resourceList\":[]}");
+        String taskDefinitionJson = JSONUtils.toJsonString(taskDefinitionLogs);
+
+        ProxyResult ProxyResult = proxyProcessDefinitionController.createProcessDefinition(token, projectCode,
+            processDefinitionLog.getName(),
+            processDefinitionLog.getDescription(),
+            processDefinitionLog.getGlobalParams(),
+            processDefinitionLog.getLocations(),
+            processDefinitionLog.getTimeout(),
+            tenantCode,
+            taskRelationJson,
+            taskDefinitionJson,
+            PARALLEL);
+        return ProxyResult;
+    }
+    public ProxyResult conditionDemo(String token, long projectCode, String tenantCode){
+
+        //get demo taskcode
+        List<Long> taskCodes = new ArrayList<>();
+        try {
+            for (int i = 0; i < 4; i++) {
+                taskCodes.add(CodeGenerateUtils.getInstance().genCode());
+            }
+        } catch (CodeGenerateUtils.CodeGenerateException e) {
+            logger.error("task code get error, ", e);
+        }
+        String taskCodeFirst = String.valueOf(taskCodes.get(0)).replaceAll("\\[|\\]", "");
+        String taskCodeSecond = String.valueOf(taskCodes.get(1)).replaceAll("\\[|\\]", "");
+        String taskCodeThird = String.valueOf(taskCodes.get(2)).replaceAll("\\[|\\]", "");
+        String taskCodeFourth = String.valueOf(taskCodes.get(3)).replaceAll("\\[|\\]", "");
+
+        ProcessDefinitionLog processDefinitionLog = new ProcessDefinitionLog();
+        processDefinitionLog.setName("demo_condition");
+        processDefinitionLog.setDescription("Coin Toss");
+        processDefinitionLog.setGlobalParams("[]");
+        processDefinitionLog.setLocations(DemoContants.CONDITION_locations[0] + taskCodeFirst + DemoContants.CONDITION_locations[1] + taskCodeSecond + DemoContants.CONDITION_locations[2] + taskCodeThird + DemoContants.CONDITION_locations[3] + taskCodeFourth + DemoContants.CONDITION_locations[4]);
+        processDefinitionLog.setTimeout(0);
+
+        List<ProcessTaskRelationLog> processTaskRelationLogs = new ArrayList<>();
+        for (int i = 0; i < 4; i++) {
+            ProcessTaskRelationLog processTaskRelationLog = new ProcessTaskRelationLog();
+            processTaskRelationLog.setName("");
+            processTaskRelationLog.setConditionType(NONE);
+            processTaskRelationLog.setConditionParams("{}");
+            processTaskRelationLogs.add(processTaskRelationLog);
+        }
+        ProcessTaskRelationLog processTaskRelationLogFirst = processTaskRelationLogs.get(0);
+        processTaskRelationLogFirst.setPreTaskCode(0);
+        processTaskRelationLogFirst.setPreTaskVersion(0);
+        processTaskRelationLogFirst.setPostTaskCode(taskCodes.get(1));
+        processTaskRelationLogFirst.setPostTaskVersion(1);
+
+        ProcessTaskRelationLog processTaskRelationLogSecond = processTaskRelationLogs.get(1);
+        processTaskRelationLogSecond.setPreTaskCode(taskCodes.get(0));
+        processTaskRelationLogSecond.setPreTaskVersion(1);
+        processTaskRelationLogSecond.setPostTaskCode(taskCodes.get(2));
+        processTaskRelationLogSecond.setPostTaskVersion(1);
+
+        ProcessTaskRelationLog processTaskRelationLogThird = processTaskRelationLogs.get(2);
+        processTaskRelationLogThird.setPreTaskCode(taskCodes.get(0));
+        processTaskRelationLogThird.setPreTaskVersion(1);
+        processTaskRelationLogThird.setPostTaskCode(taskCodes.get(3));
+        processTaskRelationLogThird.setPostTaskVersion(1);
+
+        ProcessTaskRelationLog processTaskRelationLogFourth = processTaskRelationLogs.get(3);
+        processTaskRelationLogFourth.setPreTaskCode(taskCodes.get(1));
+        processTaskRelationLogFourth.setPreTaskVersion(1);
+        processTaskRelationLogFourth.setPostTaskCode(taskCodes.get(0));
+        processTaskRelationLogFourth.setPostTaskVersion(1);
+        String taskRelationJson = JSONUtils.toJsonString(processTaskRelationLogs);
+
+        List<TaskDefinitionLog> taskDefinitionLogs = new ArrayList<>();
+        for (int i = 0; i < 4; i++) {
+            TaskDefinitionLog taskDefinitionLog = new TaskDefinitionLog();
+            taskDefinitionLog.setFlag(YES);
+            taskDefinitionLog.setDelayTime(0);
+            taskDefinitionLog.setEnvironmentCode(-1);
+            taskDefinitionLog.setFailRetryInterval(1);
+            taskDefinitionLog.setFailRetryTimes(0);
+            taskDefinitionLog.setTaskPriority(MEDIUM);
+            taskDefinitionLog.setTimeout(0);
+            taskDefinitionLog.setTimeoutFlag(TimeoutFlag.CLOSE);
+            taskDefinitionLog.setTimeoutNotifyStrategy(null);
+            taskDefinitionLog.setWorkerGroup("default");
+            taskDefinitionLogs.add(taskDefinitionLog);
+        }
+        TaskDefinitionLog taskDefinitionLogFirst = taskDefinitionLogs.get(0);
+        taskDefinitionLogFirst.setCode(taskCodes.get(0));
+        taskDefinitionLogFirst.setName("condition");
+        taskDefinitionLogFirst.setDescription("head is the status of success, tail is the status of failure");
+        taskDefinitionLogFirst.setTaskParams("{\"localParams\":[],\"resourceList\":[],\"dependence\":{\"relation\":\"AND\",\"dependTaskList\":[]},\"conditionResult\":{\"successNode\":["+taskCodeThird+"],\"failedNode\":["+taskCodeFourth+"]}}");
+        taskDefinitionLogFirst.setTaskType("CONDITIONS");
+
+        TaskDefinitionLog taskDefinitionLogSecond = taskDefinitionLogs.get(1);
+        taskDefinitionLogSecond.setCode(taskCodes.get(1));
+        taskDefinitionLogSecond.setName("coin");
+        taskDefinitionLogSecond.setDescription("Toss a coin");
+        taskDefinitionLogSecond.setTaskParams("{\"localParams\":[],\"rawScript\":\"echo \\\"Start\\\"\",\"resourceList\":[]}");
+        taskDefinitionLogSecond.setTaskType("SHELL");
+
+        TaskDefinitionLog taskDefinitionLogThird = taskDefinitionLogs.get(2);
+        taskDefinitionLogThird.setCode(taskCodes.get(2));
+        taskDefinitionLogThird.setName("head");
+        taskDefinitionLogThird.setDescription("Choose to learn if the result is head");
+        taskDefinitionLogThird.setTaskParams("{\"localParams\":[],\"rawScript\":\"echo \\\"Start learning\\\"\",\"resourceList\":[]}");
+        taskDefinitionLogThird.setTaskType("SHELL");
+
+        TaskDefinitionLog taskDefinitionLogFourth = taskDefinitionLogs.get(3);
+        taskDefinitionLogFourth.setCode(taskCodes.get(3));
+        taskDefinitionLogFourth.setName("tail");
+        taskDefinitionLogFourth.setDescription("Choose to play if the result is tail");
+        taskDefinitionLogFourth.setTaskParams("{\"localParams\":[],\"rawScript\":\"echo \\\"Start playing\\\"\",\"resourceList\":[]}");
+        taskDefinitionLogFourth.setTaskType("SHELL");
+        String taskDefinitionJson = JSONUtils.toJsonString(taskDefinitionLogs);
+
+        ProxyResult ProxyResult = proxyProcessDefinitionController.createProcessDefinition(token, projectCode,
+            processDefinitionLog.getName(),
+            processDefinitionLog.getDescription(),
+            processDefinitionLog.getGlobalParams(),
+            processDefinitionLog.getLocations(),
+            processDefinitionLog.getTimeout(),
+            tenantCode,
+            taskRelationJson,
+            taskDefinitionJson,
+            PARALLEL);
+        return ProxyResult;
+    }
+    public ProxyResult swicthDemo(String token, long projectCode, String tenantCode){
+
+        //get demo taskcode
+        List<Long> taskCodes = new ArrayList<>();
+        try {
+            for (int i = 0; i < 4; i++) {
+                taskCodes.add(CodeGenerateUtils.getInstance().genCode());
+            }
+        } catch (CodeGenerateUtils.CodeGenerateException e) {
+            logger.error("task code get error, ", e);
+        }
+        String taskCodeFirst = String.valueOf(taskCodes.get(0)).replaceAll("\\[|\\]", "");
+        String taskCodeSecond = String.valueOf(taskCodes.get(1)).replaceAll("\\[|\\]", "");
+        String taskCodeThird = String.valueOf(taskCodes.get(2)).replaceAll("\\[|\\]", "");
+        String taskCodeFourth = String.valueOf(taskCodes.get(3)).replaceAll("\\[|\\]", "");
+
+        ProcessDefinitionLog processDefinitionLog = new ProcessDefinitionLog();
+        processDefinitionLog.setName("demo_switch");
+        processDefinitionLog.setDescription("Determine which task to perform based on conditions");
+        processDefinitionLog.setGlobalParams(DemoContants.SWITCH_GLOBAL_PARAMS);
+        processDefinitionLog.setLocations(DemoContants.SWITCH_locations[0] + taskCodeFirst + DemoContants.SWITCH_locations[1] + taskCodeSecond + DemoContants.SWITCH_locations[2] + taskCodeThird + DemoContants.SWITCH_locations[3] + taskCodeFourth + DemoContants.SWITCH_locations[4]);
+        processDefinitionLog.setTimeout(0);
+
+        List<ProcessTaskRelationLog> processTaskRelationLogs = new ArrayList<>();
+        for (int i = 0; i < 4; i++) {
+            ProcessTaskRelationLog processTaskRelationLog = new ProcessTaskRelationLog();
+            processTaskRelationLog.setName("");
+            processTaskRelationLog.setConditionType(NONE);
+            processTaskRelationLog.setConditionParams("{}");
+            processTaskRelationLogs.add(processTaskRelationLog);
+        }
+        ProcessTaskRelationLog processTaskRelationLogFirst = processTaskRelationLogs.get(0);
+        processTaskRelationLogFirst.setPreTaskCode(0);
+        processTaskRelationLogFirst.setPreTaskVersion(0);
+        processTaskRelationLogFirst.setPostTaskCode(taskCodes.get(0));
+        processTaskRelationLogFirst.setPostTaskVersion(1);
+
+        ProcessTaskRelationLog processTaskRelationLogSecond = processTaskRelationLogs.get(1);
+        processTaskRelationLogSecond.setPreTaskCode(taskCodes.get(0));
+        processTaskRelationLogSecond.setPreTaskVersion(1);
+        processTaskRelationLogSecond.setPostTaskCode(taskCodes.get(1));
+        processTaskRelationLogSecond.setPostTaskVersion(1);
+
+        ProcessTaskRelationLog processTaskRelationLogThird = processTaskRelationLogs.get(2);
+        processTaskRelationLogThird.setPreTaskCode(taskCodes.get(0));
+        processTaskRelationLogThird.setPreTaskVersion(1);
+        processTaskRelationLogThird.setPostTaskCode(taskCodes.get(2));
+        processTaskRelationLogThird.setPostTaskVersion(1);
+
+        ProcessTaskRelationLog processTaskRelationLogFourth = processTaskRelationLogs.get(3);
+        processTaskRelationLogFourth.setPreTaskCode(taskCodes.get(0));
+        processTaskRelationLogFourth.setPreTaskVersion(1);
+        processTaskRelationLogFourth.setPostTaskCode(taskCodes.get(3));
+        processTaskRelationLogFourth.setPostTaskVersion(1);
+        String taskRelationJson = JSONUtils.toJsonString(processTaskRelationLogs);
+
+        List<TaskDefinitionLog> taskDefinitionLogs = new ArrayList<>();
+        for (int i = 0; i < 4; i++) {
+            TaskDefinitionLog taskDefinitionLog = new TaskDefinitionLog();
+            taskDefinitionLog.setFlag(YES);
+            taskDefinitionLog.setDelayTime(0);
+            taskDefinitionLog.setEnvironmentCode(-1);
+            taskDefinitionLog.setFailRetryInterval(1);
+            taskDefinitionLog.setFailRetryTimes(0);
+            taskDefinitionLog.setTaskPriority(MEDIUM);
+            taskDefinitionLog.setTimeout(0);
+            taskDefinitionLog.setTimeoutFlag(TimeoutFlag.CLOSE);
+            taskDefinitionLog.setTimeoutNotifyStrategy(null);
+            taskDefinitionLog.setWorkerGroup("default");
+            taskDefinitionLogs.add(taskDefinitionLog);
+        }
+        TaskDefinitionLog taskDefinitionLogFirst = taskDefinitionLogs.get(0);
+        taskDefinitionLogFirst.setCode(taskCodes.get(0));
+        taskDefinitionLogFirst.setName("switch node");
+        taskDefinitionLogFirst.setDescription("The global parameter is to execute TaskA for A, and for B to execute TaskB, otherwise the default task is executed");
+        taskDefinitionLogFirst.setTaskParams("{\"localParams\":[],\"rawScript\":\"\",\"resourceList\":[],\"switchResult\":{\"dependTaskList\":[{\"condition\":\"${switchValue} == \\\"A\\\"\",\"nextNode\":" + taskCodeThird + "},{\"condition\":\"${switchValue} == \\\"B\\\"\",\"nextNode\":"+ taskCodeFourth + "}],\"nextNode\":"+taskCodeSecond+"}}");
+        taskDefinitionLogFirst.setTaskType("SWITCH");
+
+        TaskDefinitionLog taskDefinitionLogSecond = taskDefinitionLogs.get(1);
+        taskDefinitionLogSecond.setCode(taskCodes.get(1));
+        taskDefinitionLogSecond.setName("default");
+        taskDefinitionLogSecond.setDescription("executed default task");
+        taskDefinitionLogSecond.setTaskParams("{\"localParams\":[],\"rawScript\":\"echo \\\"default\\\"\",\"resourceList\":[]}");
+        taskDefinitionLogSecond.setTaskType("SHELL");
+
+        TaskDefinitionLog taskDefinitionLogThird = taskDefinitionLogs.get(2);
+        taskDefinitionLogThird.setCode(taskCodes.get(2));
+        taskDefinitionLogThird.setName("TaskA");
+        taskDefinitionLogThird.setDescription("execute TaskA");
+        taskDefinitionLogThird.setTaskParams("{\"localParams\":[],\"rawScript\":\"echo \\\"TaskA\\\"\",\"resourceList\":[]}");
+        taskDefinitionLogThird.setTaskType("SHELL");
+
+        TaskDefinitionLog taskDefinitionLogFourth = taskDefinitionLogs.get(3);
+        taskDefinitionLogFourth.setCode(taskCodes.get(3));
+        taskDefinitionLogFourth.setName("TaskB");
+        taskDefinitionLogFourth.setDescription("execute TaskB");
+        taskDefinitionLogFourth.setTaskParams("{\"localParams\":[],\"rawScript\":\"echo \\\"TaskB\\\"\",\"resourceList\":[]}");
+        taskDefinitionLogFourth.setTaskType("SHELL");
+        String taskDefinitionJson = JSONUtils.toJsonString(taskDefinitionLogs);
+
+        ProxyResult ProxyResult = proxyProcessDefinitionController.createProcessDefinition(token, projectCode,
+            processDefinitionLog.getName(),
+            processDefinitionLog.getDescription(),
+            processDefinitionLog.getGlobalParams(),
+            processDefinitionLog.getLocations(),
+            processDefinitionLog.getTimeout(),
+            tenantCode,
+            taskRelationJson,
+            taskDefinitionJson,
+            PARALLEL);
+        return ProxyResult;
+    }
+    public ProxyResult shellDemo(String token, long projectCode, String tenantCode){
+
+        //get demo taskcode
+        List<Long> taskCodes = new ArrayList<>();
+        try {
+            for (int i = 0; i < 3; i++) {
+                taskCodes.add(CodeGenerateUtils.getInstance().genCode());
+            }
+        } catch (CodeGenerateUtils.CodeGenerateException e) {
+            logger.error("task code get error, ", e);
+        }
+        String taskCodeFirst = String.valueOf(taskCodes.get(0)).replaceAll("\\[|\\]", "");
+        String taskCodeSecond = String.valueOf(taskCodes.get(1)).replaceAll("\\[|\\]", "");
+        String taskCodeThird = String.valueOf(taskCodes.get(2)).replaceAll("\\[|\\]", "");
+
+        ProcessDefinitionLog processDefinitionLog = new ProcessDefinitionLog();
+        processDefinitionLog.setName("demo_shell");
+        processDefinitionLog.setDescription("Production, processing and sales of a series of processes");
+        processDefinitionLog.setGlobalParams(DemoContants.SHELL_GLOBAL_PARAMS);
+        processDefinitionLog.setLocations(DemoContants.SHELL_locations[0] + taskCodeFirst + DemoContants.SHELL_locations[1] + taskCodeSecond + DemoContants.SHELL_locations[2] + taskCodeThird + DemoContants.SHELL_locations[3]);

Review Comment:
   When location is null, it will auto format in the UI.
   So we don't need to set location here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1288580093

   > I have an other suggestion about add example workflow for DolphinScheduler, using Python API. It is already have example in more of the task type, and it define with code, most likely to ORM instead of sql or json object, which is more stable and maintainable.
   > 
   > all we have to do is add a new docker image, and run all examples in Python API to export all example to target database, or directly install python api and run all examples. do you guys think that will be a better solution?
   
   May I ask you how to do it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1009160148


##########
dolphinscheduler-tools/src/main/bin/demo-start.sh:
##########
@@ -0,0 +1,31 @@
+#!/bin/bash

Review Comment:
   Has been modified



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1009343371


##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProxyResult.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * 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.tools.demo;
+
+public class ProxyResult<T> {

Review Comment:
   > The comments are not addressed but you click resolve conversation, please fix or reply if you think it's wrong. Don't simply mark it as resolved.
   OK, I'll try to modify this
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] codecov-commenter commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1296253856

   # [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/11759?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#11759](https://codecov.io/gh/apache/dolphinscheduler/pull/11759?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a0a1193) into [dev](https://codecov.io/gh/apache/dolphinscheduler/commit/77e29b59b239f651bb275ef494f75b889bd3125f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (77e29b5) will **decrease** coverage by `0.57%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##                dev   #11759      +/-   ##
   ============================================
   - Coverage     39.61%   39.04%   -0.58%     
     Complexity     4192     4192              
   ============================================
     Files          1038     1044       +6     
     Lines         38843    39480     +637     
     Branches       4447     4521      +74     
   ============================================
   + Hits          15387    15414      +27     
   - Misses        21712    22314     +602     
   - Partials       1744     1752       +8     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dolphinscheduler/pull/11759?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...che/dolphinscheduler/common/utils/OkHttpUtils.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11759/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL3V0aWxzL09rSHR0cFV0aWxzLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...method/HttpLoopTaskCancelTaskMethodDefinition.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11759/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci10YXNrLXBsdWdpbi9kb2xwaGluc2NoZWR1bGVyLXRhc2stYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kb2xwaGluc2NoZWR1bGVyL3BsdWdpbi90YXNrL2FwaS9sb29wL3RlbXBsYXRlL2h0dHAvbWV0aG9kL0h0dHBMb29wVGFza0NhbmNlbFRhc2tNZXRob2REZWZpbml0aW9uLmphdmE=) | `0.00% <ø> (ø)` | |
   | [...ethod/HttpLoopTaskQueryStatusMethodDefinition.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11759/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci10YXNrLXBsdWdpbi9kb2xwaGluc2NoZWR1bGVyLXRhc2stYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kb2xwaGluc2NoZWR1bGVyL3BsdWdpbi90YXNrL2FwaS9sb29wL3RlbXBsYXRlL2h0dHAvbWV0aG9kL0h0dHBMb29wVGFza1F1ZXJ5U3RhdHVzTWV0aG9kRGVmaW5pdGlvbi5qYXZh) | `0.00% <ø> (ø)` | |
   | [...method/HttpLoopTaskSubmitTaskMethodDefinition.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11759/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci10YXNrLXBsdWdpbi9kb2xwaGluc2NoZWR1bGVyLXRhc2stYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kb2xwaGluc2NoZWR1bGVyL3BsdWdpbi90YXNrL2FwaS9sb29wL3RlbXBsYXRlL2h0dHAvbWV0aG9kL0h0dHBMb29wVGFza1N1Ym1pdFRhc2tNZXRob2REZWZpbml0aW9uLmphdmE=) | `0.00% <ø> (ø)` | |
   | [...uler/dao/utils/ResourceProcessDefinitionUtils.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11759/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1kYW8vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvZGFvL3V0aWxzL1Jlc291cmNlUHJvY2Vzc0RlZmluaXRpb25VdGlscy5qYXZh) | `40.00% <0.00%> (-37.78%)` | :arrow_down: |
   | [...api/dto/resources/visitor/ResourceTreeVisitor.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11759/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2R0by9yZXNvdXJjZXMvdmlzaXRvci9SZXNvdXJjZVRyZWVWaXNpdG9yLmphdmE=) | `72.72% <0.00%> (-22.73%)` | :arrow_down: |
   | [...hinscheduler/api/controller/ProjectController.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11759/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2NvbnRyb2xsZXIvUHJvamVjdENvbnRyb2xsZXIuamF2YQ==) | `50.00% <0.00%> (-18.43%)` | :arrow_down: |
   | [...heduler/api/service/impl/ResourcesServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11759/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9SZXNvdXJjZXNTZXJ2aWNlSW1wbC5qYXZh) | `37.73% <0.00%> (-14.23%)` | :arrow_down: |
   | [...erver/master/processor/queue/TaskEventService.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11759/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1tYXN0ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9wcm9jZXNzb3IvcXVldWUvVGFza0V2ZW50U2VydmljZS5qYXZh) | `69.64% <0.00%> (-10.72%)` | :arrow_down: |
   | [...scheduler/api/dto/resources/ResourceComponent.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11759/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2R0by9yZXNvdXJjZXMvUmVzb3VyY2VDb21wb25lbnQuamF2YQ==) | `25.00% <0.00%> (-6.25%)` | :arrow_down: |
   | ... and [60 more](https://codecov.io/gh/apache/dolphinscheduler/pull/11759/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1296492014

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11759)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [99 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list)  
   [![40.8%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20plus-16px.png '40.8%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list) [40.8% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1236102713

   closes: #6586


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1009349499


##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProxyProcessDefinitionController.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.tools.demo;
+
+import org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum;
+import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import org.apache.dolphinscheduler.common.utils.OkHttpUtils;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ProxyProcessDefinitionController {
+
+    @Value("${demo.api-server-port}")
+    private String ServerPort;
+
+    public ProxyResult createProcessDefinition(String token,
+                                               long projectCode,
+                                               String name,
+                                               String description,
+                                               String globalParams,
+                                               String locations,
+                                               int timeout,
+                                               String tenantCode,
+                                               String taskRelationJson,
+                                               String taskDefinitionJson,
+                                               ProcessExecutionTypeEnum executionType) {
+        ProxyResult proxyResult = new ProxyResult();
+        String url =
+                "http://localhost:" + ServerPort + "/dolphinscheduler/projects/" + projectCode + "/process-definition";
+        String responseBody;
+        Map<String, Object> requestBodyMap = new HashMap<>();
+
+        requestBodyMap.put("name", name);
+        requestBodyMap.put("description", description);
+        requestBodyMap.put("globalParams", globalParams);
+        requestBodyMap.put("locations", locations);
+        requestBodyMap.put("timeout", timeout);
+        requestBodyMap.put("tenantCode", tenantCode);
+        requestBodyMap.put("taskRelationJson", taskRelationJson);
+        requestBodyMap.put("taskDefinitionJson", taskDefinitionJson);
+        requestBodyMap.put("otherParamsJson", null);
+        requestBodyMap.put("executionType", executionType);
+
+        try {
+            responseBody = OkHttpUtils.demoPost(url, token, requestBodyMap);

Review Comment:
   Then I'll look at it and try to make adjustments



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1297147569

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11759)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [98 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list)  
   [![39.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20plus-16px.png '39.4%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list) [39.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] SbloodyS commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
SbloodyS commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1237632498

   > I don’t think this is a good idea to couple the demo codes with the production code. At least, you should move the demo codes to the module dolphinscheduler-tools, and execute that tool after starting DS server. Mixing the demo codes and production code increases maintainability complexity
   
   +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1296495579

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11759)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [99 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list)  
   [![40.8%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20plus-16px.png '40.8%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list) [40.8% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1296255617

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11759)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [98 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list)  
   [![41.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20plus-16px.png '41.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list) [41.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] caishunfeng merged pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
caishunfeng merged PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1297001162

   > The comments are not addressed but you click resolve conversation, please fix or reply if you think it's wrong. Don't simply mark it as resolved.
   
   I'm sorry I didn't reply to this


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1236091060

   related: #6586 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature-6586][Server]add some ds process definition demo when init [dolphinscheduler]

Posted by "cqutwangyu (via GitHub)" <gi...@apache.org>.
cqutwangyu commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1990897987

   Is this demo still working? 
   What are the preconditions?
   
   ![image](https://github.com/apache/dolphinscheduler/assets/26395835/d86ee105-2ae2-45ed-b89b-f68ccecd051b)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1296970648

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11759)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [100 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL)
   
   [![0.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.6%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list) [0.6% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list)  
   [![40.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20plus-16px.png '40.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list) [40.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1009366247


##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/CreateDemoTenant.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.tools.demo;
+
+import org.apache.dolphinscheduler.dao.entity.Tenant;
+import org.apache.dolphinscheduler.dao.mapper.TenantMapper;
+
+import java.util.Date;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class CreateDemoTenant {
+
+    private static final Logger logger = LoggerFactory.getLogger(CreateDemoTenant.class);
+    @Autowired
+    private TenantMapper tenantMapper;
+
+    public void createTenantCode(String tenantCode) {
+        Date now = new Date();
+
+        if (!tenantCode.equals("default")) {
+            Boolean existTenant = tenantMapper.existTenant(tenantCode);
+            if (!Boolean.TRUE.equals(existTenant)) {
+                Tenant tenant = new Tenant();
+                tenant.setTenantCode(tenantCode);
+                tenant.setQueueId(1);

Review Comment:
   The initial database didn't have a tenant, so I didn't do that



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
caishunfeng commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1009365898


##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProxyResult.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * 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.tools.demo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString

Review Comment:
   `@Data` contains `@ToString`
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] ruanwenjun commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r964356878


##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/datasource/CreateProcessDemo.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.tools.datasource;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.stereotype.Component;
+
+@SpringBootApplication
+public class CreateProcessDemo {
+    public static void main(String[] args) {
+        SpringApplication.run(CreateProcessDemo.class, args);
+    }
+
+    @Component
+    static class DemoRunner implements CommandLineRunner {
+        private static final Logger logger = LoggerFactory.getLogger(DemoRunner.class);
+
+        private final ProcessDefinitionDemo processDefinitionDemo;
+
+        DemoRunner(ProcessDefinitionDemo processDefinitionDemo) {
+            this.processDefinitionDemo = processDefinitionDemo;
+        }
+
+        @Override
+        public void run(String... args) throws Exception {
+            processDefinitionDemo.createProcessDefinitionDemo();

Review Comment:
   Could you please split this method into `createDemoProject`, `createDemoTenant`, `createDemoWorkflow`?
   And can we get the current login user as demoTenant?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1002955235


##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OkHttpUtils.java:
##########
@@ -0,0 +1,130 @@
+/*
+ * 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.common.utils;
+
+import org.apache.http.HttpStatus;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import javax.annotation.Nullable;
+
+import lombok.NonNull;
+import okhttp3.HttpUrl;
+import okhttp3.MediaType;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+
+import org.apache.dolphinscheduler.spi.utils.JSONUtils;
+
+
+public class OkHttpUtils {

Review Comment:
   Ok, I'll make some adjustments



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] caishunfeng commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
caishunfeng commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1296239339

   ![image](https://user-images.githubusercontent.com/11962619/198877609-a7f5e9c4-2176-4ff7-a3d2-71d6b6e415c2.png)
   @amaoisnb please check the license header of the new files.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] kezhenxu94 commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1009091706


##########
docs/docs/zh/guide/demo.md:
##########
@@ -0,0 +1,39 @@
+# DolphinScheduler 初始化工作流 demo
+
+## 准备工作
+
+### 备份上一版本文件和数据库
+
+为了防止操作错误导致数据丢失,建议初始化工作流 demo 服务之前备份数据,备份方法请结合你数据库的情况来定
+
+### 下载新版本的安装包
+
+在[下载](/zh-cn/download/download.html)页面下载最新版本的二进制安装包,并将二进制包放到与当前 dolphinscheduler 服务不一样的路径中,以下服务启动操作都需要在新版本的目录进行。
+
+## 服务启动步骤
+
+### 开启 dolphinscheduler 服务
+
+根据你部署方式开启 dolphinscheduler 的所有服务,如果你是通过 [集群部署](installation/cluster.md) 来部署你的 dolphinscheduler 的话,可以通过 `sh ./script/start-all.sh` 开启全部服务。
+
+### 数据库配置
+
+初始化工作流 demo 服务需要使用 MySQL 或 PostgreSQL 等其他数据库作为其元数据存储数据,因此必须更改一些配置。
+请参考[数据源配置](howto/datasource-setting.md) `Standalone 切换元数据库`创建并初始化数据库 ,然后运行 demo 服务启动脚本。
+
+### 租户配置
+
+#### 修改 `dolphinscheduler-tools/resources/application.yaml` 配置内容
+
+```
+demo:
+tenant-code: default
+api-server-port: 5173

Review Comment:
   ```suggestion
     tenant-code: default
     api-server-port: 5173
   ```



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProxyProcessDefinitionController.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.tools.demo;
+
+import org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum;
+import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import org.apache.dolphinscheduler.common.utils.OkHttpUtils;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ProxyProcessDefinitionController {
+
+    @Value("${demo.api-server-port}")
+    private String ServerPort;
+
+    public ProxyResult createProcessDefinition(String token,
+                                               long projectCode,
+                                               String name,
+                                               String description,
+                                               String globalParams,
+                                               String locations,
+                                               int timeout,
+                                               String tenantCode,
+                                               String taskRelationJson,
+                                               String taskDefinitionJson,
+                                               ProcessExecutionTypeEnum executionType) {
+        ProxyResult proxyResult = new ProxyResult();
+        String url =
+                "http://localhost:" + ServerPort + "/dolphinscheduler/projects/" + projectCode + "/process-definition";
+        String responseBody;
+        Map<String, Object> requestBodyMap = new HashMap<>();
+
+        requestBodyMap.put("name", name);
+        requestBodyMap.put("description", description);
+        requestBodyMap.put("globalParams", globalParams);
+        requestBodyMap.put("locations", locations);
+        requestBodyMap.put("timeout", timeout);
+        requestBodyMap.put("tenantCode", tenantCode);
+        requestBodyMap.put("taskRelationJson", taskRelationJson);
+        requestBodyMap.put("taskDefinitionJson", taskDefinitionJson);
+        requestBodyMap.put("otherParamsJson", null);
+        requestBodyMap.put("executionType", executionType);
+
+        try {
+            responseBody = OkHttpUtils.demoPost(url, token, requestBodyMap);

Review Comment:
   Ideally, I would prefer we should use `RestTemplate` to perform http requests, but this looks OK to me if you want to refactor later.



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProxyProcessDefinitionController.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.tools.demo;
+
+import org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum;
+import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import org.apache.dolphinscheduler.common.utils.OkHttpUtils;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ProxyProcessDefinitionController {
+
+    @Value("${demo.api-server-port}")
+    private String ServerPort;
+
+    public ProxyResult createProcessDefinition(String token,
+                                               long projectCode,
+                                               String name,
+                                               String description,
+                                               String globalParams,
+                                               String locations,
+                                               int timeout,
+                                               String tenantCode,
+                                               String taskRelationJson,
+                                               String taskDefinitionJson,
+                                               ProcessExecutionTypeEnum executionType) {
+        ProxyResult proxyResult = new ProxyResult();
+        String url =
+                "http://localhost:" + ServerPort + "/dolphinscheduler/projects/" + projectCode + "/process-definition";

Review Comment:
   I think `localhost` should be also configurable, if users don't deploy on local machine



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProxyResult.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * 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.tools.demo;
+
+public class ProxyResult<T> {

Review Comment:
   Try to use lombok annotations to simplify this class



##########
dolphinscheduler-tools/src/main/bin/demo-start.sh:
##########
@@ -0,0 +1,31 @@
+#!/bin/bash

Review Comment:
   What about renaming this file to something like `create-demo-processes.sh`? `-start` sounds like it's a long-running server but it is not



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1296255978

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11759)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [98 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list)  
   [![41.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20plus-16px.png '41.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list) [41.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1009359796


##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProxyResult.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * 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.tools.demo;
+
+public class ProxyResult<T> {

Review Comment:
   Has been modified



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r962253644


##########
dolphinscheduler-standalone-server/src/main/bin/start.sh:
##########
@@ -36,4 +36,4 @@ done
 
 java $JAVA_OPTS \
   -cp "$DOLPHINSCHEDULER_HOME/conf":"$CP" \
-  org.apache.dolphinscheduler.StandaloneServer
+  org.apache.dolphinscheduler.StandaloneServer

Review Comment:
   ok,I'll delete it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1237632692

   > I don’t think this is a good idea to couple the demo codes with the production code. At least, you should move the demo codes to the module dolphinscheduler-tools, and execute that tool after starting DS server. Mixing the demo codes and production code increases maintainability complexity
   
   +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1009219857


##########
docs/docs/en/guide/demo.md:
##########
@@ -0,0 +1,37 @@
+# DolphinScheduler Initialize The Workflow Demo

Review Comment:
   Has been modified



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProcessDefinitionDemo.java:
##########
@@ -0,0 +1,827 @@
+/*
+ * 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.tools.demo;
+
+import static org.apache.dolphinscheduler.common.enums.ConditionType.NONE;
+import static org.apache.dolphinscheduler.common.enums.Flag.YES;
+import static org.apache.dolphinscheduler.common.enums.Priority.MEDIUM;
+import static org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum.PARALLEL;
+
+import org.apache.dolphinscheduler.common.enums.TimeoutFlag;
+import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils;
+import org.apache.dolphinscheduler.common.utils.DateUtils;
+import org.apache.dolphinscheduler.common.utils.EncryptionUtils;
+import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import org.apache.dolphinscheduler.dao.entity.AccessToken;
+import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog;
+import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog;
+import org.apache.dolphinscheduler.dao.entity.Project;
+import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog;
+import org.apache.dolphinscheduler.dao.entity.User;
+import org.apache.dolphinscheduler.dao.mapper.AccessTokenMapper;
+import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
+import org.apache.dolphinscheduler.dao.mapper.UserMapper;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ProcessDefinitionDemo {
+
+    private static final Logger logger = LoggerFactory.getLogger(ProcessDefinitionDemo.class);
+
+    @Value("${demo.tenant-code}")
+    private String tenantCode;
+
+    @Autowired
+    private ProjectMapper projectMapper;
+
+    @Autowired
+    private UserMapper userMapper;
+
+    @Autowired
+    private AccessTokenMapper accessTokenMapper;
+
+    @Autowired
+    private ProxyProcessDefinitionController proxyProcessDefinitionController;
+
+    public void createProcessDefinitionDemo() throws Exception {
+        // get user
+        User loginUser = userMapper.selectById("1");
+        Date now = new Date();
+
+        // create demo tenantCode
+        CreateDemoTenant createDemoTenant = new CreateDemoTenant();
+        createDemoTenant.createTenantCode(tenantCode);
+
+        // create and get demo projectCode
+        Project project = projectMapper.queryByName("demo");
+        if (project != null) {
+            logger.warn("Project {} already exists.", project.getName());
+        }
+        try {
+            project = Project
+                    .builder()
+                    .name("demo")
+                    .code(CodeGenerateUtils.getInstance().genCode())
+                    .description("")
+                    .userId(loginUser.getId())
+                    .userName(loginUser.getUserName())
+                    .createTime(now)
+                    .updateTime(now)
+                    .build();
+        } catch (CodeGenerateUtils.CodeGenerateException e) {
+            logger.error("create project error", e);
+        }
+        if (projectMapper.insert(project) > 0) {
+            logger.info("create project success");
+        } else {
+            throw new Exception("create project error");
+        }
+        Long projectCode = null;
+        try {
+            projectCode = project.getCode();
+        } catch (NullPointerException e) {
+            logger.error("project code is null", e);
+        }
+
+        // generate access token
+        String expireTime = "2050-09-30 15:59:23";

Review Comment:
   Has been modified



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1009381637


##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProxyResult.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * 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.tools.demo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString

Review Comment:
   Has been modified



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1296807171

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11759)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [100 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list)  
   [![40.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20plus-16px.png '40.7%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list) [40.7% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] amaoisnb commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
amaoisnb commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1009371336


##########
docs/docs/en/guide/demo.md:
##########
@@ -0,0 +1,37 @@
+# DolphinScheduler Initialize The Workflow Demo
+
+## Prepare
+
+### Backup Previous Version's Files and Database
+
+To prevent data loss by some miss-operation, it is recommended to back up data before initializing the workflow demo. The backup way according to your environment.
+
+### Download the Latest Version Installation Package
+
+Download the latest binary distribute package from [download](/en-us/download/download.html) and then put it in the different
+directory where current service running. And all below command is running in this directory.
+
+## Start
+
+### Start Services of DolphinScheduler
+
+Start all services of dolphinscheduler according to your deployment method. If you deploy your dolphinscheduler according to [cluster deployment](installation/cluster.md), you can start all services by command `sh ./script/start-all.sh`.
+
+### Database Configuration
+
+Initializing the workflow demo needs to store metabase in other database like MySQL or PostgreSQL, they have to change some configuration. Follow the instructions in [datasource-setting](howto/datasource-setting.md) `Standalone Switching Metadata Database Configuration` section to create and initialize database.
+
+### Tenant Configuration
+
+#### Change `dolphinscheduler-tools/resources/application.yaml` Placement Details
+
+        ```
+        demo:
+          tenant-code: default
+          api-server-port: 5173

Review Comment:
   Has been modified



##########
docs/docs/zh/guide/demo.md:
##########
@@ -0,0 +1,37 @@
+# DolphinScheduler 初始化工作流 demo
+
+## 准备工作
+
+### 备份上一版本文件和数据库
+
+为了防止操作错误导致数据丢失,建议初始化工作流 demo 服务之前备份数据,备份方法请结合你数据库的情况来定
+
+### 下载新版本的安装包
+
+在[下载](/zh-cn/download/download.html)页面下载最新版本的二进制安装包,并将二进制包放到与当前 dolphinscheduler 服务不一样的路径中,以下服务启动操作都需要在新版本的目录进行。
+
+## 服务启动步骤
+
+### 开启 dolphinscheduler 服务
+
+根据你部署方式开启 dolphinscheduler 的所有服务,如果你是通过 [集群部署](installation/cluster.md) 来部署你的 dolphinscheduler 的话,可以通过 `sh ./script/start-all.sh` 开启全部服务。
+
+### 数据库配置
+
+初始化工作流 demo 服务需要使用 MySQL 或 PostgreSQL 等其他数据库作为其元数据存储数据,因此必须更改一些配置。
+请参考[数据源配置](howto/datasource-setting.md) `Standalone 切换元数据库`创建并初始化数据库 ,然后运行 demo 服务启动脚本。
+
+### 租户配置
+
+#### 修改 `dolphinscheduler-tools/resources/application.yaml` 配置内容
+
+        ```
+        demo:
+          tenant-code: default
+          api-server-port: 5173

Review Comment:
   Has been modified



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1236091027

   Hi @amaoisnb , you could add `closes: #6586` in you PR description to automatically link this PR to the issue it solves.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] kezhenxu94 commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1237631996

   I don’t think this is a good idea to couple the demo codes with the production code. At least, you should move the demo codes to the module dolphinscheduler-tools, and execute that tool after starting DS server. Mixing the demo codes and production code increases maintainability complexity 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] ruanwenjun commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1238876031

   > I don’t think this is a good idea to couple the demo codes with the production code. At least, you should move the demo codes to the module dolphinscheduler-tools, and execute that tool after starting DS server. Mixing the demo codes and production code increases maintainability complexity
   
   +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
caishunfeng commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r992264051


##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/DemoContants.java:
##########
@@ -0,0 +1,117 @@
+package org.apache.dolphinscheduler.tools.demo;
+
+public class DemoContants {
+    public static final String [] SHELL_taskDefinitionJson = {"[{\"code\":",

Review Comment:
   Json string is hard to maintain, please replace it with `TaskDefinition` Object.
   



##########
dolphinscheduler-common/pom.xml:
##########
@@ -319,6 +319,19 @@
             <artifactId>netty-all</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.16.22</version>

Review Comment:
   move the version into bom.



##########
dolphinscheduler-common/pom.xml:
##########
@@ -319,6 +319,19 @@
             <artifactId>netty-all</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.16.22</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+            <version>3.14.9</version>

Review Comment:
   same here



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProcessDefinitionDemo.java:
##########
@@ -0,0 +1,321 @@
+package org.apache.dolphinscheduler.tools.demo;
+
+
+import static org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum.PARALLEL;
+
+
+import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils;
+import org.apache.dolphinscheduler.common.utils.DateUtils;
+import org.apache.dolphinscheduler.common.utils.EncryptionUtils;
+import org.apache.dolphinscheduler.dao.entity.AccessToken;
+import org.apache.dolphinscheduler.dao.entity.Project;
+import org.apache.dolphinscheduler.dao.entity.User;
+import org.apache.dolphinscheduler.dao.mapper.AccessTokenMapper;
+import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
+import org.apache.dolphinscheduler.dao.mapper.UserMapper;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+
+@Component
+public class ProcessDefinitionDemo {
+
+    private static final Logger logger = LoggerFactory.getLogger(ProcessDefinitionDemo.class);
+
+    @Value("${create-demo.tenant-code}")
+    private String tenantCode;
+
+    @Autowired
+    private ProjectMapper projectMapper;
+
+    @Autowired
+    private UserMapper userMapper;
+
+    @Autowired
+    private AccessTokenMapper accessTokenMapper;
+
+    @Autowired
+    private ProxyProcessDefinitionController proxyProcessDefinitionController;
+
+    public void createProcessDefinitionDemo(){
+        //get user
+        User loginUser = userMapper.selectById("1");
+        Date now = new Date();
+
+        //create demo tenantCode
+        CreateDemoTenant createDemoTenant = new CreateDemoTenant();
+        createDemoTenant.createTenantCode(tenantCode);
+
+        //create and get demo projectCode
+        Project project = projectMapper.queryByName("demo");
+        try {
+            project = Project
+                    .newBuilder()
+                    .name("demo")
+                    .code(CodeGenerateUtils.getInstance().genCode())
+                    .description("")
+                    .userId(loginUser.getId())
+                    .userName(loginUser.getUserName())
+                    .createTime(now)
+                    .updateTime(now)
+                    .build();
+        } catch (CodeGenerateUtils.CodeGenerateException e) {
+            logger.info("create project error");
+        }
+        if (projectMapper.insert(project) > 0) {
+            logger.info("create project success");
+        } else {
+            logger.info("create project error");
+        }

Review Comment:
   should throw exception



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProxyProcessDefinitionController.java:
##########
@@ -0,0 +1,56 @@
+package org.apache.dolphinscheduler.tools.demo;
+
+import org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum;
+import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import org.apache.dolphinscheduler.common.utils.OkHttpUtils;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ProxyProcessDefinitionController {
+
+    private static final Logger logger = LoggerFactory.getLogger(ProxyProcessDefinitionController.class);
+    public ProxyResult createProcessDefinition (String token,
+                                                long projectCode,
+                                                String name,
+                                                String description,
+                                                String globalParams,
+                                                String locations,
+                                                int timeout,
+                                                String tenantCode,
+                                                String taskRelationJson,
+                                                String taskDefinitionJson,
+                                                ProcessExecutionTypeEnum executionType){
+        ProxyResult proxyResult = new ProxyResult();
+        String ServerPort = "3000";
+        String url = "http://localhost:" + ServerPort + "/dolphinscheduler/projects/" + projectCode + "/process-definition";

Review Comment:
   The ip and port should be config in `application.yaml`



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProcessDefinitionDemo.java:
##########
@@ -0,0 +1,321 @@
+package org.apache.dolphinscheduler.tools.demo;
+
+
+import static org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum.PARALLEL;
+
+
+import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils;
+import org.apache.dolphinscheduler.common.utils.DateUtils;
+import org.apache.dolphinscheduler.common.utils.EncryptionUtils;
+import org.apache.dolphinscheduler.dao.entity.AccessToken;
+import org.apache.dolphinscheduler.dao.entity.Project;
+import org.apache.dolphinscheduler.dao.entity.User;
+import org.apache.dolphinscheduler.dao.mapper.AccessTokenMapper;
+import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
+import org.apache.dolphinscheduler.dao.mapper.UserMapper;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+
+@Component
+public class ProcessDefinitionDemo {
+
+    private static final Logger logger = LoggerFactory.getLogger(ProcessDefinitionDemo.class);
+
+    @Value("${create-demo.tenant-code}")
+    private String tenantCode;
+
+    @Autowired
+    private ProjectMapper projectMapper;
+
+    @Autowired
+    private UserMapper userMapper;
+
+    @Autowired
+    private AccessTokenMapper accessTokenMapper;
+
+    @Autowired
+    private ProxyProcessDefinitionController proxyProcessDefinitionController;
+
+    public void createProcessDefinitionDemo(){
+        //get user
+        User loginUser = userMapper.selectById("1");
+        Date now = new Date();
+
+        //create demo tenantCode
+        CreateDemoTenant createDemoTenant = new CreateDemoTenant();
+        createDemoTenant.createTenantCode(tenantCode);
+
+        //create and get demo projectCode
+        Project project = projectMapper.queryByName("demo");
+        try {
+            project = Project
+                    .newBuilder()
+                    .name("demo")
+                    .code(CodeGenerateUtils.getInstance().genCode())
+                    .description("")
+                    .userId(loginUser.getId())
+                    .userName(loginUser.getUserName())
+                    .createTime(now)
+                    .updateTime(now)
+                    .build();
+        } catch (CodeGenerateUtils.CodeGenerateException e) {
+            logger.info("create project error");

Review Comment:
   ```suggestion
               logger.error("create project error", e);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] zhongjiajie commented on a diff in pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
zhongjiajie commented on code in PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#discussion_r1008958143


##########
docs/docs/zh/guide/demo.md:
##########
@@ -0,0 +1,37 @@
+# DolphinScheduler 初始化工作流 demo
+
+## 准备工作
+
+### 备份上一版本文件和数据库
+
+为了防止操作错误导致数据丢失,建议初始化工作流 demo 服务之前备份数据,备份方法请结合你数据库的情况来定
+
+### 下载新版本的安装包
+
+在[下载](/zh-cn/download/download.html)页面下载最新版本的二进制安装包,并将二进制包放到与当前 dolphinscheduler 服务不一样的路径中,以下服务启动操作都需要在新版本的目录进行。
+
+## 服务启动步骤
+
+### 开启 dolphinscheduler 服务
+
+根据你部署方式开启 dolphinscheduler 的所有服务,如果你是通过 [集群部署](installation/cluster.md) 来部署你的 dolphinscheduler 的话,可以通过 `sh ./script/start-all.sh` 开启全部服务。
+
+### 数据库配置
+
+初始化工作流 demo 服务需要使用 MySQL 或 PostgreSQL 等其他数据库作为其元数据存储数据,因此必须更改一些配置。
+请参考[数据源配置](howto/datasource-setting.md) `Standalone 切换元数据库`创建并初始化数据库 ,然后运行 demo 服务启动脚本。
+
+### 租户配置
+
+#### 修改 `dolphinscheduler-tools/resources/application.yaml` 配置内容
+
+        ```
+        demo:
+          tenant-code: default
+          api-server-port: 5173

Review Comment:
   ```suggestion
   demo:
     tenant-code: default
     api-server-port: 5173
   ```



##########
docs/docs/en/guide/demo.md:
##########
@@ -0,0 +1,37 @@
+# DolphinScheduler Initialize The Workflow Demo

Review Comment:
   I think we should also add a hyperlink to https://dolphinscheduler.apache.org/en-us/docs/latest/user_doc/guide/start/quick-start.html to told user we can create demo, WDYT?



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/CreateDemoTenant.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.tools.demo;
+
+import org.apache.dolphinscheduler.dao.entity.Tenant;
+import org.apache.dolphinscheduler.dao.mapper.TenantMapper;
+
+import java.util.Date;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class CreateDemoTenant {
+
+    private static final Logger logger = LoggerFactory.getLogger(CreateDemoTenant.class);
+    @Autowired
+    private TenantMapper tenantMapper;
+
+    public void createTenantCode(String tenantCode) {
+        Date now = new Date();
+
+        if (!tenantCode.equals("default")) {
+            Boolean existTenant = tenantMapper.existTenant(tenantCode);
+            if (!Boolean.TRUE.equals(existTenant)) {
+                Tenant tenant = new Tenant();
+                tenant.setTenantCode(tenantCode);
+                tenant.setQueueId(1);

Review Comment:
   can we use a Constant variable here instead of a bare number? also to `userMapper.selectById("1")` in processdefinitionDemo.java



##########
dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/demo/ProcessDefinitionDemo.java:
##########
@@ -0,0 +1,827 @@
+/*
+ * 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.tools.demo;
+
+import static org.apache.dolphinscheduler.common.enums.ConditionType.NONE;
+import static org.apache.dolphinscheduler.common.enums.Flag.YES;
+import static org.apache.dolphinscheduler.common.enums.Priority.MEDIUM;
+import static org.apache.dolphinscheduler.common.enums.ProcessExecutionTypeEnum.PARALLEL;
+
+import org.apache.dolphinscheduler.common.enums.TimeoutFlag;
+import org.apache.dolphinscheduler.common.utils.CodeGenerateUtils;
+import org.apache.dolphinscheduler.common.utils.DateUtils;
+import org.apache.dolphinscheduler.common.utils.EncryptionUtils;
+import org.apache.dolphinscheduler.common.utils.JSONUtils;
+import org.apache.dolphinscheduler.dao.entity.AccessToken;
+import org.apache.dolphinscheduler.dao.entity.ProcessDefinitionLog;
+import org.apache.dolphinscheduler.dao.entity.ProcessTaskRelationLog;
+import org.apache.dolphinscheduler.dao.entity.Project;
+import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog;
+import org.apache.dolphinscheduler.dao.entity.User;
+import org.apache.dolphinscheduler.dao.mapper.AccessTokenMapper;
+import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
+import org.apache.dolphinscheduler.dao.mapper.UserMapper;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ProcessDefinitionDemo {
+
+    private static final Logger logger = LoggerFactory.getLogger(ProcessDefinitionDemo.class);
+
+    @Value("${demo.tenant-code}")
+    private String tenantCode;
+
+    @Autowired
+    private ProjectMapper projectMapper;
+
+    @Autowired
+    private UserMapper userMapper;
+
+    @Autowired
+    private AccessTokenMapper accessTokenMapper;
+
+    @Autowired
+    private ProxyProcessDefinitionController proxyProcessDefinitionController;
+
+    public void createProcessDefinitionDemo() throws Exception {
+        // get user
+        User loginUser = userMapper.selectById("1");
+        Date now = new Date();
+
+        // create demo tenantCode
+        CreateDemoTenant createDemoTenant = new CreateDemoTenant();
+        createDemoTenant.createTenantCode(tenantCode);
+
+        // create and get demo projectCode
+        Project project = projectMapper.queryByName("demo");
+        if (project != null) {
+            logger.warn("Project {} already exists.", project.getName());
+        }
+        try {
+            project = Project
+                    .builder()
+                    .name("demo")
+                    .code(CodeGenerateUtils.getInstance().genCode())
+                    .description("")
+                    .userId(loginUser.getId())
+                    .userName(loginUser.getUserName())
+                    .createTime(now)
+                    .updateTime(now)
+                    .build();
+        } catch (CodeGenerateUtils.CodeGenerateException e) {
+            logger.error("create project error", e);
+        }
+        if (projectMapper.insert(project) > 0) {
+            logger.info("create project success");
+        } else {
+            throw new Exception("create project error");
+        }
+        Long projectCode = null;
+        try {
+            projectCode = project.getCode();
+        } catch (NullPointerException e) {
+            logger.error("project code is null", e);
+        }
+
+        // generate access token
+        String expireTime = "2050-09-30 15:59:23";

Review Comment:
   maybe we should better add those constant values in this file to `DemoContants.java`



##########
docs/docs/en/guide/demo.md:
##########
@@ -0,0 +1,37 @@
+# DolphinScheduler Initialize The Workflow Demo
+
+## Prepare
+
+### Backup Previous Version's Files and Database
+
+To prevent data loss by some miss-operation, it is recommended to back up data before initializing the workflow demo. The backup way according to your environment.
+
+### Download the Latest Version Installation Package
+
+Download the latest binary distribute package from [download](/en-us/download/download.html) and then put it in the different
+directory where current service running. And all below command is running in this directory.
+
+## Start
+
+### Start Services of DolphinScheduler
+
+Start all services of dolphinscheduler according to your deployment method. If you deploy your dolphinscheduler according to [cluster deployment](installation/cluster.md), you can start all services by command `sh ./script/start-all.sh`.
+
+### Database Configuration
+
+Initializing the workflow demo needs to store metabase in other database like MySQL or PostgreSQL, they have to change some configuration. Follow the instructions in [datasource-setting](howto/datasource-setting.md) `Standalone Switching Metadata Database Configuration` section to create and initialize database.
+
+### Tenant Configuration
+
+#### Change `dolphinscheduler-tools/resources/application.yaml` Placement Details
+
+        ```
+        demo:
+          tenant-code: default
+          api-server-port: 5173

Review Comment:
   ```suggestion
   demo:
     tenant-code: default
     api-server-port: 5173
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1296807087

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11759)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [100 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list)  
   [![40.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20plus-16px.png '40.7%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list) [40.7% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1296272040

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11759)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [98 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list)  
   [![40.8%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20plus-16px.png '40.8%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list) [40.8% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1296969662

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11759)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [100 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL)
   
   [![0.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.6%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list) [0.6% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list)  
   [![40.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20plus-16px.png '40.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list) [40.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] kezhenxu94 commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1296973447

   The comments are not addressed but you click resolve conversation, please fix or reply if you think it's wrong. Don't simply mark it as resolved. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11759: [Feature-6586][Server]add some ds process definition demo when init

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11759:
URL: https://github.com/apache/dolphinscheduler/pull/11759#issuecomment-1297143061

   SonarCloud Quality Gate failed.&nbsp; &nbsp; [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11759)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL) [98 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11759&resolved=false&types=CODE_SMELL)
   
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_coverage&view=list)  
   [![39.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20plus-16px.png '39.4%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list) [39.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11759&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org