Mike M. Lin a seasoned Siebel Consultant has provided really good information on Extending Siebel Objects. He has written this post in response to interest generated by ABS/ATI framework series posted here.
His post gives us an important insight on how ATI/ABS framework might have been implemented.
You can read it on his blog but for the continuation of the ATI/ABS framework series I am posting the contents here also. Here is what he has to say:
I really believe in tool sets, and I’d like to see some Siebel hackers out there expand on the idea. How this tool set was built is not really obvious, so I’d thought I’d take a stab at it. Respecting the fact that the ATI Framework is proprietary, I won’t give a whole lot of detail reverse-engineering the complex API calls I saw in the posts. However, I will show some basic techniques you can use to build your own framework using some simple examples. It would help to know a bit about objects and properties in JavaScript.
To keep the post relatively short, I’m not going to give any examples to validate that this stuff actually works. I’ll leave that to you, because it’s best to figure some things out yourself. If you’re having problems, just know that I have successfully tested these concepts.
Is this value in the array?
Sometimes you have to search an array to see if a particular value exists. Nothing a little “for” loop can’t take care of. But if you need to do this with any kind of frequency, why rewrite it every time? Also, what if a developer introduces a bug while trying to reimplement it? Write it once, make it work, and reuse it. Not only will you reduce your exposure to programming errors, but it will make your programs more succinct, and much easier to comprehend.
You can always add an application method that takes a reference to the array and the value you’re searching for and returns a true or false, but I always wondered why this method wasn’t part of the Array object to begin with. Let’s go ahead and make it part of the Array object by modifying the prototype property to include a custom function. I put this in the “(declarations)” section of my application server script (which I chose because it’s the first script I know of that’s executed when the application starts):
Array.prototype.Exists = function (value)
{
for (var i = this.length - 1; i >= 0; i--)
if (this[i] == value) return true;
return false;
}
Once this sets up you’ll be able to see if the value “5 of spades” exists in your aCardDeck array: aCardDeck.Exists(“5 of spades”);
Accessing the Application Object
Ever get tired of typing TheApplication() every time you need to access an application method? Well those on the ATI Framework don’t. It looks like they’ve reduced the application reference to some sort of global variable “TheApp”, accessible from any object.
If I had a business component and wanted to make “TheApp” available from anywhere within that object, I could add a line like “var TheApp = TheApplication();” to the “(declarations)” section of the business component. But that means I’d have to add that line to every business component, which makes me angry. You won’t like me when I’m angry. So how can we avoid the maintenance hassle, and me turning into a big green monster?
What if we update the prototype of the business component object to include “TheApp”? That sounds like a good idea. Well unfortunately I haven’t been able to figure out what the business component object/constructor is actually called. I’ll do the next best thing, which is to add “TheApp” to all custom objects. The business component object must be derived from the Object class. So here’s another addition to the application “(declarations)”:
Object.prototype.TheApp = this;
Remember, that “this” is the application object, since we’re doing this from the application “(declarations)”. This approach has the added benefit of enabling “TheApp” reference from all Siebel objects including business services, applets, and, yes, the application object itself. It surprised me that the application object was able to access “TheApp”, since the prototype was modified after the application was already instantiated.
Adding a Custom Business Component Method
Let’s say, for some reason, you constantly find the need to get business component field values in uppercase characters only. Well here’s what I added to the application “(declarations)” this time:
Object.prototype.GetFieldValueUpperCase = function (sFieldName)
{
return this.GetFieldValue (sFieldName).toUpperCase ();
}
Now if you have some bc “bcFoo”, you can get the value for field “Bar” in uppercase characters by doing something like, “bcFoo.GetFieldValueUpperCase(“Bar”);”
When this is called from a business component object, then all the references to “this” refer to that business component.
The unwanted side-effect here is that this method is enabled on all custom objects because we updated the prototype of the Object class. Since GetFieldValue() is only supported on business components, this will fail on any other object. So, if anyone finds the object/constructor names for any Siebel objects, please let that cat out of the bag. In any case,
I think you guys have had enough. Don’t forget to let us all know if you find the object/constructor names for any Siebel objects. And if they’re any new discoveries or breakthroughs out there, please comment about it. But for now, happy hacking!
<< Previous in series Next in series >>







This is simply awesome.. I have done some tools to automate siebel works.. but this is extraordinary.. Hats of to Neel for his work.. thanks a lot Mike
Off Mike’s cue, i’ve written an article on how to implement an eScript Framework. If you’re interested, please see my article “A Siebel eScript framework”.
http://blog.jasonle.com/2009/03/blog-post.html
Wow!
Enough information to build own framework… Thanks to everyone, i will try to add some things to it.. may be till then we would have plenty of frameworks to work on
Hi,
I have some doubt. When you create that Exists method it is also displayed when you are running for..in loop on array variable.
Example:
Array.prototype.Exists = function (value) {
// some code here – irrelevant
};
var arr = new Array();
arr["a"] = “a1″;
arr["b"] = “b1″;
var txt =”";
for(var a in arr) {
txt += a+” “;
}
TheApplication().RaiseErrorText (txt);
// the error is: a b Exists (SBL-EXL-00151)
Any thoughts about that? bookszelf is saying only to set attribut of DONT_ENUM – which i don’t know how to set
The ABS framework is good for a hard large sized enterprise such as a bank system where it is important to re-use Siebel objects as much as possible.
But tradeoff is many bad things:
1. If ABS framework was implemented on Siebel 7, good luck upgrading it to Siebel 8. Many things break in the ABS framework on Siebel 8 and Siebel support cannot even help us. The author of the framework will only help if paid, there is no ongoing support of the ABS framework or free upgrades to new versions.
2. You need some very skilled Siebel developers to maintain the ABS source code. These skilled Siebel developers cost alot of money.
3. There is no documentation for the ABS framework, there is no website for the ABS framework, there is only hype on Siebel blogs.
4. Oracle Siebel Support can not support the framework. If you upgrade to Siebel 8 it will not work and need to pay big bucks to upgrade it. What about future upgrades? Again more bucks.
Jeremy is right to say that some very skilled Siebel developers are
required to maintain the ABS source code. However, he did not take
into account that Siebel will not help him in understanding framework
used in his application. Likewise, Microsoft will not help 3rd parties
in understanding the Access database application created by them. Only
ignorant people think all problems could be solved by Siebel.
I don’t think the ABS problem is only limited to be solved by its
in
Creator. Modification is no doubt difficult but feasible. My favourite
ABS feature is logging and I love it. It has been modified by me to
work on version 6, 7 and 8. I’m using ABS to dispatch logging files
from one version to another, as my workplace has two Siebel
environments (6 & 7) in production and one upgrade (from 6, 7 to
progress. There is no major hassle to make ABS work on version 8. Is
it difficult??? It was straightforward for me unless I missed
something.
I have heard a lot about logging feature of ABS Framework but I don’t know what exactly it does?
I mean:
What kind of details are captured?
Where are they logged in a table or file?
What is the meaning when you say “Dispatch logging files
from one version to another” ?
An example of a log file created by ABS will be really helpful if it is possible to do so!
I hope No_artificial will be able help us out with these questions!!!
> What kind of details are captured?
The logging is a tricky business. I once saw a mediocre error handling
framework was done by 2 developers in more than 7 months.
Unfortunately the achievement is much less compared to ABS.
In ABS, I can see the both type and value of the arguments passing
between the functions in using any ABS-compliant syntax. If the
arguments are PropertySet (of Input and Output objects), the structure
can be revealed in cascading or XML format…. The logging location is
specific to each individual users who can create their own sub
directories, but the environment team has a control in using the
parent directory…. There are too many features, I mean the killing
features if you know and use them all. The miracle is that the ABS
achieves all these in less than 500 lines of codes, and it seems that
it was completed in less than 7 hours.
If talking big bucks, the man days required for 2 developers for 7
moths are much much more than 7 hours.
> Where are they logged in a table or file?
Actually both table and file are available, but I only used the log
file for troubleshooting. The table is more useful in UAT testing and
this is another major topic.
> What is the meaning when you say “Dispatch logging files from one
> version to another” ?
The term of “dispatch” is used in my project, and it has nothing to do
with ABS. The dispatch requirement was quoted by a consulting firm
demanding as many as 200 man days, but my team made it in 20 days by
hacking the ABS framework. However, there are exceptions.
Hi Neel,
I have tried Object.prototype.TheApp = this in application server script declaration section but not succeeded.
Would any special setting required for implementing this code in standard siebel 8 application.
I just wish to use TheApp in all other objects such as BC,Applet and BS.In my case TheApp throw the error undefined.
Thanks,
Himanshu
Hi, I’m using very similar approach since I’ve realised that escript is modified javascript. But this approach looks to me a little bit unsafe .. Have you tried to make a test with (reapeatable) components that runs Business service with calling to such global function? I think that application server escript is triggered only when user opens it, but I doubt it’s the case of (repeatable) components, they don’t need user navigation and that way your script crashes. When server alone runs something, there is no information from your session. There must be a place that initializes that for it.
My approach is to make special function called include which includes another Busines Service (in object of my desire) with those global functions, then I can call them directly.
I have no Siebel 8.0 at my disposal so I can’t look at the “upgrade” for that version.
No, I don’t think application will crash if use this approach and call it through RCR.
The only difference when a script is executed on server side is that current context is different so if you script uses functions like this.ParentBusComp() or ActiveView or GetProfileAttr they will fail.
but the BC, Application instances are created in same way so there is no difference.
Of course applet scripting and runtime events are not called so your script written on those objects will never get called.
Can you provide example your approach it will be interesting to see actual differences between the two approaches
Sorry, I’ve used wrong words
, it will not crash but it will not find those custom functions unless you specify them in those Business Services.
I’m using one Special Business Service, which has my often used functions inside (log function, date conversions, string operations etc). When I’m creating new BC, BS or so, I copy-paste function include into it and call it from declaraction part with parameter equal to that Business Service name. That function looks at TheApplication() object, if there is object defined under that name in my special array. If so, only pointer to that object is returned (no need for repeating initialisation). If not, standard way of BS initialisation takes place with blank call to BS from function parameter. This way, Siebel creates javascript object and initialize my custom functions in it. Then I put a pointer into TheApplication() and return pointer as a result of function.
Also in the declaration part there will be something like
var gF = import(‘Global Fncts’);
After that I can call all the functions freely and directly like:
gF.log(x,y,z);
where log is function defined in Global Functions BS.
This way you can include as many BS as you want and only those you need. It’s server side safe, but you need to copy-paste that first function for the first time you are going to “escript” on object.
And one more thing … those imported BSs are debugger friendly
. You will be able to actualy run through code with siebel debugger. When you are using prototype style, you can’t do that.
For people with siebel 8.0. Have you tried to check whether prototype variable exists? Siebel 7.0 had _prototype property, this property was then wrapped into some wrapping object and the property becomes invisible. There is possibility to even inherit functions from one Business service by another in 7.0, but your debugger will not enter parent functions … However there is possible “workaround” to simulate inheritance and be able to debug even parent functions.