Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docment][Feature] Refactor global parameter docment #10045

Merged
merged 10 commits into from
May 23, 2022
28 changes: 19 additions & 9 deletions docs/docs/en/guide/parameter/global.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,28 @@

## Scope

The parameters defined on the process definition page can apply to all the scope of the process tasks.
Global parameters are parameters that are valid for all task nodes of the entire workflow. It can be configured on the workflow definition page.

## Usage

Usage of global parameters is: at the process define page, click the '+' beside the 'Set global' and fill in the key and value to save:
The specific use method can be determined according to the actual production situation. This example uses a shell task to print out the date value of yesterday.

<p align="center">
<img src="/img/supplement_global_parameter_en.png" width="80%" />
</p>
### Create a Shell task

<p align="center">
<img src="/img/local_parameter_en.png" width="80%" />
</p>
Create a shell task and enter `echo ${dt}` in the script content. In this case, dt is the global parameter we need to declare. As shown below:

The `global_bizdate` parameter defined here can be referenced by local parameters of any other task node, and set the value of `global_bizdate` by referencing the system parameter `system.biz.date`.
![global-parameter01](/img/new_ui/dev/parameter/global_parameter01.png)

### Save the workflow and set global parameters

You could follow this guide to set global parameter: On the workflow definition page, click the plus sign to the right of "Set Global", after filling in the variable name and value, then save it

![global-parameter02](/img/new_ui/dev/parameter/global_parameter02.png)

> Note: The dt parameter defined here can be referenced by the local parameters of any other node.

### In task instance view execution result

On the task instance page, you can check the log to verify the execution result of the task and determine whether the parameters are valid.

![global-parameter03](/img/new_ui/dev/parameter/global_parameter03.png)
29 changes: 20 additions & 9 deletions docs/docs/zh/guide/parameter/global.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,29 @@

## 作用域

在工作流定义页面配置的参数,作用于该工作流中全部的任务
全局参数是指针对**整个工作流**的所有任务节点都有效的参数,在工作流定义页面配置。

## 使用方式

全局参数配置方式如下:在工作流定义页面,点击“设置全局”右边的加号,填写对应的变量名称和对应的值,保存即可
具体的使用方式可结合实际的生产情况而定,这里演示为使用 Shell 任务打印出前一天的日期。

<p align="center">
<img src="/img/supplement_global_parameter.png" width="80%" />
</p>
### 创建 Shell 任务

<p align="center">
<img src="/img/local_parameter.png" width="80%" />
</p>
创建一个 Shell 任务,并在脚本内容中输入 `echo ${dt}`。此时 dt 则为我们需要声明的全局参数。如下图所示:

![global-parameter01](/img/new_ui/dev/parameter/global_parameter01.png)

### 保存工作流,并设置全局参数

全局参数配置方式如下:在工作流定义页面,点击“设置全局”右边的加号,填写对应的变量名称和对应的值,保存即可。如下图所示:

![global-parameter02](/img/new_ui/dev/parameter/global_parameter02.png)

> 注:这里定义的 dt 参数可以被其它任一节点的局部参数引用。

### 任务实例查看执行结果

进入任务实例页面,可以通过查看日志,验证任务的执行结果,判断参数是否有效。

![global-parameter03](/img/new_ui/dev/parameter/global_parameter03.png)

这里定义的global_bizdate参数可以被其它任一节点的局部参数引用,并设置global_bizdate的value为通过引用系统参数system.biz.date获得的值
Binary file removed docs/img/local_parameter.png
Binary file not shown.
Binary file removed docs/img/local_parameter_en.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/img/supplement_global_parameter.png
Binary file not shown.
Binary file removed docs/img/supplement_global_parameter_en.png
Binary file not shown.