Node Components
Allow to define the rule chain node components and their configuration forms that the editor can drag and drop by configuration. The format of the rule chain node component list, using ruleGo to provide the component list API (opens new window) format, this API can dynamically scan the rule chain node components and their forms registered to RuleGo, but some internationalization and form validation rules need to be provided on the front end. The node component list will render the toolbar on the left.
You can also modify the node component list by modifying the source files: node component definition and internationalization file: src/components/utils/default.js: Node component definition. src/components/utils/local_zh.js: Node component form internationalization definition.
# ComponentForm
Field | Type | Description |
---|---|---|
type | string | Component identifier |
category | string | Component classification |
fields | []ComponentFormField | Component configuration form fields |
label | string | Display name of the component |
desc | string | Component description |
icon | string | Icon, if empty, use public/images/${category}.svg |
relationTypes | []string | Node connection options, if empty, users can define their own connection relationships |
# ComponentFormField
Field | Type | Description |
---|---|---|
name | string | Field name |
type | string | Field type |
defaultValue | any | Default value |
label | string | Display name of the field |
desc | string | Detailed field description |
rules | []rule | Field validation rules |
fields | []ComponentFormField | Nested fields, Type=struct, nested fields |
# rule
By configuring rules, components allow you to validate if a user's input meets certain specifications to help you identify and correct errors. For more advanced usage, refer to async-validator (opens new window). Example:
[
{ "required": true, "message": "The name is required"}
]
2
3