流程控制
动态收件人
type recipientList
表达式返回逗号分隔的 URI 列表
使用说明
要点:动态收件人:表达式返回逗号分隔的 URI 字符串,例如 direct:a,direct:b。
属性
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
recipients收件人表达式 |
表达式 | 必填 | — | |
parallelProcessing并行处理 |
布尔 | 可选 | false |
|
stopOnException异常即停 |
布尔 | 可选 | false |
|
aggregationStrategy聚合策略 Bean |
文本 | 可选 | — |
示例流程
可直接保存为 demo-recipientList.json 并部署;非入口节点默认套了一个 REST 入口。
{
"id": "demo-recipientList",
"desc": "动态收件人 示例",
"group": "示例/流程控制",
"schemaVersion": 1,
"nodes": [
{
"id": "n1",
"type": "rest",
"props": {
"method": "POST",
"path": "/demo/recipientList",
"desc": "示例入口"
}
},
{
"type": "recipientList",
"props": {
"recipients": {
"lang": "simple",
"script": "direct:notifyEmail,direct:notifySms"
},
"parallelProcessing": true,
"stopOnException": false
},
"id": "n1"
}
]
}
curl -X POST 'http://localhost:8086/flow' \
-H 'Content-Type: application/json' \
-H 'X-Flow-Token: change-me' \
--data-binary @demo-recipientList.json
调用方式
如何触发:需要先定义 direct:notifyEmail 与 direct:notifySms 两条子流程或路由。