Class

GraphWorkflowDocumentBuilder

GraphWorkflowDocumentBuilder(id, name)

Fluent builder for the canonical GraphWorkflowDocument (DECAF-50 ยง4.4.4). Collects boundary ports, node instances, edges, and optional settings/metadata/UI state, then validates and freezes a defensively-copied document on GraphWorkflowDocumentBuilder.build.

Constructor

# new GraphWorkflowDocumentBuilder(id, name)

Parameters:
Name Type Description
id

Document id.

name

Optional document name; defaults to an empty string.

View Source graph/document/GraphWorkflowDocumentBuilder.ts, line 13

Classes

GraphWorkflowDocumentBuilder
GraphWorkflowDocumentBuilder

Methods

# addEdge(edge) → {this}

Appends an edge instance.

Appends an edge instance.

Parameters:
Name Type Description
edge GraphEdgeInstance

View Source graph/document/GraphWorkflowDocumentBuilder.ts, line 364

this

# addInput(port) → {this}

Appends a workflow input port.

Appends a workflow input port.

Parameters:
Name Type Description
port GraphWorkflowPortInput

View Source graph/document/GraphWorkflowDocumentBuilder.ts, line 346

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

View Source graph/document/GraphWorkflowDocumentBuilder.ts, line 358

this

# addOutput(port) → {this}

Appends a workflow output port.

Appends a workflow output port.

Parameters:
Name Type Description
port GraphWorkflowPortInput

View Source graph/document/GraphWorkflowDocumentBuilder.ts, line 352

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.

View Source graph/document/GraphWorkflowDocumentBuilder.ts, line 394

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>

View Source graph/document/GraphWorkflowDocumentBuilder.ts, line 376

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>

View Source graph/document/GraphWorkflowDocumentBuilder.ts, line 370

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>

View Source graph/document/GraphWorkflowDocumentBuilder.ts, line 382

this