InvokeStateTable

Purpose

Use InvokeStateTable to start running a second state table when the application is already running the primary state table.


A screen capture of the Action InvokeStateTable window

Description

You can use InvokeStateTable to nest state tables, either by calling another state table directly from the primary state table, or by directing the application to the information in the calling number's application profile to determine which state table to run next. (For more information about application profiles, see the Blueworx Voice Response for AIX: Configuring the System information.)

By using the Invoke Via Variable option, you can select the name or entry point of the invoked state table as the application executes, depending on circumstances such as the input last received from the caller. You can select names of state tables and entry points to be used in this way from either constants or variables. (Note that state tables invoked via variable are not automatically cross-referenced and included when the application is exported.)

You can use InvokeStateTable to start Java or VoiceXML applications by calling the JavaApplication state table. If the Java host manager is running, InvokeStateTable bypasses the JavaApplication state table and instead starts the Java application that is identified by the called number in SV185 (this is valid for both incoming and outgoing calls).

A nested state table that was started with InvokeStateTable can be stopped using either the ExitStateTable action or the CloseEverything action. ExitStateTable stops the nested state table and passes back a return value to InvokeStateTable.The application executes the state you identify as the state to which to transfer when that result occurs.

If the state table is stopped with CloseEverything, all state tables in the application are stopped and the application is ended.

Note that parameters are passed to the invoked state table by reference. This means that the invoked state table can change the value of a parameter before returning to the calling state table, and the calling state table can then use the new value. (This is not true of system variables, which are passed by value.)

Parameters

The parameters for InvokeStateTable identify which state table to run. The parameters differ, depending on how the state table is invoked.

To avoid any mismatches of type, define the first two parameters of the invoke action as strings, and the next two as numbers. Any extra parameters are ignored.

Possible results

InvokeStateTable can have one of the following results:

Result 0 through 9
Corresponds to the value of the return code from the ExitStateTable action in the invoked state table. For each return code, you can specify the next state to be performed.
State Table Not Invoked
The application could not invoke the state table identified by the InvokeStateTable parameters. The cause is reported in the System : Action addition information system variable (SV180). Possible values are:
1
State table not found
2
State table not validated
3
State table entry label not found
4
Input parameter mismatch
5
Prompt directory load failed
6
State table not invoked because it would have exceeded the maximum nesting depth of 30 levels
Note: If you want to use the information in SV180, you must check it immediately after a state table action because it is reset by other actions.

ASCII syntax

When using an ASCII editor, code this action with these parameters in the following order:

  1. "VIA_PROFILE"

Or:

  1. "DIRECT"
  2. State Table name
  3. Entry point
  4. .. Parameters

For example:

label: "Check Edges"
	InvokeStateTable("VIA_PROFILE")
	  edge EDGE_RESULT_0: 			   l_0
	  edge EDGE_RESULT_1: 			   l_1
	  edge EDGE_RESULT_2: 			   l_2
	  edge EDGE_RESULT_3: 			   l_3
	  edge EDGE_RESULT_4: 			   l_4
	  edge EDGE_RESULT_5: 			   l_5
	  edge EDGE_RESULT_6: 			   l_6
	  edge EDGE_RESULT_7: 			   l_7
	  edge EDGE_RESULT_8: 			   l_8
	  edge EDGE_RESULT_9: 			   l_9
	  edge EDGE_STATE_TABLE_NOT_INVOKED: not_invoked
	;
	InvokeStateTable("DIRECT", test_logic, start, hello, in1_n, 3, "goodbye");

The parameters and edges are described above under "Parameters" and "Possible results". For more information, see Testing a state table using the debugger.