Nodes
Nodes are defined through FlowNodeEntity
Node Core API
- id:
stringNode id - flowNodeType:
string|numberNode type - bounds:
RectangleGet the node's x, y, width, height, equivalent totransform.bounds - blocks:
FlowNodeEntity[]Get child nodes, including collapsed child nodes, equivalent tocollapsedChildren - collapsedChildren:
FlowNodeEntity[]Get child nodes, including collapsed child nodes - allCollapsedChildren:
FlowNodeEntity[]Get all child nodes, including all collapsed child nodes - children:
FlowNodeEntity[]Get child nodes, not including collapsed child nodes - pre:
FlowNodeEntity | undefinedGet the previous node - next:
FlowNodeEntity | undefinedGet the next node - parent:
FlowNodeEntity | undefinedGet the parent node - originParent:
FlowNodeEntity | undefinedGet the original parent node, this is used to find the entire virtual branch for the first node of the fixed layout branch (orderIcon) - allChildren:
FlowNodeEntity[]Get all child nodes, not including collapsed child nodes - document: FlowDocument Document link
- transform: FlowNodeTransformData Get the node's transform data
- renderData: FlowNodeRenderData Get the node's render data, including render status
- form: NodeFormProps Get the node's form data, like getNodeForm
- scope: FlowNodeScope Get the node's variable public scope
- privateScope: FlowNodeScope Get the node's variable private scope
- getNodeRegistry(): FlowNodeRegistry Get the node's registry
- getService(): Get the IOC Service, such as
node.getService(HistoryService) - getExtInfo(): Get the node's ext info, such as
node.getExtInfo<{ test: string }>() - updateExtInfo(): Update the node's ext info, such as
node.updateExtInfo<{ test: string }>({ test: 'test' }) - dispose(): Destroy node
- toJSON(): Get the node's json data
Node Data
Can be obtained through node.toJSON()
Basic Structure:
- id:
stringNode unique identifier, must be unique - meta:
objectNode UI configuration information, such as free layoutpositioninformation is stored here - type:
string | numberNode type, corresponds totypeinnodeRegistries - data:
objectNode form data, can be customized by business - blocks:
arrayNode branches, usingblockis closer toGramming
Node Definition
Node declaration can be used to determine node type and rendering method
Getting Current Rendered Node
Get node-related methods through useNodeRender
Creating Nodes
Create through FlowOperationService
- Add node
- Add after specified node
- Add branch node (used for conditional branches)
Deleting Nodes
Updating Node Data
- Get node data through useNodeRender or node.form
- Update form data through Field, see Form Usage for details
Updating Node ExtInfo Data
ExtInfo is used to store some UI states. If node engine is not enabled, node data will be stored in extInfo by default