Showing posts with label Configuration. Show all posts
Showing posts with label Configuration. Show all posts

Wednesday, May 7, 2008

Siebel Business Component Outer Join - How Important?

During my past two years of working on Siebel I have come across lot of situations where just one little miss can wreck havoc with the application. It can result in performance issues and Data issues. I think some of you might have guessed by know what miss I am talking about.

I am talking about Outer Join Flag on Join Section of the Business Component. Joins are the integral part of Siebel configuration. They are indispensable, joins are required because we know the database (it can be oracle, DB2 or Microsoft SQL Server) is a relational database known as RDBMS in short form. Which means the information that resides in it is in the form of related tables and we always need information of one table in another. These tables are related with the help of Foreign Keys (FK). So, when we want to show information of one table in another we use Joins and we use them all the times.


When we are creating Joins in Siebel you can see a field called Outer Join Flag. Please see the screenshot below.



and every time we don't check that flag we are heading for trouble.
Now, what exactly does that flag represent? Before I explain it I assume that you have basic understanding of SQL and simple joins. As I have mentioned earlier that everything that configure or do on UI is converted into SQL and that is where this flag comes into picture.

For example see the simple sql pulling data from another table with the help of simple join

select name b
from siebel.s_opty a, siebel.s_doc_quote b
where b.par_row_id = a.row_id
and a.somefield = b.somefield
and a.row_id = 'Some Id'

Now this SQL is suppose to select name of the quote where the par_row_id column (which store row id of its parent) is equal to the row if of opportunity and in addition to that somefield of opportunity is equal to some field of quote. Now we assume that you had created a join between Opportunity-Quote and forgot to check the outer join flag.You will be amazed to see that there are No Records on UI. The reason being it will try to match the exact values in the field and any record that is a not a match will be discarded. Which means if there are some records that have no value in 'somefield' either in Opportunity or on Quote will be discarded. What if we want those records to shown? We have to check the Outer join flag which will result in a query as given below

select name b
from siebel.s_opty a, siebel.s_doc_quote b
where b.par_row_id = a.row_id
and a.somefield = b.somefield(+)
and a.row_id = 'Some Id'

Which will result in all the Quotes that have 'Some Id' in par_row_id or in simple terms that have Opportunity Id with 'Some Id' as their parent.

My experience has taught me to ask this as the first question whenever I face problem mentioned above and I have seen developers sweat over this kind of problem for hours before they spot it. I will mention some real life situations I have faced which were due this little (or rather huge) miss while doing configuration.

Examples - Real Life Situations:
We have developed a web service that resulted in the insertion of quotes from a Java Application. When we inserted a quote it got inserted successfully and when we tried to update it, it Failed. It took us almost a day to find out that a developer had created a new join in business component and forgot to check that Outer Join flag which resulted in update to failed as it was not able to fetch that record.

I had created a new View in Assets Screen. When user was in My Assets view then he was able to see the records but as soon as he choose All view the records disappeared. The reason same a new join and forgot to check Outer join flag.

Whenever you face this kind of problem go through logs and more often than not you will find this as your root cause. To know more about logs read my Post Siebel - Logs How useful are they?

If this Post was helpful to you please post some comments and come back for more.

Siebel Profile Attributes - an Overview.

Profile Attributes I stumbled upon them in siebel when I was working on my first assignment involving Siebel EAI. Till that time I had only used and heard of Global Variables which you could use throught out your script.

But as the requirement said only if user clicked a button in View A and then performed some particular action in View B trigger a workflow.

As views involved had different BC's it was not possible to have done through global variables. Then my senior colluege introduced me to a new entity in siebel called 'Profile Attributes'. They are important because they have a unique property. They are available throughout the application. The best term that comes to my mind to describe them is 'Session Variables'. Those who have worked a little bit on development of Web Application will understand exactly what I am saying and for those who hasn't worked on them I will explain.

As you know from siebel 7 onwards it has Web Architecture. So, as soon as you login into siebel through your browser a session is started which last till time you log out or you close your browser window or according to the length set through session parameter at server level.

Now discussing in details that how server maintains this session and what goes on behind the scene is out of scope of this article
but what you need to know is that Siebel server recognises every unique user through session id that is given to you when you login to siebel and it remains valid until you session closes due to above mentioned reasons. So, Profile Attributes are variables that can hold any value during the session of the user. There are two methods available to in siebel escript that help you to work with Profile Attributes.

  • GetProfileAttr
  • SetProfileAttr

GetProfileAttr method is used to retrieve the value of a particular profile attribute. The syntax is

TheApplication().GetProfileAttr("ProfileAttrName")

SetProfileAttr method is used to set the value of Profile Attribute. If the Profile Attribute that you mention is not already existing it creates a new Profile Attribute. The syntax is

TheApplication().SetProfileAttr("ProfileAttrName",Value)

So, to accomplish the our requirement we Set a profile attribute when clicked the button on view A and then when he went to View B and did the particular action we wanted we retrieved the value of the profile attribute and if all the conditions were met we executed the workflow and everybody developed happily ever after :)

But, there is a twist in the story and it was not a happy ending after all which highlights the fragile nature of Profile Attributes. Now, in a particular situation this solution won't work. If user clicked button on View A and then logged off which meant profile attribute is destroyed hence the functionality failed. So, as you all must have guessed this solution was scrapped :(

So, the moral of the story is use Profile Attributes with caution and only if you are sure that if the session is destroyed you functionality wouldn't fail.

Siebel Search Specification (Search Spec) – What about it?

This article has been submitted by Nidhi Puri having Siebel experience of 2+ years and right now working as Project Lead.

A Search Spec is nothing but a filter on the returned set of records and if we we look atc it from database point it acts as where clause in the SQL that is formed which restricts the number of records that will be retruned from database.

In Siebel we can apply search spec to

  • Applet
  • Business Component
  • Link
  • Picklist

1. For an Applet, a search spec filters the records that are displayed on UI. The underlying BC brings back a set of records and before they can be displayed, the applet search spec applies the filter on them and displays only a subset of records.

2. For a Business Component, a search spec filters all records that would be returned from the underlying base table. This would also result in the filtering of records on the applet tied to this BC. However, the search spec in 1 above works only for that particular applet while on a BC, the search spec is inherently applied to all applets that are based on this BC.

3. A search spec on a Link will filter all child records from the destination BC.

For Example
Account/Address link. Search spec looks something like this: [City] = ‘London’, this will bring back all address records for the account where the City = London.

4. A search spec on a Picklist will filter the data that the picklist points to. For static picklist, the data exists on the List of values, so the search spec for a static picklist would look something like this:

[Value] <> 'Corporate'. This would show all values other than "Corporate" when you click on the dropdown. For dynamic picklists, the search spec would something look like this: [Active Flag] = ‘Y’, this would bring back all records from the destination BC (on which the picklist is based on) where the Active Flag = Y

Siebel CRM - Configuration File (cfg) Disected and Explained.

Today we are going to discuss about one of the most important files for Siebel CRM. Yes, those who have worked on Siebel will know what I am talking about.
Yes, we are going to discuss ".cfg" file which stands for configuration file which largley controls siebel bhavieor. There are basically 3 important cfg files.

1. eapps.cfg
2. tools.cfg
3. cfg file for Siebel Client(Name can depend on the kind of siebel application you are using)
so for this article we will assume uagent.cfg which is used if you are using call center.

To discuss eapps.cfg is out of scope for this article so in this article we will be discussing tools.cfg and uagent.cfg file.

Tools.cfg is used for Siebel Tools and uagent exsits for Siebel Client both dedicated and thin. First of all the location of the file.

Tools.cfg exsits in :siebel installation directory\tools\bin\enu
Here enu means the language that you have choosen. It can be different if you have installed siebel tools in langauage other than english.

uagent.cfg exsits in : siebel installation directory\web client\bin\enu.
For thin client the cfg file exsits on server and the path is
/siebel install dir/siebsrvr/bin/enu if the server is Unix
siebel install dir\siebsrvr/bin/enu if the server is Windows
Now I will describe various sections of CFG file.

In CFG file anything that starts from [] is a section that contains certain Parameters to control siebel. I will list important sections that are important and we need modify them often

1. [Siebel]
2. [DataSources]
3. [Local]
4. [Sample] Only used if you have installed sample database
5. [ServerDataSrc] Very important and modified often.
6. [SWE]

Tip: If you want to comment anything in cfg file use ; a semicolon in front of any line would mean that siebel is going to ignore that line treating it as comment.
I am goint to list only the important parameters in the sections.

1. [Siebel] : This section contains important parameters related to siebel. Which are as following

RepositoryFile :Name of the SRF file to be used
ApplicationName :Name of the Application to be used
ApplicationTitle :Name that is going to appear in Title of your browser window and can be anything
ApplicationSplashText :Name that is going to appear when you start you dedicated client and can be anything
EnableScripting :Often used for debugging purposes. If set to false no script is going to execute when you start you client
LocalDbODBCDataSource :Name of the ODBC data source that is going to be used when you start dedicated client with local database (SSD Local Db default instance by default)
ServerDbODBCDataSource :Name of the ODBC data source that is going to be used when you start dedicated client with server database (SSD default instance by default)
DockRepositoryName
:Name of the repository that is going to be used.
WebClientSiteDir : Path to the directory from where the browser scripts and images are going to be picked up
EnablePersonalization : To Enable or Disable personlaization for Siebel Users
EnableRuntimeEvents : To Enable or disable Runtime Events
EnableObjectCOCI : To Enable object check in check out when set to false you are not allowed to check out a single object. Remember Object checkout has to be enabled from tools also before you can do that

2. [DataSources] : This section contians the what you can see from the dropdown of you dedicated client. Default values are
Local = Local
Sample = Sample
ServerDataSrc = Server

You can specify more datasources under this section to specify more section you have to define it in the following way.

MyNewDataSource = NewDataSource
MyNewDataSource is the name of the Section that should be present in the cfg file that is going to contain parameters to be used for this datasource
'NewDataSource' is the value that is going to appear in the dropdown of dedicated siebel tools or client.
3. [Local] : In this section only one parameter is important and that we can change to our advantage
ConnectString = C:\PROGRA~1\Siebel\7.8\Tools\local\sse_data.dbf -q -m -x NONE -gp 4096 -c256m -ch256m

As you can see the value of the connection string is in the form of Path and then switches.

The path is the path to your dbf file and the switches that you can give are as following
-q : means start local database in quite mode.This prevents a SQL Anywhere window from showing up.
-m : truncate transaction log after checkpoint.
-x NONE : Do not load any network drivers.
-gp 4096 : Tells the engine that the database page size is 4,096 bytes.
-c256m : Initial cache size is 256 MB
-ch256m : Maximum cache size can be mb256.

4. [Sample] : This section is pretty similar to Local Section with exception of one parameter

FileSystem : It contains path to you file system where you attachments are stored

5. [ServerDataSrc] : This is one of the most important section and you have to change few parameter before you can actually login to server through Dedicated Client.

ConnectString : Here just like local section indicates the connection string to be used to connect to server
FileSystem : Path to you file system. Similar to local section
GatewayAddress : This will contain the name of your Siebel Gateway Server. This section has to be changed to a valid value
EnterpriseServer : This will contain the name of your Siebel Enterprise Server.This section has to be changed to a valid value

6. [SWE] : This section contains parameters related to the bitmaps and appearance of Siebel Client. But It contains an important parameter which is as following.

ClientBusinessService : This parameter is used if you want a business service to be called from browser scripts. The Business service has to be mentioned here in this section.
The format to mention the business service is

ClientBusinessServicen = "Business Service Name" where n is a incremental number one more than the number mentioned in last ClientBusinessService entry. For example
ClientBusinessService0 = "Message Bar"
ClientBusinessService1 = "Communications Client"

If I want to have one more entry in the file then I will enter
ClientBusinessService2 = "Business Service Name"

This completes the listing and explaination of important parameters of the cfg file used by siebel tools and siebel client.

Hope this post was helpful to you. If yes please post your comments and visit again for more.
All Rights Reserved