Option two in the JDBC_SP sample application performs the Next operation. The Inline Code node for the Next operation uses the following VXML code:
<var name="CHANNEL" expr="Channel"/>
<subdialog name="MyServlet" src="http://localhost/servlet/JdbcServlet" method="get" namelist="CHANNEL CMD DIPNAME">
<filled>
<if cond="MyServlet.retcode<='0'">
<prompt> Got a negative error code </prompt>
<goto expr="'#d3f8ult3x1tF0rm'"/>
</if>
<assign name="document.RetField1" expr="MyServlet.PAY"/>
<assign name="document.RetField2" expr="MyServlet.WIFE"/>
</filled>
</subdialog>
<catch event="error.badfetch">
<goto expr="'#d3f8ult3x1tF0rm'"/>
</catch>
The namelist attribute specifies the arguments to be passed to the servlet, which are in turn used to perform the database operation. The following table describes the fields:
Field |
Description |
CHANNEL |
Specifies the channel number of the call in progress. IVR Designer provides a system variable called Channel in every application for this use. As can be seen from the first line in the VXML code, the system variable Channel is copied into the local CHANNEL variable. |
CMD |
Specifies the database command to perform. In this application, CMD has been declared as a character variable in the application and has been initialized to the string NEXT in the SetSelectParams node. |
DIPNAME |
Specifies the DBDIP on the Avaya IR platform that should be used for accessing the database. One of the DIPs on the IR platform should be configured using the Web Administration interface to be able to access the required database. In this application, TNAME has been declared as a character variable in the application and has been initialized to the string DBDIP2 in the Variables Manager. |
As shown in the VXML code, a retcode value is always returned from the servlet indicating the success or failure of the servlet and database operation. The retcode field will contain a positive value if the operation was successful and will have a value of zero if there are no more records to be returned. In this example, an error prompt is being played if the retcode contains a value less than or equal to zero.