Batch Initialize Rule Chain
You can specify a folder path, load all rule chain configuration files with the suffix .json
, and initialize the corresponding rule engine instances to the rule engine instance pool. Example:
config := rulego.NewConfig()
err := rulego.Load("./chains/", rulego.WithConfig(config))
1
2
2
Warning:
Each rule chain file needs to specify an Id, and ensure its uniqueness. For example:
{
"ruleChain": {
"id": "chain_call_rest_api",
...
},
"metadata": {}
}
1
2
3
4
5
6
7
2
3
4
5
6
7
Then get the rule chain instance by the rule chain ID:
ruleEngine, ok := rulego.Get("chain_call_rest_api")
1
Edit this page on GitHub (opens new window)
Last Updated: 2024/10/23, 10:13:01