FlowNodeEntity/WorkflowNodeEntity
Node entity, WorkflowNodeEntity is the alias for the node used for free layout nodes, the node entity uses the ECS architecture, is Entity
Properties
- id:
stringNode id - flowNodeType:
string|numberNode type - version
numberNode version, can be used to determine if the node state has been updated
Accessors
- document:
FlowDocument | WorkflowDocumentDocument link - 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 - transform: FlowNodeTransformData Get the node's transform matrix 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 (Only FreeLayout)
- ports: WorkflowNodePortsData Get the node's ports data (Only FreeLayout)
Methods
getExtInfo
Get the node's extended information, can be updated through updateExtInfo
updateExtInfo
Update extended data, update will not be recorded in redo/undo, if you need to record, please implement the history service
getNodeRegistry
Get the node registry, equivalent to ctx.document.getNodeRegistry(node.flowNodeType)
getData
Equivalent to getting the Component of Entity in the ECS architecture, currently built-in two core Components
addData
Equivalent to adding the Component of Entity in the ECS architecture
getService
Node access IOC service
dispose
Node destruction from canvas
onDispose
Node destruction event
toJSON
Export node data
Node data basic structure:
- id:
stringNode unique identifier, must be unique - meta:
objectNode ui configuration information, such aspositioninformation for free layout - type:
string | numberNode type, will correspond totypeinnodeRegistries - data:
objectNode form data, business can customize - blocks:
arrayNode branches, usingblockis closer toGramming