8/27/2010

Creating External Business Components or EBC in Siebel

                Hello!

                Toady lets talk about External Tables and Business Components. They are used to get data from external database (some other application non-Siebel). So let’s say you have to get data from three different tables in this external database, so then you use External Tables and Business Components. In first it’s seems like a complicated thing, but after all it is a very easy. And it can be done by using Siebel Wizard. So I’m not gone to invent bicycle because there already is full internet with help how to do this. So I take example from “Toolbox for IT” “Let's Talk Siebel” blog written by Sharfi. So here it is.

Creating External Business Components or EBC in Siebel
What is EBC?

So lets say you have some data in an external database which you want to show in Siebel. this data could reside in a table or may be in multiple tables and you have a view that queries these various tables to show u the data you want.

Siebel v7.7 and higher provides you an extremely easy way to get this data into siebel by means of what is known as "External Business Component", or EBC in short.

Configuration Steps

Here are the steps to configure your EBC.

** I am using the Oracle DB example. You could connect to any database thru EBC - DB2, SQL Server,

A. The very first thing you will do is create an External table.

1. get the DDL file for your external table.
here is how a sample ddl file will look like:

CREATE TABLE C00591.EBC_TEST
(
test1 VARCHAR2(20),
test2 VARCHAR2(20),
test3 NUMBER(10,3)
)

Save this file in your local machine.

2. Use siebel object creation wizard to create this table.
Go to siebel tools --> click on File --> New Object --> External Table Schema Import

3. The wizard will ask for following inputs:
i. Select Project this table will be part of from the list -
ii. Select the database where external table resides - Enter the database, for this example it is Oracle Server Enterprise Edition
iii. Specify full path of the file where table definition resides -
iv. Specify a 3 digit batch code for this import -
v. Click on Next and then click on Finish

Note: In order to import a view you still have to cheat siebel. Basically you will create a dummy DDL file to mimic the exact columns and datatypes that your view has and then import this table definition. Change the Type to External View.

4. This will create your External table. with a name like EX_001_0000001. The names of External tables begin with "EX_" the next 3 characters are batch codes and the rest is just a serial number.

* The Type field will be "External" for this table.
* You will also have to map one of the table columns to the Siebel's Id field. to do this: go to the desired table column and in the "System Field Mapping" column select "Id"

5. But hold on, you are not done yet. We still have to specify the data source name, in order to tell siebel where to look for your external table or view. Her'es how its done to enable your local client for accessing EBC.

6. Do the foll in your local cfg file

6.a. create an entry for a new datasource under [DataSources] section

c00591 = c00591

6.b. add a new section [c00591] to describe the datasource params:

[c00591]
Docked = TRUE
ConnectString = KCR2D
TableOwner = C00591
DLL = sscdo90.dll
SqlStyle = OracleCBO
DSUserName = C00591
DSPassword = C00591

Explanation of params:
Docked -
ConnectString - this is the entry for the DB in your tnsnames file
Tableowner - name of schema where your table/view resides
DLL - for oracle its sscdo90.dll
SqlStyle - OracleCBO
DSUserName - username to access the DB table
DSPassword - password to access the DB table

6.c. Now that you have defined the Datasource in cfg file, go back to siebel tools and add the datasource to your external table. Go to your external table, and go to the Data Source and add a new record:
Name = c00591

6.d. your External table is now ready for use in a EBC.

6.e. Use siebel object wizard to create a BC based on this table.

6.f. once the BC is created, change the Data Source property of the BC to "c00591"

You are now ready to use this BC in a applet/view/ 1:M links !!

________


7.Heres how to enable your thin/web client for accessing EBC. this is slightly different than the thin client configuration.

7.a. Create a new named subsystem of type "InfraDatasources"

7.b. Go to Administration - Server Configuration --> Enterprises --> Profile Configuration
7.c. create a new record with foll details:
Name = SharfiTest
Alias = SharfiTest
Subsystem type = InfraDatasources

Modify the following profile parmeters:
DSConnectString = KCR2D
DSPassword = C00591
DSTableOwner = C00591
DSUsername = C00591
DSDLLName = sscdo90.dll

You will also have to change the value of a hidden parameter "DSSQLStyle" thru server manager command line. Run the foll command to do this:

Change parameter DSSQLStyle="OracleCBO" for named subsystem SharfiTest

7.d. Add the new Datasource to your OM parameter, "OM - Named Data Source":

7.e. Go to Administration - Server Configuration --> Servers --> Components
7.f. Query for your application object Manager
7.g. Query for parameter = "OM - Data Source"
7.h. In the Value on Restart field you will see - ServerDataSrc,GatewayDataSrc
7.i. Change this to following:
ServerDataSrc,GatewayDataSrc,SharfiTest
7.j. Restart Siebel Server services.

7.k. Now that you have defined the Datasource in your Application Object Manager and restarted the services, go back to siebel tools and change the datasource on your external table. Go to your external table, and go to the Data Source and modify the Name field to:
Name = SharfiTest

7.l. Also modify the Data Source attribute of your BC to "SharfiTest"

7.m. compile, and replace the server srf to reflect this change and enable your EBC to work on thin/web client.

8/26/2010

Enable custom button on Applet


                Hello!

                Before I was gone to vacation, I had a requirement for which I needed to enable custom button on Applet with out using a script. As you may or my not know usual way to enable button on Applet is by using Applets Server Script like this (before scripting we create mini button Control with property “Method Invoked” set to name of you custom method in script, the we put this Control on Applet using “Edit Web Layout” option):

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
{
                try
                {
                                var iReturn = ContinueOperation;
                                if (MethodName == "SomeMethodBehindButton")
                                {
                                                CanInvoke = "TRUE";     
                                                iReturn=CancelOperation;
                                }             
                }

                catch (e)
                {
                                iReturn=CancelOperation;
                                TheApplication().RaiseErrorText(e.errText);       
                }
                                                               
                return (iReturn);
}
 
                And:

function WebApplet_PreInvokeMethod (MethodName)
{
                try
                {
                                var iReturn = ContinueOperation;
                               
                                if (MethodName == "SomeMethodBehindButton")
                                {
                                                iReturn = RulesExplode();
                                }
                }

catch (e)
                {
                                iReturn=CancelOperation;
                                TheApplication().RaiseErrorText(e.errText);       
                }             
               
                return (iReturn);
}

                And:

function SomeMethodBehindButton()
{
                try
                {
                                var iRet = CancelOperation;
                               
                                //your cutom script
                }
                               
                catch (e)
                {
                                iRet = CancelOperation;
                                TheApplication().RaiseErrorText(e.errText);       
                }             
               
                finally
                {
                                //your custom finalization
                }
               
                return (iRet);                    
}

                So, why did I have this problem? Easy, by clicking this custom button I had to run Browser Script, but as you my know or not know (I will tell this some other time) the flow for running scripts is like this: Applets Browser Script – Applets Server Script – Business Components Browser Script – Business Components Server Script. This means that I can’t run Applets Server Script before Applets Browser Script and that I can’t enable button by using Applets Server Script if I want to use Applets Browser Script. So I searched the World Wide Web and in Siebel Unleashed blog found a way to do this.

                It is pretty simple – all that need to be done is just add two words in Controls “Method Invoke” property before your custom method name like this – “EventMethodSomeMethodBehindButton”. That’s all. Now we can use it like normal method using just “function WebApplet_PreInvokeMethod (MethodName)” and “function SomeMethodBehindButton()” or as in my case I use it in Browser Script.

                There is another way by using user properties, but I never used yet so need to check it before I can tell you more.

8/25/2010

Siebel Wizard

                Hello!

                Today I will talk about Siebel wizard.

                So, wizard is a way how developer can easily create objects in Siebel Tools. But as always, wizard is really easy to use tool it has some disadvantages. First of all is that using it you don’t learn how objects are related to each other. So before starting using wizard you should learn how to create objects in normal way (by creating them with “New Record”).

                So to use wizard first of all you need to lock at least one project, then you go to File – New Object and choose witch object did you want to create. There are list of possible objects:

1)      General:
a)      Applet Method Menu – Defines the applet-specific menu that is available when the applet is activated;
b)      BusComp – Business Component;
c)       Command – Selects witch command will be activated when user click specific applet object;
d)      External Table Schema Import – Creates import for external table. Table that will use data from external system;
e)      MVG – Multi Value Group;
f)       Pick List;
g)      Report;
h)      Table;
i)        View.

2)      Applets:
a)      Chart Applet;
b)      Form Applet;
c)       List Applet;
d)      MVG Applet – Multi Value Group Applet;
e)      Pick Applet;
f)       Tree Applet.

3)      EAI – Used for Siebel integration with external systems:
a)      Integration Object;
b)      OLEDB Rowset;
c)       Web  Service;
d)      Data Access Service.

Those are the objects in Siebel 7.8 wizard so it my change if your version of Siebel is different.

So after creating object with wizard you just need to compile the locked project and your changes should be in system. But always remember witch objects you create and witch you change, because wizard will create more than just one new object and it will also change some existing for your new change. For example Pick Applet – for it you need to create Pick List, Data Maps and so on also. Remember if the new object will need to change an existing object, you should Check out the existing object. If you will not do so you will not be able to Check In the changed object and then if you Check It out you will overwrite changes made by wizard.

8/24/2010

Back in a saddle again

                Hello!

                Sorry for being away for two weeks, but I had a vacation and god as I enjoy it. So, but again back in a saddle again. So starting from today it will be one post for day (I hope) including Saturday and Sunday (I hope again).

So in little future I will be talking about “Python”, I know it is not Siebel related, but I have worked with it lately and really enjoy it - http://www.python.org/

Will give some information on using Siebel Wizard! With it you can make objects in Siebel step by step with wizard. But as always there is some issues with it and I would tell you them.

 Will tell something about external tables and external business components! They are used to get data from external system (integration).

                Will talk about pick applet creation with and without wizard!

                Tell you how to create a view and some other stuff that are related to views.

                Will explain about creating tables, as they sometimes can be real pain, because of applying and activation of them!

                Will give you some tips on technologies themselves, so you can do daily stuff easier and faster.
                So it will be lots of stuff going on so stay tuned.

8/06/2010

Siebel Object Architecture

Hello!

Today I will try to explain about Siebel Layers. This is very important thing in Siebel, because it takes down how the relationships between tables in Siebel are managed.

So as you know every program that works with large amount of data use database’s to manage its data in one place.  In this place data can be quickly retrieved.

If you ever worked with some database programs (for example easiest of all Microsoft Access), then you should know what is and how is relationships managed in database. Relationship is link between two tables that links them together. There can be 1:M, 1:1, and M:M relationship types. For example to understand lets take two tables (Account, Contact). Account can have many contacts. So it will be 1:M link. So in Contacts table is column account that stores the ID of Account to whom particular contact belongs. This is easiest of all examples. So, why Siebel Layers is so important? Because in Siebel relationships is created between Business Components in Business Layer not in database layer, tables all in all don’t know about those relationships. This is biggest difference between Siebel and any other database program (like MySQL or that same Microsoft Access).

OK below you can read about Siebel Layers and in this Bookshelf Picture you can look at how the layers look like. The text below is taken from bookshelf using 8.0v and represents layers shown in link with picture:

1)      Physical User Interface Layer. This layer contains Siebel Web template files that control the style and structure of the user interface. Web templates consist of HTML tags and proprietary Siebel tags. Siebel tags are embedded within the HTML of template files and serve as placeholders for user interface objects defined in the repository, such as controls and applets. At run time the Siebel Web Engine reads the tags, replaces them with interactive Web controls and values based on the UI object definitions, and renders the HTML that will be read by the user's browser.

2)      Logical User Interface Layer. Object definitions in this layer are the visual representation of objects in the Business Objects Layer. They define the interface presented to the user at run time, and allow users to manipulate data. Examples of user interface objects include applets, views, and controls, such as buttons and check boxes. User interface objects also define the information that associates objects in the repository with the Siebel Web templates.

3)      Business Objects Layer. Object definitions in this layer describe individual business entities (such as Accounts, Contacts, or Activities) and the logical groupings and relationships among these entities. Business objects are based on data object definitions.

4)      Data Objects Layer. Object definitions in this layer provide a logical representation of the underlying physical database. For example, object definitions such as table, column, and index describe the physical database. These object definitions are independent of the installed RDBMS.

5)      DBMS. The third-party database management system manages the Data Objects Layer. It is not a part of the Siebel Business Application.

8/05/2010

Browser Script Generation


                Hello!

                So as I promised, let’s talk about Browser Script generation.

                So first of all – to run a Browser Script you need to generate it. If you are developing application in Siebel Tools and want to test it you simply compile your configured object. For example you created a Browser Script on Applet. But before you can test its Browser Script you need to generate it. You can go to Views -> Options and choose Scripting tab to see where your Browser Scripts are generated. Simply go to this folder and delete all folders that have name like srf7845123265_753 or similar. Those folders hold the Browser Script JavaScript files that your Siebel Dedicated Client uses. When you delete all those folders you can compile your Applet. After compile you will see that Siebel Tools have created new folder there for you. It holds your Applets Browser Script. Now you can test it in Dedicated Client. If you want to compile or test more than one Browser Script (on different objects) then simply delete all folders and compile both objects. If you want that your Siebel Dedicated Client has all the latest Browser Scripts then simply get the last folder from your server (depending on architecture of project it can be on different places), and srf from server so you will have latest full compiled definitions.

                All in all it is not too hard to understand this, but in while when you work with Browser Scripts you will come arose some thing that dint goes in any kind of logic. For example that version with two Browser Scripts on different objects needs to be tested. You delete all folders then compile both objects and test them. Everything seems OK. But then you decide to change something in one object Browser Script and then you just compile it. What happens? Well you will never actually know. It can create new folder with only this object Browser Script and then Siebel Dedicated Client will use only this. It can do nothing to folders and then the new changes will not work. It could just update the particular Browser Script in already existing folder. That way I tell – before compile Browser Scripts delete its folders.

                Another big thing with Browser Scripts that makes them so painful is that they cannot be debugged. So forger about putting breakpoints in Browser Script code, they won’t work. So how we can tell where there are some errors? There is little way I have encountered. First Browser Script is JavaScript file that runs. So sometimes when JavaScript doesn’t work in Internet Explore you will see a triangle and explanation mark in lower left corner of browser. Simply click it and read the error. Maybe it will help you. Another way is to putt alert messages in the code to see what steps are done. Like you have 100 lines of code and you putted alert messages in each 25 lines (4 in all). So when you test application and three messages shows but last one not you know that error is between lines 75-100. Of course you need to put alerts in code in some logic way not just depending on count of line. For example to check witch steps of code are running witch not. To test some variables that you think didn’t populate simply output it in alert message to see them. Some times Browser Script will throw its own error message; most likely it will tell “undefined” usually it means that there are some syntax errors in code. For example you defined variable, but when you use it you misspelled the name of it by one character.

                So all in all this is most likely some of core things about Browser Scripts. Sorry if I dint put some code in, but as I understand if you read this you know how to program a code. And as Siebel support say try to avoid any kind of scripting and use configuration to implement your functionality.

8/04/2010

Browser Scripts

                Hello today! Today I will try to explain about Browser Scripts. I already talked about Scripting in general, but Browser Scripts are so hard to understand so I think about making whole post about it.
                So first of all in Browser Scripts you can script only in eScript, no VBScript. You can’t do a query in browser script and you can work only with values from fields that are seen on UI (they are on applet). With Browser Script you can interact with user input (make warning windows like “Do you want to continue?” with two buttons “Yes!” and “No!”). And biggest I think problem what makes Browser Scripts so painful is that they can not be debugged. So you need always double check your syntax to find errors. Second is Browser Script generation. For Browser Script to work it is needed to generate it. It generate JavaScript file that application uses.
                So step by step. All in all in Siebel Tools we use and create Browser Scripts just like Server Scripts – just right mouse button click on object and select Edit Browser Script. You can put it on Applet, Business Component and Business Service. It has similar methods like Server Script. One important thing to remember it that flow that Siebel engage is Applets Browser Script – Applets Server Script – Business Components Browser Script – Business Components Server Script. It means that it is flow that Siebel do if methods in flow doesn’t call some other method. And you can’t call Browser Script Method from Server Script, you can only return from Server Script to Browser Script (like if you called Business Service from Browser Script and when Business Service ended flow returned to Browser Script).
                Sorry don’t have so mush time today. Tomorrow will try to explain about Browser Script Generation.

8/03/2010

Hot Keys

                Hello today! Yesterday I was exploring the world of Siebel hotkeys. Actually there are many hotkeys that can make your life easier. Only user and developer needs to be careful because they differ in Client and in Tools! For example to query in Siebel Web (or Dedicated) Client, you need to do Alt+Q then enter the text and press Enter. But in Siebel Tools to query you do Ctrl+Q. So yesterday surfing in net trying to find all combinations I realize that there’s no place to find them officially, like in bookshelf. But there were many of people writing in blogs and in forums about this and giving those discoveries about hotkeys and combinations. So I will not be lazy Siebel blogger and will give my part in this too. So downwards is some hotkeys I manage to find by myself in Siebel, some are taken from other sites. I don’t want to tell you that they all work, because I dint had time to test them all and maybe the keys differs from version to version, I don’t know. So here is my list:
Hotkeys:

Siebel Tools:
Ctrl + Q                                 - Query
Ctrl + F7                               - Srf Compile
Ctrl + F10                             - Check In Object
Ctrl + E                                 - Hide Unhide Object Viewer
Ctrl + Shift + F9                    - Clears All the Creak Points

Siebel Client:
Alt + Q                                  - Query
Alt + R                                   - Refine Query
Ctrl + Shift + X                      - Log Out
Ctrl + Shift + A                      - Go to Site Map
Ctrl + W                                - Immediately Kills Active Window (Use It When Going Back Home)
F2                                          - Open Pick Applets and MVGs
Ctrl + Up                               - Previous Record
Ctrl + Down                           - Next Record
Alt + Down                            - Next 20 Records
Alt + Up                                - Previous 20 Records
Ctrl + 8                                  - When Siebel Client Hangs This Shortcuts Brings Back the Control to IE, And               Then You Can Submit the New Requests

Function:
Ctrl + N                                  - Add New Record
Ctrl + I                                    - Insert New Record
Ctrl + D                                  - Delete Record
Ctrl + B                                  - Copy Record
Ctrl + Y                                  - Redo Edits to Record
Ctrl + X                                  - Cut
Shift + Delete                          - Cut
Ctrl + C                                  - Copy
Ctrl + Insert                            - Copy
Ctrl + V                                  - Paste
Shift + Insert                           - Paste
Ctrl + Z                                  - Undo
Alt + Backspace                     - Undo
Ctrl + Y                                  - Redo
Delete                                     - Clear Text
Ctrl + P                                   - Print
F9                                           - Send Mail
Ctrl + F9                                 - Send Fax
Shift + F9                                - Send Page
Ctrl + L                                   - New Correspondence
F1                                           - Help
Shift + F1                                - Context Sensitive Help
Alt + F4                                  - Exit Application

General:
Ctrl + H                                  - History
Ctrl + G                                  - Search
Enter                                       - Carry Out an Action
Esc                                          - Cancel an Action

Navigation:
Up                                          - Up
Down                                      - Down
Left                                         - Left
Right                                       - Right
Page up                                  - Page Up
Page down                             - Page Down
F3                                          - Next Pane
Shift + F3                               - Previous Pane
Tab                                        - Tab Right
Shift + Tab                             - Tab Left
Ctrl + E                                  - Drill Down
Ctrl + O                                 - Switch Menu
Ctrl + Tab                              - Navigate Between Applets
Ctrl + Down                           - Navigate To Next Record
Ctrl + Up                                - Navigate To Previous Record

Editing:
Insert                                    - Insert
Delete                                   - Delete
Delete                                   - Backspace 

Query:
Ctrl + Q                                - New Query
Ctrl + R                                - Refine Query
Enter                                     - Execute Query
Ctrl + S                                 - Save Query As
Ctrl + K                                - Use Saved Query

Pick list:
F2                                           - Popup Pick list
Enter                                       - Pick Selected Record in Pick list
Arrow Keys                            - Navigate To Appropriate Record
Ctrl + N                                  - Add New Record

Association:
F2                                           - Popup Association List
Enter                                       - Add Selected Records
Arrow Keys                            - Navigate To Appropriate Record
Ctrl + N                                  - Add New Record
Ctrl + U                                  - Display the List of Values for Thread Field

Multivalue Group (MVG):
F2                                           - Popup MVG List
Enter                                       - Add Selected Records
Arrow Keys                            - Navigate To Appropriate Record
Ctrl + N                                  - Add New Record

Dialog Box:
Tab                                         - Move to Next List Box, Option Group
Shift + Tab                              - Move To Previous List Box
Arrow Keys                            - Move within Active List Box
Esc                                          - Close List Box
Enter                                       - Choose the Default Command
Esc                                          - Cancel the Command, Close List
Home                                      - Move to Beginning of an Entry
End                                         - Move To End Of an Entry
Arrow Keys                            - Move One Character Left or One Right
Shift + Home                          - Select From Cursor to Start Of Entry
Shift + End                             - Select From Cursor to End of Entry
Shift + Left                             - Select Character to Left of Cursor
Shift + Right                           - Select Character to Right of Cursor

Field Controls:
F2                                           - Show A Calendar
F2                                           - Show A Calculator
F2                                           - Show A Text Box

Screen Specific:
Ctrl + T                                  - Threads in Progress Button

Miscellaneous:
Ctrl + F                                  - Find