I think most of Siebel 7.7.x and Siebel 7.8.x applications are ST enabled, by now in readiness to upgrade to Siebel 8.x as ST is the default script engine in Siebel 8.x. You wouldn’t want to upgrade to Siebel 8.0 and realize that most of your scripts are failing there. Though most of us have ST engine enabled for our applications but I don’t think many of us are completely utilizing its capabilities.
One of the main difference between ST and T engine is that in ST we can typecast our variables which helps improving performance and better memory management of application but typecasting of variables is optional not compulsory. So, even if I don’t typecast my variables my script will work. This post intends answer questions given below:
- How do I typecast variables in ST engine?
- What types are available?
- Do I really need to typecast variables?
- Is there any downside of typecasting variables?
How do I typecast variables in ST engine?
The syntax of typecasting a variable is as following
var variablename : type; for example
var psIn : PropertySet;
In the above example I am typecasting “psIn” variable to be of type PropertySet.
What types are available?
Below is the list of types that we can use in ST scripts. (This list may not complete please feel free to add to this list through comments, in case I have missed something.)
- var bo : BusObject;
- var bc : BusComp;
- var ps : PropertySet;
- var svc : Service;
- var flag : bool;
- var chrType : chars;
- var intFloat: float;
- var intNum : Number;
- var str : String;
- var boolObj: Boolean;
Do I really need to typecast variable?
Syntactically it is not necessary to typecast variables. ST engine can run on script using both typeless variable (using only var statement) and typecast variables (using appropriate type) but to make use of complete capabilities of ST engine you should consider typecasting at least variables that will store objects such as Business Objects, Business Components, Business Service etc.
Is there any downside of typecasting variables?
Surprisingly the answer of this question is Yes, there is downside. Typecasting variables to String and Number does have an impact as you cannot compare two different data types. For example
var fnum = “10”;
var snum = 10;
if(fnum == snum)
return(1);
else
return(0);
Above statement will return 1 because when you don’t typecast your variables then an implicit conversion takes place but if I change my code to:
var fnum : String;
fnum = “10”;
var snum : Number ;
sunm = 10;
if(fnum == snum)
return(1);
else
return(0);
Then comparison will fail and it will return 0 as you cannot compare a “String” and a “Number” type which means that typecasting your variable can cause lot of “if” conditions to fail.
Also it has been observed that typecasting variables to “String” and “Number” can have adverse impact on performance. So, it is better to take middle path which is to typecast variables that will store objects types such as Property Sets, Business Objects and Bus Components and leave your other variables as it is.
Please feel free to express your thoughts!


(7 votes, average: 4.71 out of 5)