Branch Selection
Branch Selection Functions
Overview
You can use the NCC API to select or exit any branch of the Logic Node, giving you full control over your calls. All branches are available selection, including the Default and Error branches.
Functions
If the provided branch is a number but is not in the valid range, the following error will be raised: If the provided branch is in the valid range but greater than the number of exits the node has been configured with, the behaviour is undefined but will probably result in a runtime exception and the call being aborted. Note that the NCC SDK does not allow for runtime retrieval of the number of branches the node has.
If an error occurs in other processing, the Error branch will still be taken, as normal. This function does not override Error branch selection. Selecting a branch does not end processing. To immediately exit the node, use ncc.branch.exit.
▲ ncc.branch.select (branch)
Parameters
branch
The number of the branch to take (mandatory, 1-32).
Returns
Nothing.
Errors
If the provided branch is not able to be turned into a number, the following error will be raised:
Branch selection must be a number.
Branch selection must be between 1 and 32 inclusive.
Usage
This function instructs the ACS engine to select the target branch for use when the node exits. This selection will be stored and then honoured once the node has finished processing or if ncc.branch.exit is called with no arguments. This number is indexed from 1.
ncc.branch.select (3)
If branch is provided but is not in the valid range, the following error will be raised: If the provided branch is in the valid range but greater than the number of exits the node has been configured with, the behaviour is undefined but will probably result in a runtime exception and the call being aborted. Note that the NCC SDK does not allow for runtime retrieval of the number of branches the node has.
▲ ncc.branch.exit (branch)
Parameters
branch
The number of the branch to take (optional only if previously provided via ncc.branch.select, 1-32).
Returns
Nothing.
Errors
If branch is not provided and no branch has previously been selected via ncc.branch.select OR if branch is provided but is not able to be turned into a number, the following error will be raised:
Branch must be either provided or previously selected.
Branch selection must be between 1 and 32 inclusive.
Usage
This function instructs the ACS engine to immediately exit the node, following either the provided branch or the pre-selected exit if no branch is supplied. The branch number is indexed from 1.
ncc.branch.exit (1)