Siebel eScript Language Reference > Siebel eScript Commands > Business Service Objects >

About Script Libraries


In Siebel 8.0, the ST eScript engine provides business services script libraries. Script libraries assist in the development of reusable, modular components that can be upgraded and that are easy to maintain. Script libraries provide a framework for invoking global scripts.

The script libraries feature provides the following functions:

  • Allows you to call a business service function directly from anywhere within the scripting interface after you have declared the business service, without having to declare property sets or issue InvokeMethod calls
  • Allows you to write strongly typed methods for built-in business services, which can then be called using the Script Assist utility

NOTE:  Using script libraries is optional. All code written before Siebel 8.0 is still supported.

Example of Calling a Business Service Function Directly

The following code illustrates how to call a method on the Data Transfer Service directly, without declaring property sets. Calling business service methods this way results in shorter, more readable scripts.

var oBS : Service = TheApplication ().GetService ("Data Transfer Service");
oBS.SendData ("Name", "John Doe");

Example of a Custom Method for a Business Service

You can write custom methods for business services and make these available from within Script Assist. For example, the following code creates a custom wrapper method, SendData, on the Data Transfer Service. You can intercept and change the calls to the Data Transfer Service in a centralized location in the SendData method.

function SendData (sTag : String, sValue : String)
{
var oPS1 = TheApplication ().NewPropertySet ();
var oPS2 = TheApplication ().NewPropertySet ();

oPS1.SetProperty ("Tag", sTag);
oPS1.SetProperty ("Value", sValue);

this.InvokeMethod ("SendData", oPS1, oPS2)
}

Displaying a Custom Method Within Script Assist

To make a custom method available to the script libraries so that it can be called from within Script Assist, you must do the following:

  • Save the business service method script.
  • Ensure the script does not contain compile errors.

    For functions called using script libraries, the compiler checks that argument types are valid and do not contain incompatibilities.

  • Check the External Use flag for the business service object in Siebel Tools.

The custom method for the service is added to the script libraries and will display from the Script Assist utility.

To display custom business service methods within Script Assist, perform the following procedure.

To display custom methods in Script Assist

  1. Access Script Assist from the script editor by pressing CTRL+SPACE.
  2. In your script, type the name of a business service object followed by a period (.).

    All the default and custom scripted methods available for the business service object are displayed.

  3. Select the method that you want to add to your script.

For detailed information on Script Assist, on setting object properties, and on using the Server Script Editor to create, save, and compile scripts, see Using Siebel Tools.

Siebel eScript Language Reference Copyright © 2007, Oracle. All rights reserved.