Professional Documents
Culture Documents
Siebel EScript
Siebel EScript
Last Modified:
Area(s):
Release(s):
Database(s):
App Server OS(s):
Latest release tested
against:
Keywords:
16 September 2003
Siebel VB/eScript/Browser Script/COM
V6 (Siebel 2000-Enterprise), V7 (Enterprise), V6 (Siebel
2000-MidMarket), V7 (MidMarket)
DB2, Microsoft, Oracle
Windows 2000
V7 (Enterprise)
date arithmetic eScript
Background
There are instances in which date arithmetic is required to implement certain business
rules. Siebel eScript provides date functions that allow users to build custom functions to
know the difference between two dates, add/subtract a number of days to a date, etc.
This document presents a set of functions that can be used in scripts to implement more
complex business rules.
Sample code provided in this document is provided only as a guideline, and not as a
final product to be used in a production environment. None of the functions perform
any validation (example: daylight savings adjustment) of the input parameters or
error trapping. The code is provided as a start point from which actual scripts can be
built, and is intended to show how some of the functions provided by eScript can be
used to perform more complex tasks.
Date arithmetic functions in eScript
function AddToDate(sourceDate, nDays, nHours, nMinutes, nSeconds,
nsign)
{
// Parameters :
// sourceDate : Date object
// nDays, nHours , nMinutes , nSeconds : Integer numbers
// nsign : Can have two values : 1 or -1
// 1 indicates to ADD to the sourceDate
FAQ 1554: How to set a multi value group record as primary though
VB/eScript?
Last Modified:
Area(s):
Release(s):
Database(s):
App Server OS(s):
Latest release tested
against:
Keywords:
25 November 2003
Siebel VB/eScript/Browser Script/COM
V5 (Siebel 99-Enterprise), V6 (Siebel 2000-Enterprise), V7
(Enterprise), V5 (Siebel 99 -MidMarket), V6 (Siebel 2000MidMarket), V7 (MidMarket)
All Supported Databases
All Supported Platforms
V6 (Siebel 2000-Enterprise)
VB, eScript, set primary, child, multi-value group, MVG
Setting the primary record for a multi-value group (MVG) is part of the base functionality
in Siebel Applications. This can be configured to be set automatically through the Auto
Primary property for a multi-value link, or be directly selected by the user in the multivalue field.
Sometimes this manipulation must be performed using Siebel eScript or Visual Basic
(VB) code in order to complete an Enterprise Integration Manager (EIM) task. An
example of when this might be needed is when an interface table does not take primaries
into account. An Assignment process may also need to set the primary record via eScript
or VB when the Workflow is not available.
In the table for the Parent Business Component there exists a column with a name like
'PR_*'. This column holds the foreign key which points to the Row Id of the child record
defined as the primary. Siebel Systems does not support directly setting the "Primary
Address Id" Field in the parent Business Component.
The "SSA Primary Field" is used for the primary child implementation. This special field
belongs to the System category and is not visible within Tools. To allow setting it through
Note that the commit must be invoked on the parent business component and not on the
MVG business component because the foreign key belongs to the parent record.
Complete information and examples are available in the Siebel Bookshelf:
Siebel Tools Guide, Business Objects Layer, Multi-Value Links, Primary ID Field
FAQ 1977: How to send custom HTTP headers while sending HTTP
request to external Web application through EAI HTTP Transport
business service.
Last Modified:
Area(s):
Release(s):
29 August 2003
Siebel EAI
V7 (Enterprise), V7 (MidMarket)
Database(s):
App Server OS(s):
Latest release tested
against:
Keywords:
In Siebel version 7.x, EAI HTTP Transport business service allows set-up of custom
HTTP headers while sending outbound requests. These headers might be required to send
additional information to the external Web application.
In order to generate custom headers, users need to set the input properties of the form
HDR.xxx where xxx is the header name. For example, in order to set a custom header
named "Test", input property name should be HDR.Test.
Note: Users cannot set such input property in the workflow process step because a . (Dot)
in the input argument indicates a hierarchy type. Users must write a custom business
service as a wrapper written in Siebel VB or Siebel eScript to set custom headers and
initiate the HTTP request. Users can then call this business service from the workflow
process.
Here is a sample custom business service written in eScript, which sets a custom HTTP
header named "Test" and sets its value to "MyTest".
function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{
if (MethodName=="SendRequest")
{
var bs = TheApplication().GetService("EAI HTTP Transport");
var inp = TheApplication().NewPropertySet();
var out = TheApplication().NewPropertySet();
inp.SetProperty("HTTPRequestMethod","POST");
inp.SetProperty("HTTPRequestURLTemplate","http://localhost/test/test1.asp");
inp.SetProperty("HDR.Test","MyTest");
inp.SetValue("Hello World");
bs.InvokeMethod("Send",inp,out);
return(CancelOperation);
}
else
return (ContinueOperation);
}
22 January 2004
Call Center/Smartscript/CTI
V7 (Enterprise), V7 (MidMarket)
Oracle
Windows 2000
V7 (Enterprise)
SmartScript, Assignment Manager
1. Question1
Name:
Answer Type:
Answer Control:
Save Business
Object:
Save Bus Comp:
Save Field:
Translations:
2. Question2
SRDescription
String
Default
Name:
Answer Type:
Answer Control:
Translations:
3. Page
TestQuestion2
RDsr2
RDsr2
English-American
Name:
First Question:
Translation:
Label:
Next Question:
4. SmartScript
TestPage1
SRDescription
English-American
TestPage1
TestQuestion2
Name:
Type:
Active:
First Page:
Translation:
Label:
Service Request
Service Request
Description
English-American
SmartScript_AssignSR
pick any value (Other)
Yes
TestPage1
English-American
Smart Script Assign
SR
4 November 2003
Siebel VB/eScript/Browser Script/COM
V6 (Siebel 2000-Enterprise), V7 (Enterprise)
All Supported Databases
Solaris, HP-UX
V7 (Enterprise)
eScript, shared library, SElib.dynamicLink
Background
This technical note provides information about creating a shared library on Solaris or
AIX, and accessing it from Siebel eScript. Shared libraries on Solaris are similar to DLLs
on Windows. By implication, the eScript must run within a Siebel Server on Solaris, for
example, a business service called by a workflow process.
Summary
Shared Library
A shared library is a collection of functions that are compiled in a special manner. It does
not contain a main() function. It can be linked to any executable program. The Linker
does not include the code segments to the executable directly, but a path to the code
segment. This implies that the program using shared libraries is smaller than the same
program linked with the static version of those libraries.
Shared libraries are identified by their extension .so whereas static libraries have the
extension .a.
How to Create Shared Library on Solaris:
-c
-o
-shared
-fPIC
LD_LIBRARY_PATH
The LD_LIBRARY_PATH environment variable defines the path where the Siebel server
looks for the shared library file. After the installation of the Siebel server,
LD_LIBRARY_PATH points to the siebsrvr/lib directory. Copying the custom shared
library file into this directory will mean there is no need to change the
LD_LIBRARY_PATH environment variable.
In HP-UX, SHLIB_PATH environment variable defines the path where Siebel server
looks for most shared library files. When using SElib.dynamiclink in HP-UX, Siebel
will look for the shared library in LD_LIBRARY_PATH environment variable.
Use of Shared Library in eScript
eScript provides the SElib.dynamicLink() method to call a shared library file. Please
note that there are some differences between using this method for a Windows dll and a
shared library. There are some parameters, which are not used for shared library. For
example Calling Convention(CDECL, STDCALL..) is not used when calling a shared
library using the SElib.dynamicLink() method.
The syntax for calling a function within a shared library is:
SElib.dynamicLink(sharedlibrary name, function name, parameter1,
parameter2)
Example:
//Declare a variable
var s;
//Initialize a variable
s = "
";
Technical Note 427: HTTP outgoing requests using Siebel Server Scripts
and Browser Scripts
Last Modified:
Area(s):
Release(s):
Database(s):
App Server OS(s):
Latest release tested
against:
Keywords:
20 January 2003
Siebel VB/eScript/Browser Script/COM, Siebel EAI
V7 (Enterprise)
DB2, Microsoft, Oracle
AIX, Solaris, Windows NT, Windows 2000
V7 (Enterprise)
HTTP Outgoing request, eScript, Siebel VB, Browser Script,
EAI HTTP Transport
Background
There are some situations where Siebel configurators need the ability to send HTTP
information back to external web systems, via http from within a script to confirm an
order or validate certain operations before the script can continue its normal execution.
There are different approaches to implement HTTP outgoing messages depending on the
type of scripting you have (Browser or Server script) and the type of Siebel client running
the script (Standard or High interactivity modes).
For the case of Browser and Server scripts and High Interactivity mode, users can use the
Siebel EAI HTTP Transport. For Low Interactivity mode, users can opt for a Java Script
based approach. Both these approaches are described in the next section.
Summary
From a scripting perspective, the Siebel EAI HTTP Transport can be used as a business
service providing both GET and POST methods for submitting the information to the
external system. It can be invoked either from Browser or Server script using similar
syntax, with the exception of the business service method invocation, where the Output
property is received differently in the Browser Script. See the examples section for more
details.
Another alternative in Standard Interactivity mode where business services are not
available in Browser Script is to use the Java Script Open method to construct an HTML
page on the fly, which posts the data to the external system.
Sample code
The sample code noted below presents both approaches, on invoking an ASP page and
passing to it two parameters: Data and Source using HTTP POST method.
Siebel eScript approach:
// Call EAI HTTP Transport
var sUrl = "http://localhost/testPost.asp";
var sRequest = "Data=MyTesting&Source=FromMyScripting";
var oService = TheApplication().GetService("EAI HTTP Transport");
var oInputs = TheApplication().NewPropertySet();
var oOutputs = TheApplication().NewPropertySet();
oInputs.SetProperty("HTTPRequestBodyTemplate", sRequest);
oInputs.SetProperty("HTTPRequestMethod", "POST");
oInputs.SetProperty("HTTPRequestURLTemplate", Url);
// Invoke EAI Service
oService.InvokeMethod("SendReceive", oInputs, oOutputs);
// Read Response Values (text)
var sResponse = oOutputs.GetValue();
Siebel VB approach:
Dim sUrl as string
Dim sRequest as string
Dim oService as Service
Dim oInputs as PropertySet
Dim oOutputs as PropertySet
oPostPage.document.write("<\/BODY><\/HTML>");
// submit the data
oPostPage.document.frm1.submit();
If the Siebel application is running in High Interactivity mode the user can also invoke the
EAI HTTP Transport service to post the data, however this feature is not available on low
interactivity mode in which the previous approach cannot be used.
Browser Script (High Interactivity Mode only) approach:
// Call EAI HTTP Transport
var sUrl = "http://localhost/testPost.asp";
var sRequest = "Data=MyTesting&Source=FromMyScripting";
var oService = TheApplication().GetService("EAI HTTP Transport");
var oInputs = TheApplication().NewPropertySet();
var oOutputs = TheApplication().NewPropertySet();
oInputs.SetProperty("HTTPRequestBodyTemplate", sRequest);
oInputs.SetProperty("HTTPRequestMethod", "POST");
oInputs.SetProperty("HTTPRequestURLTemplate", sUrl);
// Invoke EAI Service
oOutputs = oService.InvokeMethod("SendReceive", oInputs);
// Read Response Values (text)
var sResponse = oOutputs.GetValue();
References
For additional information on the HTTP Transport methods please refer to the Transport
and Interfaces: Siebel eBusiness Application Integration Volume III guide, chapter 4 "EAI
HTTP Transport".
Technical Note 207: Storing and Calling Global VB Functions Using DLLs
Last Modified:
Area(s):
11 November 1998
Siebel VB/eScript/Browser Script/COM
Release(s):
Database(s):
App Server OS(s):
Latest release tested
against:
Keywords:
V5 (Siebel 99-Enterprise)
All Supported Databases
All Supported Platforms
V5 (Siebel 99-Enterprise)
Global VB Functions, Using DLLs
Background
Siebel Visual Basic allows developers to create scripts on specific objects within the
repository, but does not directly support script sharing among objects for example, the
use of global functions and subroutines. For configurations that require complex functions
or subroutines to be called in several different places, making several copies of a script
one on each associated Siebel object can present a huge maintenance challenge.
The Siebel (COM) Application Server makes it possible for configuration teams to store a
function or subroutine in a .dll file and access it from any Siebel application object. This
approach simplifies the maintenance task and helps ensure that future changes to key
scripts are applied consistently throughout the application.
For cases in which the script has already been written in Siebel Visual Basic, the approach
begins with porting it over to a Microsoft Visual Basic .dll file. In order to access Siebel
application data and other state properties, the script will need to activate a reference to
the Siebel Application Server. Using the Siebel application server, the script can then
perform virtually all the same functions as Siebel Visual Basic, with a couple of minor
syntax changes. A few lines of Siebel Visual Basic (SVB) should be added to the objects
within Siebel applications that need to use the function. These will instantiate the class,
execute its methods and destroy it when done.
Summary
Porting the Script to Microsoft Visual Basic
Following steps will produce a .dll for storing the global function:
1. Open Microsoft Visual Basic
2. Choose Active X DLL from the New Project dialog box.
3. Open the references dialog box by clicking on Project > References
4. Add the Siebel Application Server class (also known as Siebel Business Object
Interface) by checking the box next to it.
End If
Set parentbc = Nothing
Set childbc = Nothing
End Sub
Private Sub Class_Initialize()
Set SiebelApplication = GetObject("", "SiebelAppServer.ApplicationObject")
End Sub
Private Sub Class_Terminate()
Set SiebelApplication = Nothing
End Sub
Visual Basic project bitmap