guyinyou opened a new pull request #3659:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3659


   Content of PR:
   Added VarPool:
   Introduction: VarPool is similar to a global variable whose value can be 
dynamically modified. Variables are passed between different nodes in the task 
flow.
   Difference: Global variables are constant attributes of the task flow, and 
currently there is no interface that can be dynamically modified.
   
   Precautions:
   Need to add the field var_pool in the t_ds_task_instance and 
t_ds_process_instance tables in the DB, the type is longtext.
   
   How to use:**(Currently only supports Python nodes)**
   Value: Just declare the variable name at LocalParams of the node.
   Modification: ${setShareVar(variable name, value)} in the script.
   
   Example:
   
        Node a1:
                Script:
                        value = 600 + 60
                        ${setShareVar(${shareVar1},value+6)}
                        
        Node a2:
                Custom parameters:
                        shareVar1:"default"
                Script:
                        print("shareVar1:",${shareVar1})
                operation result:
                        "shareVar1:666"
   
   
   
   ———————————————————————————————————————————————————
   PR的内容:
   新增VarPool:
   作用:VarPool类似于一个值可动态修改的全局变量,在任务流下不同节点之间传递变量。
   区别:全局变量为任务流的常量属性,目前没有接口可以动态修改。
   
   注意事项:
   需要在DB中的t_ds_task_instance和t_ds_process_instance表中增加字段var_pool,类型为longtext。
   
   使用:**(目前仅支持Python节点)**
   取值:只需在节点的LocalParams处申明变量名。
   修改:在脚本中 ${setShareVar(变量名,值)}。
   
   示例:
   
        节点a1:
                脚本:
                        value = 600 + 60
                        ${setShareVar(${shareVar1},value+6)}
   
        节点a2:
                自定义参数:
                        shareVar1:"default"
                脚本:
                        print("shareVar1:",${shareVar1})
                运行结果:
                        shareVar1:666
   
   ————————————————————————————————————————————————————
   Node a1:
   
![0](https://user-images.githubusercontent.com/36399867/90391510-d713dd00-e0bf-11ea-8adc-994138fec17d.png)
   ————————————————————————————————————————————————————
   Node a2:
   
![1](https://user-images.githubusercontent.com/36399867/90391522-dbd89100-e0bf-11ea-8fc3-dde2793649eb.png)
   ————————————————————————————————————————————————————
   result:
   
![2](https://user-images.githubusercontent.com/36399867/90391531-dda25480-e0bf-11ea-9c0a-f78de7be70ca.png)
   ————————————————————————————————————————————————————
   Process:
   
![Process](https://user-images.githubusercontent.com/36399867/90391938-8b156800-e0c0-11ea-8753-622ab401eece.png)
   


----------------------------------------------------------------
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.

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


Reply via email to