Get Rule Chain Node Configuration
Get the configuration of the specified child node under the specified instantiated rule chain. Used for rule chain visual configuration echo.
func (e *RuleEngine) NodeDSL(subChainId types.RuleNodeId, childNodeId types.RuleNodeId) []byte
1
- subChainId: Sub-rule chain ID, if querying the root rule chain node, fill in:
types.EmptyRuleNodeId
- childNodeId: Child node ID, for example:
types.RuleNodeId{Id: nodeId}
- Return: Node instantiation configuration (JSON structure)
Example:
// Get the rule chain instance that has been created by the rule chain ID
ruleEngine,_:rulego.Get(chainId)
// Get the rule chain child node configuration
def = ruleEngine.NodeDSL(types.EmptyRuleNodeId, types.RuleNodeId{Id: nodeId, Type: types.NODE})
fmt.Println(string(def))
1
2
3
4
5
2
3
4
5
The rule chain node configuration supports dynamic updates, dynamic replacement of business logic and component configuration, refer to the documentation. Used for rule chain modification.
Edit this page on GitHub (opens new window)
Last Updated: 2024/10/23, 10:13:01