Use InvokeStateTable to start running a second state table when the application is already running the primary state table.
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.)
The parameters for InvokeStateTable identify which state table to run. The parameters differ, depending on how the state table is invoked.
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.)
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.)
All of the potential state tables must accept parameters of the same types. If you specify more parameters than the state table invoked actually needs, the extra parameters are ignored. For example, any of the following state tables could be invoked by an InvokeStateTable action:
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.
InvokeStateTable can have one of the following results:
When using an ASCII editor, code this action with these parameters in the following order:
Or:
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.