##### Supporting Information

# Configuration Files

The following files can be edited by the user:

- WWGConfig.xml

- WWGUDFunctions.asp/WWGUDFunctions.aspx/WWGUDFunctions.jsp

- WWGXMLPost.inc

## WWGConfig.xml

This is a configuration file for the Genesys Agent Scripting application. This file contains all Genesys Agent Scripting fields that have been declared configuration file fields and their values. When a Genesys Agent Scripting application is started, it accesses this file and reads in the values.

Below is an example of the format of the file:

<WWGConfig>

<XMLServerURL>http://localhost/WWGDemo/Server/</XMLServerURL>

</WWGConfig>

XMLServerURL is a Genesys Agent Scripting configuration field and http://localhost/WWGDemo/Server/ is the value stored in that field.

The fields Server URL and DTD URL in the XML Interface Settings window are configuration fields.

## WWGUDFunctions.asp/WWGUDFunctions.aspx/WWGUDFunctions.jsp

User Defined Functions are used to customize actions in Genesys Agent Scripting. The User Defined Functions are written in Visual Basic for ASP in a file called WWGUDFunctions.asp. For ASPX, the functions are written in C-Sharp in a file called WWGUDFunctions.aspx. For JSP, the functions are written in Java in a file called WWGUDFunctions.jsp.

Here is an example function written in Visual Basic.

<%

'--------------------------------------------------------------------------

' WWGUDFunctions.asp

' Written By:

' Date:

' Description: Use these functions to customize WWG Actions. Any

' Functions added here should be listed in the WWG

' UDFunctions Database table.

'--------------------------------------------------------------------------

'--------------------------------------------------------------------------

' Use Luhn calculation to verify credit card number

'--------------------------------------------------------------------------

FUNCTION verifyCreditCard(ccNum)

ccCheckSum = 0

ccDigitCnt = 0

ccDigitSum = 0

ccValid = ""

FOR idx = LEN(ccNum) TO 1 STEP -1

ccDigitCnt = ccDigitCnt + 1

ccDigit = CINT( mid(ccNum, idx, 1) )

ccDigitSum = ccDigitSum + ccDigit

IF ccDigitCnt MOD 2 = 0 THEN

ccDigit = ccDigit * 2

END IF

FOR idx2 = 1 TO LEN(ccDigit)

ccCheckSum = ccCheckSum + MID( CSTR(ccDigit), idx2, 1)

NEXT

NEXT

IF ccCheckSum MOD 10 = 0 THEN

IF LEN(ccNum) > 10 AND ccDigit > 0 THEN

verifyCreditCard = "1"

ELSE

verifyCreditCard = "0"

END IF

ELSE

verifyCreditCard = "0"

END IF

END FUNCTION

%>

## WWGXMLPost.inc (XML Interface Pre/Post Processing)

Preprocessing will execute the functions and make any changes to the XML before the request is sent to the XML Server. Postprocessing takes the response sent back from the server and executes the function against that information. The following two functions are provided for the Preprocessing and Postprocessing:

XMLGlobalPreProcess

XMLGlobalPostProcess

These functions exist in the following Genesys Agent Scripting installation files for the various platforms:

Platform | Installation File
ASP | Script asp Web Folder\WWGXMLPost.inc
JSP | Script jsp Web Folder\WWGXMLPost.inc
ASPX | Script aspx Web Folder\WWGXMLPostInc.aspx

Once you compile your Project Book and deploy it to a target folder, you can modify the file from the target folder. Future compiles will not overlay any changes you made to the file in the target folder.

### XMLGlobalPreProcess

The function XMLGlobalPreProcess takes as input the following parameters:

parmxml - The XML string to be sent to the XML Server

parmtargeturl - The URL string for the targeted XML Server (ASP only)

parmnodename - The top node name of the XML string (ASP only)

Note: ASP takes as input all three parameters, JSP and ASPX take as input only the first parameter.

The returned value from the function will be sent to the XML Server. The user can update this function to modify the XML string. The following is an example of this function modified for ASP:

Function XMLGlobalPreProcess(parmxml, parmtargeturl, parmnodename)

If parmtageturl = ”http://MyServer/MyWebApp/MyXMLServer.asp” Then

parmxml = rep(parmxml, ”system”, ”matrix”)

End If

XMLGlobalPreProcess = parmxml

End Function

Thus, before an XML Server is called, this function will take the XML stream and replace the word "system" with "matrix" if the target XML Server is ”http://MyServer/MyWebApp/MyXMLServer.asp”. The resulting XML stream is returned and the targeted XML Server is called with the modified XML stream.

### XMLGlobalPostProcess

The function XMLGlobalPostProcess takes as input the following parameters:

parmxml - The XML string that was returned from the XML Server

parmtargeturl - The URL string for the targeted XML Server (ASP only)

parmnodename - The top node name of the XML string that was sent to the XML Server (ASP only)

Note: ASP takes as input all three parameters, JSP and ASPX take as input only the first parameter.

The returned value from the function will be processed by Agent Scripting, mapping XML tags to their associated fields. The user can update this function to modify the returned XML string. The following is an example of this function modified for ASP:

Function XMLGlobalPostProcess(parmxml, parmtargeturl, parmnodename)

If parmtageturl = ”http://MyServer/MyWebApp/MyXMLServer.asp” And

parmnodename = "MatrixTest" Then

parmxml = rep(parmxml, ”system”, ”matrix”)

End If

XMLGlobalPreProcess = parmxml

End Function

Thus, before Agent Scripting maps the returned XML stream from the XML Server to associated fields, this function will take the XML stream and replace the word "system" with "matrix" if the XML Server was "http://MyServer/MyWebApp/MyXMLServer.asp” and the top XML node name that was specified on the XML stream to the XML Server was ”MatrixTest”.