RuleGo RuleGo
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • Quick Start

  • Rule Chain

  • Standard Components

    • Standard Components Overview
    • filter

      • jsFilter
      • fieldFilter
      • msgTypeSwitch
      • jsSwitch
      • groupFilter
        • Configuration
        • Relation Type
        • Execution result
        • Configuration example
      • exprFilter
      • fork
      • Switch
    • action

    • transform

    • external

    • flow

  • Extension Components

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

目录

groupFilter

groupFilter component: filter node group. Groups multiple Filter nodes into a group, and if all nodes are True, sends the data to the True chain, otherwise sends it to the False chain. If allMatches=false, then as long as any node returns True, it sends it to the True chain

# Configuration

Field Type Required Description Default value
allMatches bool No Whether all nodes are required to match false
nodeIds string Yes List of node IDs in the group, multiple IDs separated by , -
timeout int No Execution timeout, in seconds, default: 0 means no timeout 0

# Relation Type

  • True: Send the message to the True chain
  • False: Send the message to the False chain
  • Failure: nodeIds is empty or execution timed out, send to the Failure chain

allMatches=true All nodes must match to send to the True chain, if false, then as long as any node matches, it sends to the True chain

# Execution result

This component will not change the content of msg, metadata and msgType.

# Configuration example

Reference example: group_filter_node (opens new window)

//Note: The rule chain starts from the third node. firstNodeIndex=2
{
  "ruleChain": {
    "id": "rule01",
    "name": "Test rule chain",
    "root": true
  },
  "metadata": {
    "firstNodeIndex": 2,
    "nodes": [
      {
        "id": "s1",
        "type": "jsFilter",
        "name": "Filter 1",
        "debugMode": true,
        "configuration": {
          "jsScript": "return msg.temperature > 50;"
        }
      },
      {
        "id": "s2",
        "type": "jsFilter",
        "name": "Filter 2",
        "debugMode": true,
        "configuration": {
          "jsScript": "return msg.humidity > 80;"
        }
      },
      {
        "id": "group1",
        "type": "groupFilter",
        "name": "Filter group",
        "debugMode": true,
        "configuration": {
          "allMatches": false,
          "nodeIds": "s1,s2"
        }
      },
      {
        "id": "s3",
        "type": "log",
        "name": "Log",
        "debugMode": false,
        "configuration": {
          "jsScript": "return 'call this node for True relation';"
        }
      },
      {
        "id": "s4",
        "type": "log",
        "name": "Log",
        "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
Edit this page on GitHub (opens new window)
Last Updated: 2025/04/02, 01:29:50
jsSwitch
exprFilter

← jsSwitch exprFilter→

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

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