Continue

最近更新时间:2023-06-08 14:47:55

我的收藏

简介

Continue 组件类似于 Break 组件,搭配 For Each 和 While 组件使用。Continue 的作用是跳出当前循环,执行下一次循环。

操作配置

参数配置

输出

组件输出的 message 信息如下:
message 属性
payload
在 For Each 组件中,Continue 跳出当前循环后,payload 的值为下一次循环遍历的数据。在 Whlie 组件中,Continue 跳出循环后,payload 继承自 Continue 的上一个组件输出的 payload。
error
无。
attribute
在 For Each 组件中使用时,Continue 跳出循环后,attribute 继承自 For Each 的上一个组件输出的 attribute;在 While 组件中使用时,Continue 跳出循环后,attribute 继承自 While 的上一个组件输出的 attribute。
variable
在 For Each 中使用时,Continue 跳出循环后,variable 中的变量继承自 Continue 的上一个组件输出的 variable 变量;在 While 组件中使用时,variable 中的变量继承自 Continue 的上一个组件输出的 variable 变量。

案例

在本案例中,我们使用 For Each 对列表中的奇数求和,遇到偶数,则使用 Continue 跳出当次循环。
1. 添加 For Each 组件,填入要遍历的集合[1,2,3,4,5]。
image-20210330141940166



image-20210330142019571


2. 添加 Choice 组件,在 When 节点中对数据进行筛选。
image-20210330143531318



image-20210330143502312


3. 在 When 节点中加入 Continue 节点。
image-20210330143642462