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 - parent:
FlowNodeEntity | undefinedGet the parent node (Such as loop) - document: WorkflowDocument 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
- lines: WorkflowNodeLinesData Get the node's lines data
- ports: WorkflowNodePortsData Get the node's ports data
- getNodeRegistry(): WorkflowNodeRegistry 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:
stringUnique identifier for the node, must be unique - meta:
objectNode's UI configuration information, such aspositioninformation for free layout - type:
string | numberNode type, corresponds totypeinnodeRegistries - data:
objectNode form data, can be customized by business - blocks:
arrayNode branches, usingblockis more suitable forGrammingfree layout scenarios, used in sub-nodes of sub-canvas - edges:
arrayEdge data of sub-canvas
Node Definition
In free layout scenarios, node definition is used to declare node's initial position/size, ports, form rendering, etc.
node-registries.tsx
Get Current Rendering Node
Get node-related methods through useNodeRender
Get Input/Output Nodes or Lines for Current Node
Create Node
- Through WorkflowDocument
- Through WorkflowDragService, see Free Layout Basic Usage
Delete Node
Delete node through node.dispose
Update Node Data
- Get node's data through useNodeRender or node.form
- Update form data through Field, see details in Form Usage
Update Node's extInfo Data
extInfo is used to store UI states, if node engine is not enabled, node's data will be stored in extInfo by default