# new GraphWorkflowDocumentBuilder(id, name)
Parameters:
| Name | Type | Description |
|---|---|---|
id |
Document id. |
|
name |
Optional document name; defaults to an empty string. |
Classes
Methods
# addEdge(edge) → {this}
Appends an edge instance.
Appends an edge instance.
Parameters:
| Name | Type | Description |
|---|---|---|
edge |
GraphEdgeInstance
|
this
# addInput(port) → {this}
Appends a workflow input port.
Appends a workflow input port.
Parameters:
| Name | Type | Description |
|---|---|---|
port |
GraphWorkflowPortInput
|
this
# addNode(node) → {this}
Appends a node instance, defaulting parameters to an empty object.
Appends a node instance, defaulting parameters to an empty object.
Parameters:
| Name | Type | Description |
|---|---|---|
node |
GraphNodeInstance
|
this
# addOutput(port) → {this}
Appends a workflow output port.
Appends a workflow output port.
Parameters:
| Name | Type | Description |
|---|---|---|
port |
GraphWorkflowPortInput
|
this
# build() → {GraphWorkflowDocument}
Validates the accumulated document with
assertGraphWorkflowDocumentValid and returns a deep-ish copy:
ports, nodes, and edges are cloned per entry, and the optional
settings/metadata/ui bags are only present when explicitly set, so
callers never observe builder-internal undefined fields.
Validates the accumulated document with
assertGraphWorkflowDocumentValid and returns a deep-ish copy:
ports, nodes, and edges are cloned per entry, and the optional
settings/metadata/ui bags are only present when explicitly set, so
callers never observe builder-internal undefined fields.
ValidationError when the document fails validation.
GraphWorkflowDocument
# setMetadata(metadataopt) → {this}
Sets (or clears) the document's metadata bag.
Sets (or clears) the document's metadata bag.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
metadata |
Record.<string, GraphJsonValue>
|
<optional> |
this
# setSettings(settingsopt) → {this}
Sets (or clears) the document's free-form settings bag.
Sets (or clears) the document's free-form settings bag.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
settings |
GraphWorkflowSettings
|
<optional> |
this
# setUi(uiopt) → {this}
Sets (or clears) the document's editor UI state.
Sets (or clears) the document's editor UI state.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
ui |
GraphWorkflowUiState
|
<optional> |
this