zhongjiajie commented on code in PR #11611:
URL: https://github.com/apache/dolphinscheduler/pull/11611#discussion_r958252482


##########
dolphinscheduler-python/pydolphinscheduler/examples/yaml_define/Condition.yaml:
##########
@@ -0,0 +1,60 @@
+# 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.
+
+# Define the process
+process:
+  name: "Condition"
+
+# Define the tasks under the process
+tasks:
+  - {
+      "task_type": "Shell",
+      "params": { "name": "pre_task_1", "command": "echo pre_task_1" },
+    }
+  - {
+      "task_type": "Shell",
+      "params": { "name": "pre_task_2", "command": "echo pre_task_2" },
+    }
+  - {
+      "task_type": "Shell",
+      "params": { "name": "pre_task_3", "command": "echo pre_task_3" },
+    }
+  - {
+      "task_type": "Shell",
+      "params": { "name": "success_branch", "command": "echo success_branch" },
+    }
+  - {
+      "task_type": "Shell",
+      "params": { "name": "fail_branch", "command": "echo fail_branch" },
+    }
+  - task_type: Condition
+    params:
+      name: condition
+      success_task: success_branch
+      failed_task: fail_branch
+      OP: AND
+      groups:
+        - OP: AND
+          groups:
+            - [pre_task_1, true]

Review Comment:
   we should also add some key like `task` for this make it more meanful



##########
dolphinscheduler-python/pydolphinscheduler/examples/yaml_define/Condition.yaml:
##########
@@ -0,0 +1,60 @@
+# 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.
+
+# Define the process
+process:
+  name: "Condition"
+
+# Define the tasks under the process
+tasks:
+  - {
+      "task_type": "Shell",
+      "params": { "name": "pre_task_1", "command": "echo pre_task_1" },
+    }
+  - {
+      "task_type": "Shell",
+      "params": { "name": "pre_task_2", "command": "echo pre_task_2" },
+    }
+  - {
+      "task_type": "Shell",
+      "params": { "name": "pre_task_3", "command": "echo pre_task_3" },
+    }
+  - {
+      "task_type": "Shell",
+      "params": { "name": "success_branch", "command": "echo success_branch" },
+    }
+  - {
+      "task_type": "Shell",
+      "params": { "name": "fail_branch", "command": "echo fail_branch" },
+    }
+  - task_type: Condition
+    params:
+      name: condition

Review Comment:
   Maybe we should move `name` in the top level



##########
dolphinscheduler-python/pydolphinscheduler/examples/yaml_define/Dependent.yaml:
##########
@@ -0,0 +1,76 @@
+# 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.
+
+process:
+  name: "Dependent"
+
+# Define the tasks under the process
+tasks:
+  - task_type: Dependent
+    params:
+      name: dependent
+      denpendence:
+      OP: AND
+      groups:
+        - OP: Or
+          groups:
+            - [project-pydolphin, task_dependent_external, task_1]
+            - [project-pydolphin, task_dependent_external, task_2]
+        - OP: And
+          groups:
+            - [

Review Comment:
   Also here, add meanful key to recognite



##########
dolphinscheduler-python/pydolphinscheduler/examples/yaml_define/MoreConfiguration.yaml:
##########
@@ -0,0 +1,41 @@
+# 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.
+
+# Define the process
+process:
+  name: "MoreConfiguration"
+  param:
+    n: 1
+
+# Define the tasks under the process
+tasks:
+  - task_type: Shell
+    params:
+      name: shell_0
+      description: "yaml define task"
+      flag: "YES"
+      command: |
+        echo "$ENV{HOME}"
+        echo "${n}"
+      task_priority: "HIGH"
+      delay_time: 20
+      fail_retry_times: 30
+      fail_retry_interval: 5
+      timeout_flag: "CLOSE"
+      timeout: 60
+      local_params:

Review Comment:
   I think we should move this parameter in the top level, instead of under the 
`param`



##########
dolphinscheduler-python/pydolphinscheduler/examples/yaml_define/Switch.yaml:
##########
@@ -0,0 +1,41 @@
+# 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.
+
+# Define the process
+process:
+  name: "Switch"
+  param:
+    var: 1
+
+# Define the tasks under the process
+tasks:
+  - task_type: Shell
+    params:
+      name: switch_child_1
+      command: echo switch_child_1
+
+  - task_type: Shell
+    params:
+      name: switch_child_2
+      command: echo switch_child_2
+
+  - task_type: Switch
+    params:
+      name: switch
+      condition:
+        - ["${var} > 1", switch_child_1]
+        - switch_child_2

Review Comment:
   Add meanful key here, same as condition task



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to