39ESS - Best Practices For Siebel Scripting

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 24

Essentials (Siebel 7.

7)

Module 39: Best Practices for


Siebel Scripting
Module Objectives

After completing this module you will be able to:


 Describe the differences between server and browser
script
 List Siebel scriptable objects
 Apply best practices for scripting
 Describe scripting alternatives

Why you need to know:


 In some cases, you will need to use scripting to extend the
behavior of the standard Siebel application

Module 39: Best Practices for Siebel Scripting 2 of 24


Siebel Scripting
 Siebel Scripting allows the use of integrated scripting languages
to enhance and extend the standard functionality of Siebel
applications
 Developers may add Siebel Scripts to select object definitions to
add custom processing before and after the Siebel event handler

“pre” operation Add Script here

Siebel event
Siebel handler
Application
Add Script here
“post” operation

Module 39: Best Practices for Siebel Scripting 3 of 24


Siebel Script Types
 Server Scripts
 Interpreted and executed at run time by the Application Object
Manager
 Web client: On the Siebel Server
 Mobile/dedicated client: Siebel.exe running on the local machine

 Browser Scripts
 Interpreted and executed at run time by the Web browser
 Executed by the browser for both Web and Mobile/Dedicated clients

Module 39: Best Practices for Siebel Scripting 4 of 24


Business Services
 A set of reusable functionality that is globally accessible
 Is not associated with a specific object (business component,
applet, and so forth)
 Can be called from both the browser and server script
 Are delivered as part of a Siebel application installation
 Can also be created by customers
 Is stored in the repository or client database

Module 39: Best Practices for Siebel Scripting 5 of 24


Repository-Stored Business Services
 Some business services are stored in the Siebel repository
 Siebel-developed business services
 Written in C++ and cannot be modified
 Custom business services developed by users
 Are written in Siebel Visual Basic or eScript
 Are created and modified by customers using Siebel Tools

Custom business service

Module 39: Best Practices for Siebel Scripting 6 of 24


Client-Stored Business Services
 Some business services are stored in the client database
 Are created and modified by customers using the Administration -
Business Services screen
 Are written in Siebel Visual Basic or eScript
 Are never executed if there is a repository-stored business service
of the same name

Module 39: Best Practices for Siebel Scripting 7 of 24


0/4

Server Script

Server Script Overview

Server Script Languages

Server Scriptable Objects

Server Scripting Environment

Module 39: Best Practices for Siebel Scripting 8 of 24


1/4

Server Script Overview


 Are added to available object definitions using Siebel Tools
 Are stored in the repository and compiled into the .srf file
 Are invoked by user activity in the browser
 Are executed by the interpreter (sscfbas.dll or sscfjs.dll) to
produce result

Invoke Browser
Add Execute

Tools .srf Object Manager DLL

Compile
Result

Module 39: Best Practices for Siebel Scripting 9 of 24


2/4

Server Script Languages


 Siebel eScript
 Based on ECMAScript, the industry-standard JavaScript
 Server Script only
 Supported in both UNIX and Windows environments
 Siebel Visual Basic
 Syntax similar to Microsoft Visual Basic for Applications
 Server Script only
 Supported on Windows platform only

Module 39: Best Practices for Siebel Scripting 10 of 24


3/4

Server Scriptable Objects


 Server Script can be added to the following objects:
 Application
 Has event handlers for starting and stopping the application and
processing custom menu selections
 Business Object
 Has no event handlers
 Has methods to access its child business components
 Business Component
 Has event handlers for processing records and fields
 Has methods to access business component data
 Most scripting is typically performed here
 Applet
 Has event handlers for processing custom applet-specific menu
selections

Module 39: Best Practices for Siebel Scripting 11 of 24


4/4

Server Scripting Environment


 Siebel Tools provides an integrated scripting environment
 Script Editor: An integrated editor used to create, view, edit, and
save custom scripts
 Debugger: Assists in detecting errors contained within Siebel
scripts

Example of code
in the scripting
interface

Module 39: Best Practices for Siebel Scripting 12 of 24


0/3

Browser Script

Browser Script Overview

Browser Scriptable Objects

Browser Scripting Environment

Module 39: Best Practices for Siebel Scripting 13 of 24


1/3

Browser Script Overview


 Are written in JavaScript
 Graphical commands supported
 Are added to available object definitions using Siebel Tools
 Are compiled into .js files and uploaded to the Web server
 Are invoked by user activity in the browser
 Are executed by the JavaScript interpreter within the browser

Invoke
Add Upload

Tools .js Web Server .js Browser

Compile Download Execute

Module 39: Best Practices for Siebel Scripting 14 of 24


2/3

Browser Scriptable Objects


 Browser Script can be added to the following objects:
 Application
 Has event handlers for processing custom menu selections
 Has methods to communicate with the user and navigate the UI
 Business Object
 Has no event handlers
 Has methods to access its child business components
 Business Component
 Has an event handler for field processing
 Has methods to access the business component data

Module 39: Best Practices for Siebel Scripting 15 of 24


2/3

Browser Scriptable Objects Continued


 Applet
 Has event handlers for processing custom applet-specific menu
selections and record processing
 Control
 Has methods for processing custom control functionality
 May be associated with the browser’s Document Object Model
(DOM) events
 Allow access to the page displayed within the Web browser
 Example: Highlight a field based on a mouse click

Module 39: Best Practices for Siebel Scripting 16 of 24


3/3

Browser Scripting Environment


 Siebel Tools provides a Browser Script Editor
 An integrated editor used to create, view, edit, and save custom
browser scripts
 Requires a third-party debugger
 Example: Microsoft® Windows Script Debugger

Example of code
in the scripting
interface

Module 39: Best Practices for Siebel Scripting 17 of 24


0/4

Siebel Scripting Best Practices

Use Good Scripting Practices

Use Business Services

Use Declarative Alternatives to Scripting

Use Scripting as a Last Resort

Module 39: Best Practices for Siebel Scripting 18 of 24


1/4

Use Good Scripting Practices


 Add comments to your code
 Assists other developers reading your code
 In complex scripts, create a header section to hold author and
changes history
 Keep a clear structure
 Adhere to project guidelines for code layout, for example, naming
conventions, placement of brackets or comments
 Use source control
 Use Siebel Tools in conjunction with a source-control system
 Ensure that scripts are part of an integrated testing strategy
 Use Siebel Expert Services scripting reviews to assist in
performance tuning and best practices

Module 39: Best Practices for Siebel Scripting 19 of 24


2/4

Use Business Services


 Best practice is to place code into a business service and call
the business service from your script
 Can make upgrades and maintenance easier

Module 39: Best Practices for Siebel Scripting 20 of 24


3/4

Use Declarative Alternatives to Scripting


 Benefits:
 Address common requirements as configurable options
 Has undergone performance testing
 Is easier to maintain and upgrade
 Avoids cost associated with scripting
 Declarative alternative examples:
 Business component properties
 User properties

Module 39: Best Practices for Siebel Scripting 21 of 24


4/4

Use Scripting as a Last Resort


 Scripting:
 Slows processing because code is interpreted at run time
 Introduces potential for data integrity issues and run-time errors
 Requires continued maintenance
 Introduces complexity
 Often reproduces functionality available through configuration
 Complicates upgrade process

Module 39: Best Practices for Siebel Scripting 22 of 24


4/4

Use Scripting as a Last Resort Continued

Configuration Options Level of Effort

User options (for example: file export, tab order) LOW


Built-in assistants (for example: Activity plans) Requires no to little
Built-in functionality (for example: Order, eSales) administration,
State Model no configuration
Audit Trail

Validation Manager
Siebel Workflow MEDIUM
Runtime Events Requires administration,
Personalization some configuration
Declarative configuration (Tools objects)

Scripting – BC, Application Level


Scripting – Business Services HIGH
Scripting – Server Script Requires custom scripting
Scripting – Browser Script

Module 39: Best Practices for Siebel Scripting 23 of 24


Summary

This module showed you how to:


 Describe the differences between server and browser
script
 List Siebel scriptable objects
 Apply best practices for scripting
 Describe scripting alternatives

Module 39: Best Practices for Siebel Scripting 24 of 24

You might also like