Bixby Developer Center

References

PlanNode

PlanNode objects are the main class of nodes you will be using to traverse through the execution graph with your assertions. A PlanNode has a number of interface definitions and methods you can use to access other nodes and edges in the execution graph, as well as the metadata of that node.

Accessors and Properties

This section describes the accessors and properties of PlanNode.

capsuleId

String. The capsule ID for the specified PlanNode, including the capsule's organization namespace. For example, if the fully qualified type ID is 1.2.3-viv.foo-Bar, then the capsuleId is viv.foo with the capsule organization namepsace being viv.

capsuleVersion

String. The capsule version number of a specified PlanNode. For example, if the fully qualified type ID is 1.2.3-viv.foo.Bar, then the capsule version is 1.2.3.

dialogs

Array of Dialogs executed by specified PlanNode.

functions

Array of Functions executed by specified PlanNode.

incomingEdges

Array of incoming edges PlanEdge[] that enter the specified PlanNode.

For example, if PlanNode is an action, PlanEdge[] would contain inputs for that action.

isGoal

Boolean. Returns true if the specified PlanNode is the goal.

isRecoveryGoal

Boolean. Returns true if the specified PlanNode is a recovery goal.

layouts

Array of Layouts called by the specified PlanNode.

outgoingEdges

Array of the outgoing edges PlanEdge[] that leave the specified PlanNode.

For example, if PlanNode is an action, outgoingEdges would include all outputs of that action.

predecessors

Array of nodes PlanNode[] that are parents to the specified PlanNode.

qualifiedType

String. Qualified type name of the specified PlanNode. For example, if the fully qualified type ID is 1.2.3-viv.foo.Bar, then the qualifiedType is viv.foo.Bar.

results

Array of results that the specified PlanNode returns, if any.

resultsPending

Boolean. Returns true if there are pending results from the specified PlanNode.

actionStatus

Current action status of the specified PlanNode.

successors

Array of nodes PlanNode[] that are children to the specified PlanNode.

type

PlanNodeType of the specified PlanNode.

typeId

String. Fully qualified identifier of the specified PlanNode. For example, 1.2.3-viv.foo.Bar.

typeName

String. Type name of the specified PlanNode. For example, if the fully qualified type ID is 1.2.3-viv.foo.Bar, then the typeName is Bar.

Methods

This section contains the methods of PlanNode.

find()

find(predicate: function, direction?: FindDirection, neighbors?: boolean): IterableIterator.PlanNode

Find the PlanNode objects based on the function passed. You can also specify the direction to search.

Parameters:

ParameterTypeDescription
predicatefunctionName of the function that you want to find
directionFindDirectionDirection that you want to search. Default: FindDirection.all
neighborsBooleanDetermines if you want to search within the immediate neighbors. Default: false

Returns: IterableIterator.PlanNode

Consider the following example, which is equivalent to currentNode.getAllNodesByType('action'):

const iterable = currentNode.find((node) => node.type === 'action')
const actions = Array.from(iterable)

The following example finds all concepts that have at least one dialog:

const iterable = currentNode.find((node) => node.dialogs.length > 0 && node.type === 'concept')
const conceptsWithDialog = Array.from(iterable)

findNeighbors()

find(predicate: function, direction?: FindDirection, neighbors?: boolean): IterableIterator.PlanNode

Find the PlanNode's predecessors and/or successors based on the function passed. You can also specify the direction to search.

Parameters:

ParameterTypeDescription
predicatefunctionName of the function that you want to find
directionFindDirectionDirection that you want to search. Default: FindDirection.all
neighborsBooleanDetermines if you want to search within the immediate neighbors. Default: false

Returns: IterableIterator.PlanNode

findPredecessors()

findPredecessors(predicate: function): IterableIterator.PlanNode

Find the predecessors of specified PlanNode based on the function passed.

Parameters:

ParameterTypeDescription
predicatefunctionName of the function that you want to find

Returns: IterableIterator.PlanNode

findSuccessors()

findSuccessors(predicate: function): IterableIterator.PlanNode

Find the successor PlanNode based on the function specified.

Parameters:

ParameterTypeDescription
predicatefunctionName of the function that you want to find

Returns: IterableIterator.PlanNode

getAllNodesByType()

getAllNodesByType(type: PlanNodeType): PlanNode[]

Return a PlanNode array based on the type specified.

Parameters:

ParameterTypeDescription
typePlanNodeTypeType of PlanNode you want to find

Returns: PlanNode

getAllNodesByTypeId()

getAllNodesByTypeId(qualifiedTypeId: string): PlanNode[]

Return a PlanNode array specified by the action type ID.

Parameters:

ParameterTypeDescription
qualifiedTypeIdStringFully qualified name of an action ID

Returns: PlanNode

getEdgeBetween()

getEdgeBetween(node: PlanNode): PlanEdge

Return the edges between your current node and the specified PlanNode.

Parameters:

ParameterTypeDescription
nodePlanNodeNeighbor node to current node that you want to find the edge between

Returns: PlanEdge

PlanNodeType

Describes the PlanNode type. The type can be one of the following:

FindDirection

Determines the direction to do a search. The following values are accepted:

  • all : Search both directions.
  • predecessors : Search all nodes or edges preceeding current node.
  • successors : Search all nodes or edges proceeding current node.