Establish a Chain of Infobox Sequences

$set_chain [nextboxspec[,nextboxspec...]]

This command establishes a chain of infobox sequences or actions.  Each standalone infobox, or sequence of infoboxes, must end with a $chain command to transfer control to the next element in the chain. However the standalone infobox, or sequences of infoboxes can also be used independently, with the $chain command transferring control to a designated place in the absence of a chain, or when the end of the chain is reached. This ability to use the infoboxes independently gives the chain feature an advantage over manually creating a 'hard-wired' chain with a series of $next_box commands.

The parameter on this command normally consists of a sequence of infobox names:

nextboxspecan infobox name, state number or state name using the syntax described for $next_box. Other than for special applications, only infobox names should be used, but the use of infobox names beginning with S and then a number should be avoided because this would match the syntax for a state number. The chain should contain no embedded spaces, and delimiters of comma, forward slash or vertical bar (pipe) can be used.

Processing of the chain commences with a $chain command which should follow the $set_chain.

As each standalone infobox or infobox sequence ending with a $chain command is reached, control transfers to the next item in the chain.  At the end of the chain, control transfers by default to state 191 (IIF_PROC_COMPLETE), or state 128 (KILL_MAINT_OP) if the infobox sequence was started from a $worker_box FS file. You can override this by assigning an infobox name, state name or state number to system variable CHAIN_END.

A $set_chain command with no parameters clears any established chain and causes control to transfer from the next $chain command to state 191, 128 or the defined CHAIN_END.  If you are using a chain, and you transfer out to a completely separate sequence of infoboxes, for example on an $error_exit command, it is usually a good idea to clear the chain with a $set_chain command having no parameters. This does not happen automatically. Although similar to the existing $set_state feature, the chain operates independently of any state traps.

The chain and chain end exist until the end of the call or the pre- or post-process or until overridden by a later definition. The NEXT_CHAIN and FULL_CHAIN system variables return the next chain destination and the remainder of the unprocessed chain, respectively. The parameter on the $set_chain command can be specified as a variable expansion, which makes it easier to select different combinations of infoboxes.  See the examples below.


Set a simple list of infoboxes to be processed in turn. This example starts infobox ActionA and processes infoboxes until one with a $chain command is reached, when control is passed to infobox ActionD, and so on to ActionK. After starting infobox ActionK, the next $chain command will transfer to state 191.


$set_chain ActionA,ActionD,ActionK

$chain   ; start from ActionA

Select from multiple pre-defined chains:


$set_var CHAIN1 ActionA,ActionC

$set_var CHAIN2 ActionA,ActionB,ActionC

$if @varname = 1

  $set_chain @CHAIN1


  $set_chain @CHAIN2


Use the system variable NEXT_CHAIN to determine the next destination:


$type decision


  $set_var ROUTE B_NEXT



Use the system variable FULL_CHAIN to get the whole of the remaining chain, and insert an additional step at the end:


$type decision

$if @varname > 7

  $set_var WORK @FULL_CHAIN

  $set_var WORK |,ActionK

  $set_chain @WORK



In an IVR application, end the chain other than at state the default:

$type decision

$set_var CHAIN_END s:HANG_UP

$set_chain ActionA,ActionB