RuleGo RuleGo
🏠首页
  • 快速入门
  • 规则链
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 可视化
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • 触发器
  • 高级主题
  • 性能
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 组件市场
  • 概述
  • 快速入门
  • 路由
  • DSL
  • API
  • Options
  • 组件
🔥编辑器 (opens new window)
  • 可视化编辑器 (opens new window)
  • RuleGo-Server (opens new window)
  • ❓问答

    • FAQ
💖支持
👥加入社区
  • Github (opens new window)
  • Gitee (opens new window)
  • GitCode (opens new window)
  • 更新日志 (opens new window)
  • English
  • 简体中文
🏠首页
  • 快速入门
  • 规则链
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 可视化
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • 触发器
  • 高级主题
  • 性能
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 组件市场
  • 概述
  • 快速入门
  • 路由
  • DSL
  • API
  • Options
  • 组件
🔥编辑器 (opens new window)
  • 可视化编辑器 (opens new window)
  • RuleGo-Server (opens new window)
  • ❓问答

    • FAQ
💖支持
👥加入社区
  • Github (opens new window)
  • Gitee (opens new window)
  • GitCode (opens new window)
  • 更新日志 (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • 快速入门

  • 规则链

  • 标准组件

    • 标准组件概述
    • 过滤器

      • js脚本过滤器
      • 字段过滤器
      • 消息路由
      • js脚本路由
      • 过滤器组
        • 配置
        • Relation Type
        • 执行结果
        • 配置示例
      • 表达式过滤器
      • 并行网关
      • 条件分支
    • 动作

    • 转换器

    • 外部的

    • 流

  • 扩展组件

  • 自定义组件

  • 组件市场

  • 可视化

  • AOP

  • 触发器

  • 高级主题

  • RuleGo-Server

  • 问题

目录

过滤器组

groupFilter组件:过滤器节点组。用于将多个过滤器节点组合成一个分组进行统一过滤判断。可以配置是要求所有节点都匹配(AND逻辑),还是任一节点匹配即可(OR逻辑)。

# 配置

字段 类型 是否必填 说明 默认值
allMatches bool 否 是否要求所有节点都匹配。true:AND逻辑,false:OR逻辑 false
nodeIds string 是 组内节点ID列表,多个ID用逗号分隔 -
timeout int 否 执行超时时间,单位秒,0表示不设置超时 0

# Relation Type

  • True: 当过滤条件满足时,消息将沿True链路径继续传递
    • 当allMatches=true时,需要所有节点都返回true才满足条件
    • 当allMatches=false时,任一节点返回true即满足条件
  • False: 当过滤条件不满足时,消息将沿False链路径继续传递
  • Failure: 当nodeIds为空或执行超时时,消息将沿Failure链路径继续传递

# 执行结果

该组件是纯过滤组件,不会修改传入的msg、metadata和msgType内容。仅根据组内节点的过滤结果决定消息的路由方向。

# 配置示例

参考示例:group_filter_node (opens new window)

//注意:规则链从第三个节点开始触发。firstNodeIndex=2
{
  "ruleChain": {
    "id": "rule01",
    "name": "测试规则链",
    "root": true
  },
  "metadata": {
    "firstNodeIndex": 2,
    "nodes": [
      {
        "id": "s1",
        "type": "jsFilter",
        "name": "过滤1",
        "debugMode": true,
        "configuration": {
          "jsScript": "return msg.temperature > 50;"
        }
      },
      {
        "id": "s2",
        "type": "jsFilter",
        "name": "过滤2",
        "debugMode": true,
        "configuration": {
          "jsScript": "return msg.humidity > 80;"
        }
      },
      {
        "id": "group1",
        "type": "groupFilter",
        "name": "过滤组",
        "debugMode": true,
        "configuration": {
          "allMatches": false,
          "nodeIds": "s1,s2"
        }
      },
      {
        "id": "s3",
        "type": "log",
        "name": "记录日志",
        "debugMode": false,
        "configuration": {
          "jsScript": "return 'call this node for True relation';"
        }
      },
      {
        "id": "s4",
        "type": "log",
        "name": "记录日志",
        "debugMode": false,
        "configuration": {
          "jsScript": "return 'call this node for False relation';"
        }
      }
    ],
    "connections": [
      {
        "fromId": "group1",
        "toId": "s3",
        "type": "True"
      },
      {
        "fromId": "group1",
        "toId": "s4",
        "type": "False"
      }
    ]
  }
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
在 GitHub 上编辑此页 (opens new window)
上次更新: 2025/04/02, 01:29:50
js脚本路由
表达式过滤器

← js脚本路由 表达式过滤器→

Theme by Vdoing | Copyright © 2023-2025 RuleGo Team | Apache 2.0 License

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式