# @axway/api-builder-flow-graph

> Graph structure for parsing and manipulating flows.

Latest version **4.0.0** (published 2022-09-09) · SEE LICENCE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install @axway/api-builder-flow-graph
pnpm add @axway/api-builder-flow-graph
yarn add @axway/api-builder-flow-graph
bun add @axway/api-builder-flow-graph
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2022-09-09 |
| First published | 2022-09-09 |
| Weekly downloads | 0 |
| License | SEE LICENCE IN LICENSE |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 16 |
| Dependencies | 0 |
| Unpacked size | 155.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Axway |
| Maintainers | nkeranova, axway-npm, cb1kenobi, jamie.peabody, awam, bladedancer, axway_darnaudov, ddimonov-axway, neon-axway, vchauhan, mdimitrova, pdzhorev, axway_alasdair, pltod2, npetrovski-axway, pbozhkovaxway, mbonchev-axway, axway-vertex, cdobrica |
| Keywords | amplify, api-builder, axway, @axway/flow, graph |

## Links

- npm: https://www.npmjs.com/package/@axway/api-builder-flow-graph
- Homepage: https://platform.axway.com
- Issues: https://axway.com
- npm.io page: https://npm.io/package/@axway/api-builder-flow-graph

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2022-09-09

## README

# @axway/api-builder-flow-graph

Graph structure for parsing and manipulating flows.

# API Reference

<a name="module_api-builder-flow-graph..FlowGraph"></a>

### api-builder-flow-graph~FlowGraph
**Kind**: inner class of [<code>api-builder-flow-graph</code>](#module_api-builder-flow-graph)  

* [~FlowGraph](#module_api-builder-flow-graph..FlowGraph)
    * [new FlowGraph()](#new_module_api-builder-flow-graph..FlowGraph_new)
    * [new FlowGraph(flowId, flowdef)](#new_module_api-builder-flow-graph..FlowGraph_new)
    * [._ensureVertex(vertexId, info)](#module_api-builder-flow-graph..FlowGraph+_ensureVertex) ⇒ <code>object</code>
    * [._deleteVertex(vertexId)](#module_api-builder-flow-graph..FlowGraph+_deleteVertex)
    * [._getVertexChildren(vertexId, output, [idsOnly])](#module_api-builder-flow-graph..FlowGraph+_getVertexChildren) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [._getVertexParents(vertexId, [idsOnly])](#module_api-builder-flow-graph..FlowGraph+_getVertexParents) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [._ensureEdge(output, fromId, toId)](#module_api-builder-flow-graph..FlowGraph+_ensureEdge) ⇒ <code>object</code>
    * [._deleteEdge(fromId, output, toId)](#module_api-builder-flow-graph..FlowGraph+_deleteEdge)
    * [._deleteEdges(fromId, toId)](#module_api-builder-flow-graph..FlowGraph+_deleteEdges)
    * [._setValidation(validation)](#module_api-builder-flow-graph..FlowGraph+_setValidation)
    * [._getOutputRoutes(nodeId)](#module_api-builder-flow-graph..FlowGraph+_getOutputRoutes) ⇒ <code>object</code>
    * [._onChange()](#module_api-builder-flow-graph..FlowGraph+_onChange)
    * [._buildGraph()](#module_api-builder-flow-graph..FlowGraph+_buildGraph)
    * [._buildVertex(nodeId)](#module_api-builder-flow-graph..FlowGraph+_buildVertex)
    * [.changeNodeName(nodeId, name)](#module_api-builder-flow-graph..FlowGraph+changeNodeName)
    * [.changeMethod(nodeId, method, nodehandler)](#module_api-builder-flow-graph..FlowGraph+changeMethod)
    * [.insertNode(node, nodeId)](#module_api-builder-flow-graph..FlowGraph+insertNode) ⇒ <code>string</code>
    * [.deleteNode(nodeId)](#module_api-builder-flow-graph..FlowGraph+deleteNode)
    * [.deleteRoute(output, fromId, toId)](#module_api-builder-flow-graph..FlowGraph+deleteRoute)
    * [.deleteRoutes(fromId, toId)](#module_api-builder-flow-graph..FlowGraph+deleteRoutes)
    * [.setStart(nodeId)](#module_api-builder-flow-graph..FlowGraph+setStart)
    * [.unsetStart()](#module_api-builder-flow-graph..FlowGraph+unsetStart)
    * [.addParameter(nodeId, name, value, [type])](#module_api-builder-flow-graph..FlowGraph+addParameter)
    * [.updateParameter(nodeId, name, prop, newValue)](#module_api-builder-flow-graph..FlowGraph+updateParameter)
    * [.removeParameter(nodeId, name)](#module_api-builder-flow-graph..FlowGraph+removeParameter) ⇒ <code>object</code>
    * [.addAuthorization(nodeId, name, value, [type])](#module_api-builder-flow-graph..FlowGraph+addAuthorization)
    * [.updateAuthorization(nodeId, name, prop, newValue)](#module_api-builder-flow-graph..FlowGraph+updateAuthorization)
    * [.removeAuthorization(nodeId, name)](#module_api-builder-flow-graph..FlowGraph+removeAuthorization) ⇒ <code>object</code>
    * [._addParameter(location, nodeId, name, value, [type])](#module_api-builder-flow-graph..FlowGraph+_addParameter)
    * [._getParameter(location, nodeId, name)](#module_api-builder-flow-graph..FlowGraph+_getParameter) ⇒ <code>object</code>
    * [._getParameterIndex(location, nodeId, name)](#module_api-builder-flow-graph..FlowGraph+_getParameterIndex) ⇒ <code>number</code>
    * [._updateParameter(location, nodeId, name, prop, newValue)](#module_api-builder-flow-graph..FlowGraph+_updateParameter)
    * [._removeParameterByName(location, nodeId, name)](#module_api-builder-flow-graph..FlowGraph+_removeParameterByName) ⇒ <code>object</code>
    * [._removeParameter(location, nodeId, index)](#module_api-builder-flow-graph..FlowGraph+_removeParameter) ⇒ <code>object</code>
    * [.updateOutputContext(nodeId, name, value)](#module_api-builder-flow-graph..FlowGraph+updateOutputContext)
    * [.connectNode(sourceId, sourceOutput, targetId)](#module_api-builder-flow-graph..FlowGraph+connectNode)
    * [.disconnectNode(sourceId, sourceOutput, targetId)](#module_api-builder-flow-graph..FlowGraph+disconnectNode)
    * [.isEmpty()](#module_api-builder-flow-graph..FlowGraph+isEmpty) ⇒ <code>boolean</code>
    * [.getName()](#module_api-builder-flow-graph..FlowGraph+getName) ⇒ <code>string</code>
    * [.setName(name)](#module_api-builder-flow-graph..FlowGraph+setName)
    * [.getDescription()](#module_api-builder-flow-graph..FlowGraph+getDescription) ⇒ <code>string</code>
    * [.setDescription(description)](#module_api-builder-flow-graph..FlowGraph+setDescription)
    * [.getSymbol()](#module_api-builder-flow-graph..FlowGraph+getSymbol) ⇒ <code>symbol</code>
    * [.getDefinition()](#module_api-builder-flow-graph..FlowGraph+getDefinition) ⇒ <code>object</code>
    * [.getGraph()](#module_api-builder-flow-graph..FlowGraph+getGraph) ⇒ <code>object</code>
    * [.getId()](#module_api-builder-flow-graph..FlowGraph+getId) ⇒ <code>string</code>
    * [.getEdges()](#module_api-builder-flow-graph..FlowGraph+getEdges) ⇒ <code>Array.&lt;object&gt;</code>
    * [.getEdge(output, fromId, toId)](#module_api-builder-flow-graph..FlowGraph+getEdge) ⇒ <code>object</code> \| <code>null</code>
    * [.getVertices([idsOnly])](#module_api-builder-flow-graph..FlowGraph+getVertices) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [.getNodes([idsOnly])](#module_api-builder-flow-graph..FlowGraph+getNodes) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [.getChildren(nodeId, output, [idsOnly])](#module_api-builder-flow-graph..FlowGraph+getChildren) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [.getParents(nodeId, [idsOnly])](#module_api-builder-flow-graph..FlowGraph+getParents) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [.getTerminalNodes([idsOnly])](#module_api-builder-flow-graph..FlowGraph+getTerminalNodes) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [.getVertex(vertexId)](#module_api-builder-flow-graph..FlowGraph+getVertex) ⇒ <code>object</code>
    * [.getNode(nodeId)](#module_api-builder-flow-graph..FlowGraph+getNode) ⇒ <code>object</code> \| <code>null</code>
    * [.getNodeUnsafe(nodeId)](#module_api-builder-flow-graph..FlowGraph+getNodeUnsafe) ⇒ <code>object</code>
    * [.getValidation()](#module_api-builder-flow-graph..FlowGraph+getValidation) ⇒ <code>object</code>
    * [.registerValidator(validator)](#module_api-builder-flow-graph..FlowGraph+registerValidator)
    * [.validate()](#module_api-builder-flow-graph..FlowGraph+validate) ⇒ <code>object</code>

<a name="new_module_api-builder-flow-graph..FlowGraph_new"></a>

#### new FlowGraph()
FlowGraph object

<a name="new_module_api-builder-flow-graph..FlowGraph_new"></a>

#### new FlowGraph(flowId, flowdef)
Creates an instance of FlowGraph.


| Param | Type | Description |
| --- | --- | --- |
| flowId | <code>string</code> | The id of this flow. |
| flowdef | <code>object</code> | The flow definition. |

<a name="module_api-builder-flow-graph..FlowGraph+_ensureVertex"></a>

#### flowGraph.\_ensureVertex(vertexId, info) ⇒ <code>object</code>
Ensures that a vertex will exist

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the vertex which matched or was created.  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| vertexId | <code>string</code> | the ID of the vertex |
| info | <code>object</code> | info to be set on the vertex. If vertex already exists, the info will                      be merged with the existing info. |

<a name="module_api-builder-flow-graph..FlowGraph+_deleteVertex"></a>

#### flowGraph.\_deleteVertex(vertexId)
Deletes a vertex from the graph

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| vertexId | <code>string</code> | the id of the vertex to delete |

<a name="module_api-builder-flow-graph..FlowGraph+_getVertexChildren"></a>

#### flowGraph.\_getVertexChildren(vertexId, output, [idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the children of a vertex in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the child vertices of a vertex in the flow  

| Param | Type | Description |
| --- | --- | --- |
| vertexId | <code>string</code> | the Id of the vertex to get children for. |
| output | <code>string</code> | the vetex output to get the children for. |
| [idsOnly] | <code>bool</code> | if the vertex idsOnly should be returned rather than the vertices |

<a name="module_api-builder-flow-graph..FlowGraph+_getVertexParents"></a>

#### flowGraph.\_getVertexParents(vertexId, [idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the parents of a vertex in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the parent nodes of a vertex in the flow  

| Param | Type | Description |
| --- | --- | --- |
| vertexId | <code>string</code> | the Id of the vertex to get parents for. |
| [idsOnly] | <code>bool</code> | if the vertex ids should be returned rather than the vertices |

<a name="module_api-builder-flow-graph..FlowGraph+_ensureEdge"></a>

#### flowGraph.\_ensureEdge(output, fromId, toId) ⇒ <code>object</code>
Ensures that an edge will exist between any two vertices. If any of the vertices do not
exist, they will be created.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the edge which matched or was created.  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| output | <code>string</code> | the vertex output group the edge belongs to. |
| fromId | <code>string</code> | the ID of the vertex where the edge starts |
| toId | <code>string</code> | this ID of the vertex where the edge ends |

<a name="module_api-builder-flow-graph..FlowGraph+_deleteEdge"></a>

#### flowGraph.\_deleteEdge(fromId, output, toId)
Deletes an edge from one node to another.
Removes the parent/child where necesarry from each vertex.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| fromId | <code>string</code> | the vertex where the edge starts |
| output | <code>string</code> | the vertex output group the edge belongs to. |
| toId | <code>string</code> | the vertex where the edge ends |

<a name="module_api-builder-flow-graph..FlowGraph+_deleteEdges"></a>

#### flowGraph.\_deleteEdges(fromId, toId)
Deletes the edges from one node to another (across all outputs).
Removes the parent/child where necesarry from each vertex.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| fromId | <code>string</code> | the vertex where the edge starts |
| toId | <code>string</code> | the vertex where the edge ends |

<a name="module_api-builder-flow-graph..FlowGraph+_setValidation"></a>

#### flowGraph.\_setValidation(validation)
Sets the validation state on the flow definition

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| validation | <code>object</code> | the validation state |

<a name="module_api-builder-flow-graph..FlowGraph+_getOutputRoutes"></a>

#### flowGraph.\_getOutputRoutes(nodeId) ⇒ <code>object</code>
Gets a list of all nodes which a node may route to grouped by output.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - A map of IDs for routes from the node specified grouped by output.  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the ID of a node to get routes for |

<a name="module_api-builder-flow-graph..FlowGraph+_onChange"></a>

#### flowGraph.\_onChange()
Generates a unique symbol of the flow. Should be called whenever the flow changes.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
<a name="module_api-builder-flow-graph..FlowGraph+_buildGraph"></a>

#### flowGraph.\_buildGraph()
Build a graph from the flow definition.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Access**: protected  
<a name="module_api-builder-flow-graph..FlowGraph+_buildVertex"></a>

#### flowGraph.\_buildVertex(nodeId)
Builds a vertex for a nodeId

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | The nodeId from which to build a vertex. |

<a name="module_api-builder-flow-graph..FlowGraph+changeNodeName"></a>

#### flowGraph.changeNodeName(nodeId, name)
Sets the name of a node

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | Node ID |
| name | <code>string</code> | New node name |

<a name="module_api-builder-flow-graph..FlowGraph+changeMethod"></a>

#### flowGraph.changeMethod(nodeId, method, nodehandler)
Modifies the method of a node to match a new spec

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | The id of the node to update. |
| method | <code>string</code> | the method to use |
| nodehandler | <code>object</code> | the node handler in use |

<a name="module_api-builder-flow-graph..FlowGraph+insertNode"></a>

#### flowGraph.insertNode(node, nodeId) ⇒ <code>string</code>
Inserts a node into the flow graph.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>string</code> - - the inserted nodeId  

| Param | Type | Description |
| --- | --- | --- |
| node | <code>object</code> | The node to insert. |
| nodeId | <code>string</code> | The id of the node to insert.  If supplied, it must be unique.  If not supplied, the node id will be generated. |

<a name="module_api-builder-flow-graph..FlowGraph+deleteNode"></a>

#### flowGraph.deleteNode(nodeId)
Delete a specific node from the flow.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the id of the node to delete |

<a name="module_api-builder-flow-graph..FlowGraph+deleteRoute"></a>

#### flowGraph.deleteRoute(output, fromId, toId)
Delete the output route from one node to another.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| output | <code>string</code> | the output to delete the route for. |
| fromId | <code>string</code> | the node id the routes are being deleted from. |
| toId | <code>string</code> | the node id being removed from the routes. |

<a name="module_api-builder-flow-graph..FlowGraph+deleteRoutes"></a>

#### flowGraph.deleteRoutes(fromId, toId)
Delete all the output routes from one node to another.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| fromId | <code>string</code> | the node id the routes are being deleted from. |
| toId | <code>string</code> | the node id being removed from the routes. |

<a name="module_api-builder-flow-graph..FlowGraph+setStart"></a>

#### flowGraph.setStart(nodeId)
Sets a node as the start node for the flow.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | The start node for the flow. |

<a name="module_api-builder-flow-graph..FlowGraph+unsetStart"></a>

#### flowGraph.unsetStart()
Clears the start node for the flow.  This action will make the flow invalid.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
<a name="module_api-builder-flow-graph..FlowGraph+addParameter"></a>

#### flowGraph.addParameter(nodeId, name, value, [type])
Adds a parameter to a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| nodeId | <code>string</code> |  | the node id |
| name | <code>string</code> |  | the name of the parameter |
| value | <code>string</code> |  | the value of the parameter |
| [type] | <code>string</code> | <code>&quot;jsonpath&quot;</code> | the type of the parameter. |

<a name="module_api-builder-flow-graph..FlowGraph+updateParameter"></a>

#### flowGraph.updateParameter(nodeId, name, prop, newValue)
Updates a parameter from a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the current name of the parameter |
| prop | <code>string</code> \| <code>object</code> | the field to update (name|type|value) if string,                               or the new value of the parameter |
| newValue | <code>string</code> | the new value of the prop specified if it is a string |

<a name="module_api-builder-flow-graph..FlowGraph+removeParameter"></a>

#### flowGraph.removeParameter(nodeId, name) ⇒ <code>object</code>
Removes a parameter by name from a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the parameter that was removed  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the name of the parameter |

<a name="module_api-builder-flow-graph..FlowGraph+addAuthorization"></a>

#### flowGraph.addAuthorization(nodeId, name, value, [type])
Adds a authorization parameter to a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| nodeId | <code>string</code> |  | the node id |
| name | <code>string</code> |  | the name of the parameter |
| value | <code>string</code> |  | the value of the parameter |
| [type] | <code>string</code> | <code>&quot;jsonpath&quot;</code> | the type of the parameter. |

<a name="module_api-builder-flow-graph..FlowGraph+updateAuthorization"></a>

#### flowGraph.updateAuthorization(nodeId, name, prop, newValue)
Updates a authorization parameter from a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the current name of the parameter |
| prop | <code>string</code> \| <code>object</code> | the field to update (name|type|value) if string,                               or the new value of the parameter |
| newValue | <code>string</code> | the new value of the prop specified if it is a string |

<a name="module_api-builder-flow-graph..FlowGraph+removeAuthorization"></a>

#### flowGraph.removeAuthorization(nodeId, name) ⇒ <code>object</code>
Removes a authorization parameter by name from a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the parameter that was removed  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the name of the parameter |

<a name="module_api-builder-flow-graph..FlowGraph+_addParameter"></a>

#### flowGraph.\_addParameter(location, nodeId, name, value, [type])
Adds a parameter to a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| location | <code>string</code> |  | the parameter location, one of: parameters|authorizations |
| nodeId | <code>string</code> |  | the node id |
| name | <code>string</code> |  | the name of the parameter |
| value | <code>string</code> |  | the value of the parameter |
| [type] | <code>string</code> | <code>&quot;jsonpath&quot;</code> | the type of the parameter. |

<a name="module_api-builder-flow-graph..FlowGraph+_getParameter"></a>

#### flowGraph.\_getParameter(location, nodeId, name) ⇒ <code>object</code>
Gets a parameter from the node by name

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the parameter  

| Param | Type | Description |
| --- | --- | --- |
| location | <code>string</code> | the parameter location, one of: parameters|authorizations |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the name of the parameter |

<a name="module_api-builder-flow-graph..FlowGraph+_getParameterIndex"></a>

#### flowGraph.\_getParameterIndex(location, nodeId, name) ⇒ <code>number</code>
Gets a parameter index from the node by name

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>number</code> - the parameter index  

| Param | Type | Description |
| --- | --- | --- |
| location | <code>string</code> | the parameter location, one of: parameters|authorizations |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the name of the parameter |

<a name="module_api-builder-flow-graph..FlowGraph+_updateParameter"></a>

#### flowGraph.\_updateParameter(location, nodeId, name, prop, newValue)
Updates a parameter from a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| location | <code>string</code> | the parameter location, one of: parameters|authorizations |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the current name of the parameter |
| prop | <code>string</code> \| <code>object</code> | the field to update (name|type|value) if string,                               or the new value of the parameter |
| newValue | <code>string</code> | the new value of the prop specified if it is a string |

<a name="module_api-builder-flow-graph..FlowGraph+_removeParameterByName"></a>

#### flowGraph.\_removeParameterByName(location, nodeId, name) ⇒ <code>object</code>
Removes a parameter by name from a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the parameter that was removed  

| Param | Type | Description |
| --- | --- | --- |
| location | <code>string</code> | the parameter location, one of: parameters|authorizations |
| nodeId | <code>string</code> | the node id |
| name | <code>number</code> | the name of the parameter |

<a name="module_api-builder-flow-graph..FlowGraph+_removeParameter"></a>

#### flowGraph.\_removeParameter(location, nodeId, index) ⇒ <code>object</code>
Removes a parameter by index from a node in the flow.  Does not trigger change.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the parameter that was removed  

| Param | Type | Description |
| --- | --- | --- |
| location | <code>string</code> | the parameter location, one of: parameters|authorizations |
| nodeId | <code>string</code> | the node id |
| index | <code>number</code> | the index of the parameter |

<a name="module_api-builder-flow-graph..FlowGraph+updateOutputContext"></a>

#### flowGraph.updateOutputContext(nodeId, name, value)
Modifies the JSONPath context of an output

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the name of the output |
| value | <code>string</code> | the new JSONPath context |

<a name="module_api-builder-flow-graph..FlowGraph+connectNode"></a>

#### flowGraph.connectNode(sourceId, sourceOutput, targetId)
Connects a node output to the specified target.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| sourceId | <code>string</code> | The source node for the connection. |
| sourceOutput | <code>string</code> | The output in the source node for the connection. |
| targetId | <code>string</code> | The id of the target node to connect to. |

<a name="module_api-builder-flow-graph..FlowGraph+disconnectNode"></a>

#### flowGraph.disconnectNode(sourceId, sourceOutput, targetId)
Disconnects a target node from a parent node's source and output.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| sourceId | <code>string</code> | The source node for the connection. |
| sourceOutput | <code>string</code> | The output in the source node for the connection. |
| targetId | <code>string</code> | The id of the target node to connect to. |

<a name="module_api-builder-flow-graph..FlowGraph+isEmpty"></a>

#### flowGraph.isEmpty() ⇒ <code>boolean</code>
Indicates if the flow is empty, with no nodes.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>boolean</code> - `true` if the flow is empty.  
<a name="module_api-builder-flow-graph..FlowGraph+getName"></a>

#### flowGraph.getName() ⇒ <code>string</code>
Gets the name of the flow from flow info meta-data.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>string</code> - The flow name.  
<a name="module_api-builder-flow-graph..FlowGraph+setName"></a>

#### flowGraph.setName(name)
Sets the name of the flow.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| name | <code>string</code> | The flow name. |

<a name="module_api-builder-flow-graph..FlowGraph+getDescription"></a>

#### flowGraph.getDescription() ⇒ <code>string</code>
Gets the description of the flow from flow info meta-data.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>string</code> - The flow description.  
<a name="module_api-builder-flow-graph..FlowGraph+setDescription"></a>

#### flowGraph.setDescription(description)
Sets the description of the flow.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| description | <code>string</code> | The flow description. |

<a name="module_api-builder-flow-graph..FlowGraph+getSymbol"></a>

#### flowGraph.getSymbol() ⇒ <code>symbol</code>
Get the unique symbol of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>symbol</code> - the flow symbol  
<a name="module_api-builder-flow-graph..FlowGraph+getDefinition"></a>

#### flowGraph.getDefinition() ⇒ <code>object</code>
Gets the definition of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the flow definition  
<a name="module_api-builder-flow-graph..FlowGraph+getGraph"></a>

#### flowGraph.getGraph() ⇒ <code>object</code>
Gets the graph representation of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the flow graph representation  
<a name="module_api-builder-flow-graph..FlowGraph+getId"></a>

#### flowGraph.getId() ⇒ <code>string</code>
Gets the Id of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>string</code> - the flow id  
<a name="module_api-builder-flow-graph..FlowGraph+getEdges"></a>

#### flowGraph.getEdges() ⇒ <code>Array.&lt;object&gt;</code>
Gets the edges of the flow graph

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;object&gt;</code> - the edges of the graph  
<a name="module_api-builder-flow-graph..FlowGraph+getEdge"></a>

#### flowGraph.getEdge(output, fromId, toId) ⇒ <code>object</code> \| <code>null</code>
Get the edge between two nodes.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> \| <code>null</code> - the edge between two nodes. Null if no edge exists.  

| Param | Type | Description |
| --- | --- | --- |
| output | <code>string</code> | the node output the edges belong to. |
| fromId | <code>string</code> | the ID of the vertex where the edge starts |
| toId | <code>string</code> | this ID of the vertex where the edge ends |

<a name="module_api-builder-flow-graph..FlowGraph+getVertices"></a>

#### flowGraph.getVertices([idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the vertices of the graph

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the vertices of the graph  

| Param | Type | Description |
| --- | --- | --- |
| [idsOnly] | <code>bool</code> | if the vertex ids should be returned rather than the vertices |

<a name="module_api-builder-flow-graph..FlowGraph+getNodes"></a>

#### flowGraph.getNodes([idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the nodes of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the nodes of the flow  

| Param | Type | Description |
| --- | --- | --- |
| [idsOnly] | <code>bool</code> | if the node ids should be returned rather than the nodes |

<a name="module_api-builder-flow-graph..FlowGraph+getChildren"></a>

#### flowGraph.getChildren(nodeId, output, [idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the children of a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the child nodes of a node in the flow  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the Id of the node to get children for. |
| output | <code>string</code> | the node output to get the children for.                          If omitted then all children are returned. |
| [idsOnly] | <code>bool</code> | if the node idsOnly should be returned rather than the nodes |

<a name="module_api-builder-flow-graph..FlowGraph+getParents"></a>

#### flowGraph.getParents(nodeId, [idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the parents of a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the parent nodes of a node in the flow  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the Id of the node to get parents for. |
| [idsOnly] | <code>bool</code> | if the node ids should be returned rather than the nodes |

<a name="module_api-builder-flow-graph..FlowGraph+getTerminalNodes"></a>

#### flowGraph.getTerminalNodes([idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the terminal nodes of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the terminal nodes of the flow  

| Param | Type | Description |
| --- | --- | --- |
| [idsOnly] | <code>bool</code> | if the node ids should be returned rather than the nodes |

<a name="module_api-builder-flow-graph..FlowGraph+getVertex"></a>

#### flowGraph.getVertex(vertexId) ⇒ <code>object</code>
Get the vertex which matches the ID specified

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - a vertex in the graph  

| Param | Type | Description |
| --- | --- | --- |
| vertexId | <code>string</code> | the ID of the vertex to return |

<a name="module_api-builder-flow-graph..FlowGraph+getNode"></a>

#### flowGraph.getNode(nodeId) ⇒ <code>object</code> \| <code>null</code>
Get the node which matches the ID specified

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> \| <code>null</code> - a node in the flow, or null  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the ID of the node to return |

<a name="module_api-builder-flow-graph..FlowGraph+getNodeUnsafe"></a>

#### flowGraph.getNodeUnsafe(nodeId) ⇒ <code>object</code>
Get the node which matches the ID specified and will throw an error if node was not found.
Call this if you expect the node to exist

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - a node in the flow  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the ID of the node to return |

<a name="module_api-builder-flow-graph..FlowGraph+getValidation"></a>

#### flowGraph.getValidation() ⇒ <code>object</code>
Get the validation state of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the validation state of the flow  
<a name="module_api-builder-flow-graph..FlowGraph+registerValidator"></a>

#### flowGraph.registerValidator(validator)
Registers a FlowValidator type class to the flow. When validation is run, this class will
be used to validate the flow.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| validator | <code>FlowValidator</code> | A class which is a FlowValidator |

<a name="module_api-builder-flow-graph..FlowGraph+validate"></a>

#### flowGraph.validate() ⇒ <code>object</code>
Validate the flow - check all the nodes, no cycles, syntax, etc.
Update the definition to make validation report available to clients

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the validation state  
<a name="module_api-builder-flow-graph..FlowGraph"></a>

### api-builder-flow-graph~FlowGraph
**Kind**: inner class of [<code>api-builder-flow-graph</code>](#module_api-builder-flow-graph)  

* [~FlowGraph](#module_api-builder-flow-graph..FlowGraph)
    * [new FlowGraph()](#new_module_api-builder-flow-graph..FlowGraph_new)
    * [new FlowGraph(flowId, flowdef)](#new_module_api-builder-flow-graph..FlowGraph_new)
    * [._ensureVertex(vertexId, info)](#module_api-builder-flow-graph..FlowGraph+_ensureVertex) ⇒ <code>object</code>
    * [._deleteVertex(vertexId)](#module_api-builder-flow-graph..FlowGraph+_deleteVertex)
    * [._getVertexChildren(vertexId, output, [idsOnly])](#module_api-builder-flow-graph..FlowGraph+_getVertexChildren) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [._getVertexParents(vertexId, [idsOnly])](#module_api-builder-flow-graph..FlowGraph+_getVertexParents) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [._ensureEdge(output, fromId, toId)](#module_api-builder-flow-graph..FlowGraph+_ensureEdge) ⇒ <code>object</code>
    * [._deleteEdge(fromId, output, toId)](#module_api-builder-flow-graph..FlowGraph+_deleteEdge)
    * [._deleteEdges(fromId, toId)](#module_api-builder-flow-graph..FlowGraph+_deleteEdges)
    * [._setValidation(validation)](#module_api-builder-flow-graph..FlowGraph+_setValidation)
    * [._getOutputRoutes(nodeId)](#module_api-builder-flow-graph..FlowGraph+_getOutputRoutes) ⇒ <code>object</code>
    * [._onChange()](#module_api-builder-flow-graph..FlowGraph+_onChange)
    * [._buildGraph()](#module_api-builder-flow-graph..FlowGraph+_buildGraph)
    * [._buildVertex(nodeId)](#module_api-builder-flow-graph..FlowGraph+_buildVertex)
    * [.changeNodeName(nodeId, name)](#module_api-builder-flow-graph..FlowGraph+changeNodeName)
    * [.changeMethod(nodeId, method, nodehandler)](#module_api-builder-flow-graph..FlowGraph+changeMethod)
    * [.insertNode(node, nodeId)](#module_api-builder-flow-graph..FlowGraph+insertNode) ⇒ <code>string</code>
    * [.deleteNode(nodeId)](#module_api-builder-flow-graph..FlowGraph+deleteNode)
    * [.deleteRoute(output, fromId, toId)](#module_api-builder-flow-graph..FlowGraph+deleteRoute)
    * [.deleteRoutes(fromId, toId)](#module_api-builder-flow-graph..FlowGraph+deleteRoutes)
    * [.setStart(nodeId)](#module_api-builder-flow-graph..FlowGraph+setStart)
    * [.unsetStart()](#module_api-builder-flow-graph..FlowGraph+unsetStart)
    * [.addParameter(nodeId, name, value, [type])](#module_api-builder-flow-graph..FlowGraph+addParameter)
    * [.updateParameter(nodeId, name, prop, newValue)](#module_api-builder-flow-graph..FlowGraph+updateParameter)
    * [.removeParameter(nodeId, name)](#module_api-builder-flow-graph..FlowGraph+removeParameter) ⇒ <code>object</code>
    * [.addAuthorization(nodeId, name, value, [type])](#module_api-builder-flow-graph..FlowGraph+addAuthorization)
    * [.updateAuthorization(nodeId, name, prop, newValue)](#module_api-builder-flow-graph..FlowGraph+updateAuthorization)
    * [.removeAuthorization(nodeId, name)](#module_api-builder-flow-graph..FlowGraph+removeAuthorization) ⇒ <code>object</code>
    * [._addParameter(location, nodeId, name, value, [type])](#module_api-builder-flow-graph..FlowGraph+_addParameter)
    * [._getParameter(location, nodeId, name)](#module_api-builder-flow-graph..FlowGraph+_getParameter) ⇒ <code>object</code>
    * [._getParameterIndex(location, nodeId, name)](#module_api-builder-flow-graph..FlowGraph+_getParameterIndex) ⇒ <code>number</code>
    * [._updateParameter(location, nodeId, name, prop, newValue)](#module_api-builder-flow-graph..FlowGraph+_updateParameter)
    * [._removeParameterByName(location, nodeId, name)](#module_api-builder-flow-graph..FlowGraph+_removeParameterByName) ⇒ <code>object</code>
    * [._removeParameter(location, nodeId, index)](#module_api-builder-flow-graph..FlowGraph+_removeParameter) ⇒ <code>object</code>
    * [.updateOutputContext(nodeId, name, value)](#module_api-builder-flow-graph..FlowGraph+updateOutputContext)
    * [.connectNode(sourceId, sourceOutput, targetId)](#module_api-builder-flow-graph..FlowGraph+connectNode)
    * [.disconnectNode(sourceId, sourceOutput, targetId)](#module_api-builder-flow-graph..FlowGraph+disconnectNode)
    * [.isEmpty()](#module_api-builder-flow-graph..FlowGraph+isEmpty) ⇒ <code>boolean</code>
    * [.getName()](#module_api-builder-flow-graph..FlowGraph+getName) ⇒ <code>string</code>
    * [.setName(name)](#module_api-builder-flow-graph..FlowGraph+setName)
    * [.getDescription()](#module_api-builder-flow-graph..FlowGraph+getDescription) ⇒ <code>string</code>
    * [.setDescription(description)](#module_api-builder-flow-graph..FlowGraph+setDescription)
    * [.getSymbol()](#module_api-builder-flow-graph..FlowGraph+getSymbol) ⇒ <code>symbol</code>
    * [.getDefinition()](#module_api-builder-flow-graph..FlowGraph+getDefinition) ⇒ <code>object</code>
    * [.getGraph()](#module_api-builder-flow-graph..FlowGraph+getGraph) ⇒ <code>object</code>
    * [.getId()](#module_api-builder-flow-graph..FlowGraph+getId) ⇒ <code>string</code>
    * [.getEdges()](#module_api-builder-flow-graph..FlowGraph+getEdges) ⇒ <code>Array.&lt;object&gt;</code>
    * [.getEdge(output, fromId, toId)](#module_api-builder-flow-graph..FlowGraph+getEdge) ⇒ <code>object</code> \| <code>null</code>
    * [.getVertices([idsOnly])](#module_api-builder-flow-graph..FlowGraph+getVertices) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [.getNodes([idsOnly])](#module_api-builder-flow-graph..FlowGraph+getNodes) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [.getChildren(nodeId, output, [idsOnly])](#module_api-builder-flow-graph..FlowGraph+getChildren) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [.getParents(nodeId, [idsOnly])](#module_api-builder-flow-graph..FlowGraph+getParents) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [.getTerminalNodes([idsOnly])](#module_api-builder-flow-graph..FlowGraph+getTerminalNodes) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
    * [.getVertex(vertexId)](#module_api-builder-flow-graph..FlowGraph+getVertex) ⇒ <code>object</code>
    * [.getNode(nodeId)](#module_api-builder-flow-graph..FlowGraph+getNode) ⇒ <code>object</code> \| <code>null</code>
    * [.getNodeUnsafe(nodeId)](#module_api-builder-flow-graph..FlowGraph+getNodeUnsafe) ⇒ <code>object</code>
    * [.getValidation()](#module_api-builder-flow-graph..FlowGraph+getValidation) ⇒ <code>object</code>
    * [.registerValidator(validator)](#module_api-builder-flow-graph..FlowGraph+registerValidator)
    * [.validate()](#module_api-builder-flow-graph..FlowGraph+validate) ⇒ <code>object</code>

<a name="new_module_api-builder-flow-graph..FlowGraph_new"></a>

#### new FlowGraph()
FlowGraph object

<a name="new_module_api-builder-flow-graph..FlowGraph_new"></a>

#### new FlowGraph(flowId, flowdef)
Creates an instance of FlowGraph.


| Param | Type | Description |
| --- | --- | --- |
| flowId | <code>string</code> | The id of this flow. |
| flowdef | <code>object</code> | The flow definition. |

<a name="module_api-builder-flow-graph..FlowGraph+_ensureVertex"></a>

#### flowGraph.\_ensureVertex(vertexId, info) ⇒ <code>object</code>
Ensures that a vertex will exist

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the vertex which matched or was created.  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| vertexId | <code>string</code> | the ID of the vertex |
| info | <code>object</code> | info to be set on the vertex. If vertex already exists, the info will                      be merged with the existing info. |

<a name="module_api-builder-flow-graph..FlowGraph+_deleteVertex"></a>

#### flowGraph.\_deleteVertex(vertexId)
Deletes a vertex from the graph

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| vertexId | <code>string</code> | the id of the vertex to delete |

<a name="module_api-builder-flow-graph..FlowGraph+_getVertexChildren"></a>

#### flowGraph.\_getVertexChildren(vertexId, output, [idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the children of a vertex in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the child vertices of a vertex in the flow  

| Param | Type | Description |
| --- | --- | --- |
| vertexId | <code>string</code> | the Id of the vertex to get children for. |
| output | <code>string</code> | the vetex output to get the children for. |
| [idsOnly] | <code>bool</code> | if the vertex idsOnly should be returned rather than the vertices |

<a name="module_api-builder-flow-graph..FlowGraph+_getVertexParents"></a>

#### flowGraph.\_getVertexParents(vertexId, [idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the parents of a vertex in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the parent nodes of a vertex in the flow  

| Param | Type | Description |
| --- | --- | --- |
| vertexId | <code>string</code> | the Id of the vertex to get parents for. |
| [idsOnly] | <code>bool</code> | if the vertex ids should be returned rather than the vertices |

<a name="module_api-builder-flow-graph..FlowGraph+_ensureEdge"></a>

#### flowGraph.\_ensureEdge(output, fromId, toId) ⇒ <code>object</code>
Ensures that an edge will exist between any two vertices. If any of the vertices do not
exist, they will be created.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the edge which matched or was created.  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| output | <code>string</code> | the vertex output group the edge belongs to. |
| fromId | <code>string</code> | the ID of the vertex where the edge starts |
| toId | <code>string</code> | this ID of the vertex where the edge ends |

<a name="module_api-builder-flow-graph..FlowGraph+_deleteEdge"></a>

#### flowGraph.\_deleteEdge(fromId, output, toId)
Deletes an edge from one node to another.
Removes the parent/child where necesarry from each vertex.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| fromId | <code>string</code> | the vertex where the edge starts |
| output | <code>string</code> | the vertex output group the edge belongs to. |
| toId | <code>string</code> | the vertex where the edge ends |

<a name="module_api-builder-flow-graph..FlowGraph+_deleteEdges"></a>

#### flowGraph.\_deleteEdges(fromId, toId)
Deletes the edges from one node to another (across all outputs).
Removes the parent/child where necesarry from each vertex.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| fromId | <code>string</code> | the vertex where the edge starts |
| toId | <code>string</code> | the vertex where the edge ends |

<a name="module_api-builder-flow-graph..FlowGraph+_setValidation"></a>

#### flowGraph.\_setValidation(validation)
Sets the validation state on the flow definition

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| validation | <code>object</code> | the validation state |

<a name="module_api-builder-flow-graph..FlowGraph+_getOutputRoutes"></a>

#### flowGraph.\_getOutputRoutes(nodeId) ⇒ <code>object</code>
Gets a list of all nodes which a node may route to grouped by output.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - A map of IDs for routes from the node specified grouped by output.  
**Access**: protected  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the ID of a node to get routes for |

<a name="module_api-builder-flow-graph..FlowGraph+_onChange"></a>

#### flowGraph.\_onChange()
Generates a unique symbol of the flow. Should be called whenever the flow changes.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
<a name="module_api-builder-flow-graph..FlowGraph+_buildGraph"></a>

#### flowGraph.\_buildGraph()
Build a graph from the flow definition.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Access**: protected  
<a name="module_api-builder-flow-graph..FlowGraph+_buildVertex"></a>

#### flowGraph.\_buildVertex(nodeId)
Builds a vertex for a nodeId

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | The nodeId from which to build a vertex. |

<a name="module_api-builder-flow-graph..FlowGraph+changeNodeName"></a>

#### flowGraph.changeNodeName(nodeId, name)
Sets the name of a node

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | Node ID |
| name | <code>string</code> | New node name |

<a name="module_api-builder-flow-graph..FlowGraph+changeMethod"></a>

#### flowGraph.changeMethod(nodeId, method, nodehandler)
Modifies the method of a node to match a new spec

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | The id of the node to update. |
| method | <code>string</code> | the method to use |
| nodehandler | <code>object</code> | the node handler in use |

<a name="module_api-builder-flow-graph..FlowGraph+insertNode"></a>

#### flowGraph.insertNode(node, nodeId) ⇒ <code>string</code>
Inserts a node into the flow graph.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>string</code> - - the inserted nodeId  

| Param | Type | Description |
| --- | --- | --- |
| node | <code>object</code> | The node to insert. |
| nodeId | <code>string</code> | The id of the node to insert.  If supplied, it must be unique.  If not supplied, the node id will be generated. |

<a name="module_api-builder-flow-graph..FlowGraph+deleteNode"></a>

#### flowGraph.deleteNode(nodeId)
Delete a specific node from the flow.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the id of the node to delete |

<a name="module_api-builder-flow-graph..FlowGraph+deleteRoute"></a>

#### flowGraph.deleteRoute(output, fromId, toId)
Delete the output route from one node to another.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| output | <code>string</code> | the output to delete the route for. |
| fromId | <code>string</code> | the node id the routes are being deleted from. |
| toId | <code>string</code> | the node id being removed from the routes. |

<a name="module_api-builder-flow-graph..FlowGraph+deleteRoutes"></a>

#### flowGraph.deleteRoutes(fromId, toId)
Delete all the output routes from one node to another.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| fromId | <code>string</code> | the node id the routes are being deleted from. |
| toId | <code>string</code> | the node id being removed from the routes. |

<a name="module_api-builder-flow-graph..FlowGraph+setStart"></a>

#### flowGraph.setStart(nodeId)
Sets a node as the start node for the flow.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | The start node for the flow. |

<a name="module_api-builder-flow-graph..FlowGraph+unsetStart"></a>

#### flowGraph.unsetStart()
Clears the start node for the flow.  This action will make the flow invalid.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
<a name="module_api-builder-flow-graph..FlowGraph+addParameter"></a>

#### flowGraph.addParameter(nodeId, name, value, [type])
Adds a parameter to a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| nodeId | <code>string</code> |  | the node id |
| name | <code>string</code> |  | the name of the parameter |
| value | <code>string</code> |  | the value of the parameter |
| [type] | <code>string</code> | <code>&quot;jsonpath&quot;</code> | the type of the parameter. |

<a name="module_api-builder-flow-graph..FlowGraph+updateParameter"></a>

#### flowGraph.updateParameter(nodeId, name, prop, newValue)
Updates a parameter from a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the current name of the parameter |
| prop | <code>string</code> \| <code>object</code> | the field to update (name|type|value) if string,                               or the new value of the parameter |
| newValue | <code>string</code> | the new value of the prop specified if it is a string |

<a name="module_api-builder-flow-graph..FlowGraph+removeParameter"></a>

#### flowGraph.removeParameter(nodeId, name) ⇒ <code>object</code>
Removes a parameter by name from a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the parameter that was removed  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the name of the parameter |

<a name="module_api-builder-flow-graph..FlowGraph+addAuthorization"></a>

#### flowGraph.addAuthorization(nodeId, name, value, [type])
Adds a authorization parameter to a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| nodeId | <code>string</code> |  | the node id |
| name | <code>string</code> |  | the name of the parameter |
| value | <code>string</code> |  | the value of the parameter |
| [type] | <code>string</code> | <code>&quot;jsonpath&quot;</code> | the type of the parameter. |

<a name="module_api-builder-flow-graph..FlowGraph+updateAuthorization"></a>

#### flowGraph.updateAuthorization(nodeId, name, prop, newValue)
Updates a authorization parameter from a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the current name of the parameter |
| prop | <code>string</code> \| <code>object</code> | the field to update (name|type|value) if string,                               or the new value of the parameter |
| newValue | <code>string</code> | the new value of the prop specified if it is a string |

<a name="module_api-builder-flow-graph..FlowGraph+removeAuthorization"></a>

#### flowGraph.removeAuthorization(nodeId, name) ⇒ <code>object</code>
Removes a authorization parameter by name from a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the parameter that was removed  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the name of the parameter |

<a name="module_api-builder-flow-graph..FlowGraph+_addParameter"></a>

#### flowGraph.\_addParameter(location, nodeId, name, value, [type])
Adds a parameter to a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| location | <code>string</code> |  | the parameter location, one of: parameters|authorizations |
| nodeId | <code>string</code> |  | the node id |
| name | <code>string</code> |  | the name of the parameter |
| value | <code>string</code> |  | the value of the parameter |
| [type] | <code>string</code> | <code>&quot;jsonpath&quot;</code> | the type of the parameter. |

<a name="module_api-builder-flow-graph..FlowGraph+_getParameter"></a>

#### flowGraph.\_getParameter(location, nodeId, name) ⇒ <code>object</code>
Gets a parameter from the node by name

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the parameter  

| Param | Type | Description |
| --- | --- | --- |
| location | <code>string</code> | the parameter location, one of: parameters|authorizations |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the name of the parameter |

<a name="module_api-builder-flow-graph..FlowGraph+_getParameterIndex"></a>

#### flowGraph.\_getParameterIndex(location, nodeId, name) ⇒ <code>number</code>
Gets a parameter index from the node by name

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>number</code> - the parameter index  

| Param | Type | Description |
| --- | --- | --- |
| location | <code>string</code> | the parameter location, one of: parameters|authorizations |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the name of the parameter |

<a name="module_api-builder-flow-graph..FlowGraph+_updateParameter"></a>

#### flowGraph.\_updateParameter(location, nodeId, name, prop, newValue)
Updates a parameter from a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| location | <code>string</code> | the parameter location, one of: parameters|authorizations |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the current name of the parameter |
| prop | <code>string</code> \| <code>object</code> | the field to update (name|type|value) if string,                               or the new value of the parameter |
| newValue | <code>string</code> | the new value of the prop specified if it is a string |

<a name="module_api-builder-flow-graph..FlowGraph+_removeParameterByName"></a>

#### flowGraph.\_removeParameterByName(location, nodeId, name) ⇒ <code>object</code>
Removes a parameter by name from a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the parameter that was removed  

| Param | Type | Description |
| --- | --- | --- |
| location | <code>string</code> | the parameter location, one of: parameters|authorizations |
| nodeId | <code>string</code> | the node id |
| name | <code>number</code> | the name of the parameter |

<a name="module_api-builder-flow-graph..FlowGraph+_removeParameter"></a>

#### flowGraph.\_removeParameter(location, nodeId, index) ⇒ <code>object</code>
Removes a parameter by index from a node in the flow.  Does not trigger change.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the parameter that was removed  

| Param | Type | Description |
| --- | --- | --- |
| location | <code>string</code> | the parameter location, one of: parameters|authorizations |
| nodeId | <code>string</code> | the node id |
| index | <code>number</code> | the index of the parameter |

<a name="module_api-builder-flow-graph..FlowGraph+updateOutputContext"></a>

#### flowGraph.updateOutputContext(nodeId, name, value)
Modifies the JSONPath context of an output

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the node id |
| name | <code>string</code> | the name of the output |
| value | <code>string</code> | the new JSONPath context |

<a name="module_api-builder-flow-graph..FlowGraph+connectNode"></a>

#### flowGraph.connectNode(sourceId, sourceOutput, targetId)
Connects a node output to the specified target.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| sourceId | <code>string</code> | The source node for the connection. |
| sourceOutput | <code>string</code> | The output in the source node for the connection. |
| targetId | <code>string</code> | The id of the target node to connect to. |

<a name="module_api-builder-flow-graph..FlowGraph+disconnectNode"></a>

#### flowGraph.disconnectNode(sourceId, sourceOutput, targetId)
Disconnects a target node from a parent node's source and output.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| sourceId | <code>string</code> | The source node for the connection. |
| sourceOutput | <code>string</code> | The output in the source node for the connection. |
| targetId | <code>string</code> | The id of the target node to connect to. |

<a name="module_api-builder-flow-graph..FlowGraph+isEmpty"></a>

#### flowGraph.isEmpty() ⇒ <code>boolean</code>
Indicates if the flow is empty, with no nodes.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>boolean</code> - `true` if the flow is empty.  
<a name="module_api-builder-flow-graph..FlowGraph+getName"></a>

#### flowGraph.getName() ⇒ <code>string</code>
Gets the name of the flow from flow info meta-data.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>string</code> - The flow name.  
<a name="module_api-builder-flow-graph..FlowGraph+setName"></a>

#### flowGraph.setName(name)
Sets the name of the flow.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| name | <code>string</code> | The flow name. |

<a name="module_api-builder-flow-graph..FlowGraph+getDescription"></a>

#### flowGraph.getDescription() ⇒ <code>string</code>
Gets the description of the flow from flow info meta-data.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>string</code> - The flow description.  
<a name="module_api-builder-flow-graph..FlowGraph+setDescription"></a>

#### flowGraph.setDescription(description)
Sets the description of the flow.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| description | <code>string</code> | The flow description. |

<a name="module_api-builder-flow-graph..FlowGraph+getSymbol"></a>

#### flowGraph.getSymbol() ⇒ <code>symbol</code>
Get the unique symbol of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>symbol</code> - the flow symbol  
<a name="module_api-builder-flow-graph..FlowGraph+getDefinition"></a>

#### flowGraph.getDefinition() ⇒ <code>object</code>
Gets the definition of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the flow definition  
<a name="module_api-builder-flow-graph..FlowGraph+getGraph"></a>

#### flowGraph.getGraph() ⇒ <code>object</code>
Gets the graph representation of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the flow graph representation  
<a name="module_api-builder-flow-graph..FlowGraph+getId"></a>

#### flowGraph.getId() ⇒ <code>string</code>
Gets the Id of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>string</code> - the flow id  
<a name="module_api-builder-flow-graph..FlowGraph+getEdges"></a>

#### flowGraph.getEdges() ⇒ <code>Array.&lt;object&gt;</code>
Gets the edges of the flow graph

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;object&gt;</code> - the edges of the graph  
<a name="module_api-builder-flow-graph..FlowGraph+getEdge"></a>

#### flowGraph.getEdge(output, fromId, toId) ⇒ <code>object</code> \| <code>null</code>
Get the edge between two nodes.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> \| <code>null</code> - the edge between two nodes. Null if no edge exists.  

| Param | Type | Description |
| --- | --- | --- |
| output | <code>string</code> | the node output the edges belong to. |
| fromId | <code>string</code> | the ID of the vertex where the edge starts |
| toId | <code>string</code> | this ID of the vertex where the edge ends |

<a name="module_api-builder-flow-graph..FlowGraph+getVertices"></a>

#### flowGraph.getVertices([idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the vertices of the graph

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the vertices of the graph  

| Param | Type | Description |
| --- | --- | --- |
| [idsOnly] | <code>bool</code> | if the vertex ids should be returned rather than the vertices |

<a name="module_api-builder-flow-graph..FlowGraph+getNodes"></a>

#### flowGraph.getNodes([idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the nodes of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the nodes of the flow  

| Param | Type | Description |
| --- | --- | --- |
| [idsOnly] | <code>bool</code> | if the node ids should be returned rather than the nodes |

<a name="module_api-builder-flow-graph..FlowGraph+getChildren"></a>

#### flowGraph.getChildren(nodeId, output, [idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the children of a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the child nodes of a node in the flow  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the Id of the node to get children for. |
| output | <code>string</code> | the node output to get the children for.                          If omitted then all children are returned. |
| [idsOnly] | <code>bool</code> | if the node idsOnly should be returned rather than the nodes |

<a name="module_api-builder-flow-graph..FlowGraph+getParents"></a>

#### flowGraph.getParents(nodeId, [idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the parents of a node in the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the parent nodes of a node in the flow  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the Id of the node to get parents for. |
| [idsOnly] | <code>bool</code> | if the node ids should be returned rather than the nodes |

<a name="module_api-builder-flow-graph..FlowGraph+getTerminalNodes"></a>

#### flowGraph.getTerminalNodes([idsOnly]) ⇒ <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code>
Gets the terminal nodes of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;object&gt;</code> - the terminal nodes of the flow  

| Param | Type | Description |
| --- | --- | --- |
| [idsOnly] | <code>bool</code> | if the node ids should be returned rather than the nodes |

<a name="module_api-builder-flow-graph..FlowGraph+getVertex"></a>

#### flowGraph.getVertex(vertexId) ⇒ <code>object</code>
Get the vertex which matches the ID specified

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - a vertex in the graph  

| Param | Type | Description |
| --- | --- | --- |
| vertexId | <code>string</code> | the ID of the vertex to return |

<a name="module_api-builder-flow-graph..FlowGraph+getNode"></a>

#### flowGraph.getNode(nodeId) ⇒ <code>object</code> \| <code>null</code>
Get the node which matches the ID specified

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> \| <code>null</code> - a node in the flow, or null  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the ID of the node to return |

<a name="module_api-builder-flow-graph..FlowGraph+getNodeUnsafe"></a>

#### flowGraph.getNodeUnsafe(nodeId) ⇒ <code>object</code>
Get the node which matches the ID specified and will throw an error if node was not found.
Call this if you expect the node to exist

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - a node in the flow  

| Param | Type | Description |
| --- | --- | --- |
| nodeId | <code>string</code> | the ID of the node to return |

<a name="module_api-builder-flow-graph..FlowGraph+getValidation"></a>

#### flowGraph.getValidation() ⇒ <code>object</code>
Get the validation state of the flow

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the validation state of the flow  
<a name="module_api-builder-flow-graph..FlowGraph+registerValidator"></a>

#### flowGraph.registerValidator(validator)
Registers a FlowValidator type class to the flow. When validation is run, this class will
be used to validate the flow.

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  

| Param | Type | Description |
| --- | --- | --- |
| validator | <code>FlowValidator</code> | A class which is a FlowValidator |

<a name="module_api-builder-flow-graph..FlowGraph+validate"></a>

#### flowGraph.validate() ⇒ <code>object</code>
Validate the flow - check all the nodes, no cycles, syntax, etc.
Update the definition to make validation report available to clients

**Kind**: instance method of [<code>FlowGraph</code>](#module_api-builder-flow-graph..FlowGraph)  
**Returns**: <code>object</code> - the validation state  
<a name="module_api-builder-flow-graph..objectToArray"></a>

### api-builder-flow-graph~objectToArray(object, map) ⇒ <code>Array.&lt;string&gt;</code> \| <code>array</code>
Converts an object into an array of keys or values

**Kind**: inner method of [<code>api-builder-flow-graph</code>](#module_api-builder-flow-graph)  
**Returns**: <code>Array.&lt;string&gt;</code> \| <code>array</code> - an array of values based on the map.  

| Param | Type | Description |
| --- | --- | --- |
| object | <code>object</code> | the object to convert into an array |
| map | <code>function</code> \| <code>bool</code> | if true, return all the keys of the object                              if false, return all the values of the object                              if function, map object keys to array values. |


## Building

```bash
npm run build
```

## Author

Axway <support@axway.com> https://axway.com

## License

This code is proprietary, closed source software licensed to you by Axway. All Rights Reserved. You may not modify Axway’s code without express written permission of Axway. You are licensed to use and distribute your services developed with the use of this software and dependencies, including distributing reasonable and appropriate portions of the Axway code and dependencies. Except as set forth above, this code MUST not be copied or otherwise redistributed without express written permission of Axway. This module is licensed as part of the Axway Platform and governed under the terms of the Axway license agreement (General Conditions) located here: [https://support.axway.com/en/auth/general-conditions](https://support.axway.com/en/auth/general-conditions); EXCEPT THAT IF YOU RECEIVED A FREE SUBSCRIPTION, LICENSE, OR SUPPORT SUBSCRIPTION FOR THIS CODE, NOTWITHSTANDING THE LANGUAGE OF THE GENERAL CONDITIONS, AXWAY HEREBY DISCLAIMS ALL SUPPORT AND MAINTENANCE OBLIGATIONS, AS WELL AS ALL EXPRESS AND IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO IMPLIED INFRINGEMENT WARRANTIES, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, AND YOU ACCEPT THE PRODUCT AS-IS AND WITH ALL FAULTS, SOLELY AT YOUR OWN RISK. Your right to use this software is strictly limited to the term (if any) of the license or subscription originally granted to you.

---
_Source: https://npm.io/package/@axway/api-builder-flow-graph · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
