Siebel CTI Administration Guide > Configuring Advanced Communications Features > Integrating with Siebel Scripting Languages >

Integrating Scripting Using Server and Browser Scripts


Siebel eScript scripts are generally supported only for the Object Manager layer, not for the browser layer. For Siebel Web Client, the Object Manager is on the Siebel Server (Application Object Manager, such as SCCObjMgr_enu for Siebel Call Center in an ENU environment).

However, Siebel eScript scripts defined on the browser layer can use both server scripts and the @InvokeSWECommand special command. See the example in this topic for creating a communications command, a command for the Siebel Web Engine (SWE), and related server and browser scripts.

NOTE:  Transferring data from a server script to a browser script is not supported, due to limitations of SWE commands.

For more information about the @InvokeSWECommand special command, see Special Commands for Device Commands.

Command Example

Table 41 and Table 42 show an example command and associated command data definition that invokes the AlertTest SWE command.

Table 41. Command: Alert
Parameter Name
Parameter Value

DeviceCommand

@InvokeSWECommand

CmdData

Alert

Table 42 shows a command data definition for this command definition.

Table 42. Command Data: Alert
Parameter Name
Parameter Value

Param.SWECommand

AlertTest

SWE Command Example

In Siebel Tools, create a command named AlertTest with the properties shown in Table 43. This SWE command is executed by the communications command shown earlier and in turn invokes the CTI_Test.Alert business service method.

Table 43. SWE Command Example
Property Name
Value

Name

AlertTest

Business Service

CTI_Test

Force Enable

Y

Method

Alert

Target

Browser

Server and Browser Script Examples

Define the following server script in the CTI_Test business service. The PreCanInvokeMethod server script in the CTI_Test business service allows the SWE command to be enabled that in turn invokes the browser-layer scripting business service method Alert:

function Service_PreCanInvokeMethod (MethodName, &CanInvoke)
{
   var ReturnVal = ContinueOperation;
   if (MethodName == "Alert")
   {
      CanInvoke = "True";
      ReturnVal = CancelOperation;
   }
   return ReturnVal;
}

Define the following browser scripts in the CTI_Test business service. The PreInvokeMethod browser script invokes the Alert method to create an alert box in the browser.

function Service_PreCanInvokeMethod (methodName)
{
   if (methodName == "Alert")
      return true;
   else
      return ("ContinueOperation");
}

function Service_PreInvokeMethod (methodName, inputPropSet, outputPropSet)
{
   if (methodName == "Alert")
   {
      alert("CTI browser script test");
      return ("CancelOperation");
   }
   else
      return ("ContinueOperation");
}

In the previous steps, you have successfully created a new communications command named Alert. You can execute this command, for example, from the Communications submenu of the Tools menu, or from a keyboard shortcut. Another option is to further integrate this command with a server script, as illustrated in the following server script example:

function BrowserScriptTest()
{
   // Invoking Browser Script
   var ctibs = TheApplication().GetService("Communications Client");
   var ip = TheApplication().NewPropertySet();
   var op = TheApplication().NewPropertySet();
   ctibs.InvokeMethod("Alert", ip, op);
}

Siebel CTI Administration Guide Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.