eim

20
CONTENTS 1. WHAT IS SIEBEL EIM ? 2. SIEBEL INTERFACE TABLES 3. MAPPING BETWEEN INTERFACE & BASE TABLE 4. CONFIGURATION FILE 5. EIM PROCESS 6. DATA IMPORTING 7. IMPORTING AN ACCOUNT Birlasoft Ltd. Classification: CONFIDENTIAL

Upload: gadige-chakri

Post on 21-Nov-2014

548 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: EIM

CONTENTS

1. WHAT IS SIEBEL EIM ?

2. SIEBEL INTERFACE TABLES

3. MAPPING BETWEEN INTERFACE & BASE TABLE

4. CONFIGURATION FILE

5. EIM PROCESS

6. DATA IMPORTING

7. IMPORTING AN ACCOUNT

Birlasoft Ltd. Classification: CONFIDENTIAL

Page 2: EIM

What is SIEBEL EIM?

The Enterprise Integration Manager (EIM) manages the bi-directional data transfer between the Siebel base tables and the Siebel interface tables. The process of data movement between base tables and the interface tables is very complex. Hence a manager is required for this process of data movement. We must use EIM to perform bulk import, export, merge, and delete operations because Siebel Systems do not support using native SQL to load data directly into the Siebel base tables.

SIEBEL INTERFACE TABLES

Siebel interface tables are intermediate database tables that act as a staging area between the base tables in the Siebel Database and other databases

EIM tables are required to perform major EIM functions: import, delete, merge and export since the direct process of data movement from external data base to Base tables is very complex.

MAPPING BETWEEN INTERFACE TABLE & BASE TABLES

There is a many-to-many relationship between Interface table and Base tablesi.e.

An interface table may populate more than one base table A base table may be populated by more than one interface table

For e.g.

Birlasoft Ltd. Classification: CONFIDENTIAL

Source(external)

Interface (EIM)

Where data ends up

How to get there

Page 3: EIM

EIM_ACCOUNT table can populate both S_ORG_EXT table as well as S_ADDR_ORG

While performing data movement activities, it is necessary to know which interface table will be loading data into which base table and vice versa. In other words, understanding data mapping becomes a necessity.

In order to find out which Interface table is populating which base table, it is possible to do so using Siebel Tools.

Login to Siebel tools Click on Flat Tabs EIM Table Mapping

Birlasoft Ltd. Classification: CONFIDENTIAL

Page 4: EIM

The following fig. shows the various EIM tables that base table S_ORG_EXT populates:

Another method of finding out the relationship is through viewing the bookshelf.

Open the bookshelf Individual Guides > Interface Tables Reference > Interface Mapping

Summary

CONFIGURATION FILE:

For all EIM processes to function, the Enterprise Integration Manager requires a configuration file to be present in the admin subdirectory of the Siebel Server. This file contains various parameters which define what operations the EIM is required to perform. The file is an ASCII text file and has an .ifb extension.

The general format of this file is:

(a)Header Section: The header section consists of parameters given at the beginning of the .ifb file.

[Siebel interface Manager] : This keyword must be present at the beginning of the .ifb file.

PROCESS : This provides the manager with information on the activity to be performed. For e.g. Import Everything

Other Parameters Include

CONNECT : The ODBC System Data Source

Birlasoft Ltd. Classification: CONFIDENTIAL

Page 5: EIM

USERNAME : Database/employee logon

PASSWORD : Database Password

TABLEOWNER : Database Table owner

(b) Process Section: This section consists of the various parameters that specify the operation to be performed by the EIM.

TYPE : IMPORT, EXPORT, MERGE, DELETE, SHELL INCLUDE : Sub Process to execute BATCH : IF_ROW_BATCH_NUM value to run against TABLE : Interface Table names IGNORE BASE TABLES : Do not process these columns IGNORE BASE COLUMNS : Do not process these columns ONLY BASE TABLES :Only at this the specified base tables are operated upon. It is used in conjunction with DELETE EXACT = TRUE COMMIT EACH TABLE : Commit after each base table, default if true. ROLLBACK ON ERROR : Error rollback behavior, default is FALSE

Birlasoft Ltd. Classification: CONFIDENTIAL

Page 6: EIM

The fig. shows the contents of an .ifb file. This shows the PROCESS as import everything. TYPE is shown as SHELL. The various tables required, are specified explicitly.

EIM PROCESS:

Once the interface tables have been populated, the EIM process is run. The EIM is submitted as a Siebel Server Batch Component Task either through the Server Administration screens or from the Server Manager Command Line Interface. On each pass, EIM processes one interface table and performs a particular action on all rows in that table for that batch.

Running EIM through Administration Screens:

Server Administration > Enterprise Operations > Component Requests Fill the Component Requests

In the Component Request Parameters list, add or change the various component parameters for the EIM process.

Add a new record Select the Appropriate name from the job parameters window Select the appropriate Value field

In the Component Request form, click the submit button in the menu options

Birlasoft Ltd. Classification: CONFIDENTIAL

Page 7: EIM

Running EIM using Command Line Interface

The EIM server task can also be run through the command line interface. The ‘srvrmgr’ command is used to invoke the Siebel server manager for batch mode processing through running scripts.

Syntax: srvrmgr <flags>

Flags used:

-g gateway server-e enterprise server-u username-p password-s Siebel server-c executes the single command-i gets command from input file-o logs information into the specified file

e.g. `srvrmgr -g $gatewayserver -e $enterpriseserver -s $siebelappserver \ -u $sadminuserid -p $sadminpassword -c "list tasks for comp EIM" | \ grep 'Running' | wc -l` As shown in the example, the server manager is invoked with the parameters of gateway server, Siebel application Server, userid, password and the command

Birlasoft Ltd. Classification: CONFIDENTIAL

Page 8: EIM

DATA IMPORTING

Data importing follows the following steps.

1. Identifying the data to be imported: This step comprises of identifying what data has to be loaded as well as it’s

location. The data may be present in other databases as well.

Determine the no. of Opportunities, Accounts and Contacts that have to be loaded. Identifying this data helps in estimating the time as well as resources required for import.

2. Identify the column mapping and user key columns Identify the base table columns which should contain this data.

According to the data, that has to be that has to be imported, identify the base tables to be populated. This can be done by defining the data according to the various business entities:

Account S_ORG_EXTContact S_CONTACTOpportunity S_OPTYService Request S_SRV_REQActivity S_EVT_ACTProducts S_PROD_INTPosition S_POSTN

Identify the Interface tables that map to these base tables:This can be done through either through the Siebel tools or by viewing the book shelf. This has been discussed above in the ‘Identifying base table to interface table mapping:’ section.

Identify the User Key columns and make sure they are populated uniquely: The User key is a column or a combination of columns which ensure that the records entered into the base tables are unique. Hence, it is necessary to specify values to these columns while importing data.

Identify the Foreign Key column: The foreign key columns are used to create functional dependency in the database. They should be used only when there is a need to directly link the data being imported with data already present in the database. In such cases, additional data may have to be entered for the parent table.

Each table that is loaded with data requires the filling up of the foreign key field so as to connect the entered data with the other database tables. The ID field is never populated, it is generated through populating the fields

Birlasoft Ltd. Classification: CONFIDENTIAL

Page 9: EIM

that map to it.

e.g. In the S_ORG_EXT table the PAR_ROW_ID column is never populated. It is filled instead, by populating the PARTY_TYPE_CD and PARTY_UID columns in the S_PARTY table.

Required Fields: Apart from the dependencies and foreign key columns, there are some fields which are required for successful importing. They mainly comprise of setting various flags.

Identify the mandatory column for EIM processing: There are various mandatory columns that have to be filled for data import. These include:

ROW_ID :The ROW_ID in combination with IF_ROW_BATCH_NUM should yield an unique value.

IF_ROW_STAT :This EIM updates this column after processing the row to indicate the status of the record.

IF_ROW_BATCH_NUM :You must set the values in this column to the same integer, greater than or equal to 0, as an identifying number for all rows to be processed as a batch. The maximum value is 2147483647.

3. Siebel Environment: Before importing large amounts of data, it is necessary to check the destination database and the import process.

Memory Resources: The database memory area needs to be large enough to hold most of the frequently accessed data in the cache.

Database Resources: EIM uses database server space for the interface tables, target base tables, secondary tables, and work areas. To make sure that an import process runs smoothly to completion, you must anticipate and plan for these space requirements.

4. Backup your existing database: Before importing data and making changes in the application, it is necessary to create a backup of your data.

5. Load the Interface Tables: Data is loaded first onto the interface tables after which they populate the base tables. Data loading is done through SQL queries.

e.g. insert into siebel.EIM_ACCOUNT ( ROW_ID, IF_ROW_BATCH_NUM, IF_ROW_STAT ..)

values ('1000',1001,'FOR_IMPORT' …)

Birlasoft Ltd. Classification: CONFIDENTIAL

Page 10: EIM

7. Edit the configuration file: Create the .ifb file for the corresponding operation. The steps to create of the .ifb file have been enlisted in the ‘Configuration File:’ section.

Also make sure that the configuration file is present in the Siebel Server/Admin directory.

8. Test the import Process: Test the import process for a small batch of records before larger records are imported.

9. Run the EIM process: Call the server manager either through the GUI or through the command line interface.

10.Verify Results: Once data has been imported successfully, there is a need to verify the results. Query the appropriate records for viewing the results.

MAPPING PART:

When I first started with Siebel EIM it was a struggle to determine how to get the data from a spreadsheet or external database mapped into the Siebel base tables through Siebel EIM. There are many steps involved and I became confused very quickly. Through these experiences I formulated an efficient process to take in order to map data to Siebel base tables through Siebel EIM.

The following is a step by step guide for mapping external source data to EIM tables in order to insert/import to a Siebel base table.

Siebel EIM Mapping Step By Step Guide

1. Determine the base tables that the data will be mapped to and you must understand the data models that the data will be converted into. I am assuming that you have already worked out the mapping and data conversion rules so you know what fields from excel file will be mapped to what base tables etc.

2. For each of the Siebel base tables to be populated, make a note of all the columns in the base tables that you will be mapping to with your source data. Also make a note of the columns that make up the user key for the table. If you are using Siebel EIM to update existing data in base tables then all that is required for EIM mapping is the mapping to user key and the columns being updated from source data. However if you are using Siebel EIM to insert new records you also need to also map to the non-system columns on the base tables that have the "Required" checkbox flagged and make a note of these. So you have 3 separate notes:

a. The required columns of the table (required for EIM inserts)

b. The columns mapping data to

c. The user key columns of the base table

Birlasoft Ltd. Classification: CONFIDENTIAL

Page 11: EIM

3. In you need to determine a Siebel EIM table that is appropriate to load the data into the base tables, the appropriate Siebel EIM table would be that which has all the column mappings you need to populate the data. To do this, in the Siebel Tools Object Explorer go to "Flat Mode" and select "EIM Table Mapping". In the list of table mappings, query in the "Destination Table" column for the base table you wish to populate make a note of some of the "Parent EIM Interface Table" tables. It is usually obvious which table(s) to use (i.e. EIM_ACTIVITY would map to S_EVT_ACT, but you would use EIM_ACTIVITY1/EIM_ACTIVITY2 etc for mapping to activity related tables etc.). When you have found the Parent EIM Interface Table, go to the "Types" view in the object explorer and select "EIM Interface Table" query for the table, drill into the table to the "EIM Table Mapping" and select the base table being mapped to then drill in to "Attribute Mapping" to verify that all the base columns you want to populate are there.

4. Lookup through Attribute Mapping in the "Base Table Attribute Column" field each of the columns being mapped to and make a note of what the corresponding interface table column is to populate with that field value. Do this for all the columns you wish to map to. It is good practice to maintain a mapping spreadsheet document to map fields from source data to interface table columns and Siebel base table columns.

5. In the same way as above lookup the required base table columns that you made a note of as these will need to be populated for the Siebel EIM insert/update operation to be successful. As part of this you need to determine what the value of the base table column that is required should be. Most of the time these are flag fields as part of the vanilla Siebel table in which you just need to ensure that you populate which that default value.

6. In the same way as the above step lookup the user key columns that you made a note of. You need to ensure that these columns are correctly populated with the unique identifier for each record that you wish to insert. Most of the time the user key will consist of the Name/LOC/BU, for example if for populating S_ORG_EXT, the user key is NAME/LOC/BU (not sure exactly what the BU column is called) where the NAME represents the unique name column of the Org, LOC is usually NULL and BU is based on the Organization the record belongs to "Default Organization" would be the value for a single org application.

7. In the Siebel Tools Object Explorer, go to EIM Interface Table > EIM Interface Table Column and filter for all records where "Required" = Y. Check if there are any columns here that have not been included to be mapped in the above mappings. If there are you need to ensure that these columns are also populated. Again it is a matter of determining what the column will map to and what the appropriate value for that column should be. Usually if the column does not mean anything to your application functionality specifically you would just map it to the default value that all other records in the base table are populated with.

8. If you populate the EIM table with all the above data for each record and run the EIM job with a configuration file that is correct you will get a successful EIM insert/update.

My next EIM article will provide a guide for mapping to EIM in order to import foreign key columns and setting the primary flag for MVG records.

Birlasoft Ltd. Classification: CONFIDENTIAL

Page 12: EIM

This article is part 2 of the Siebel EIM Mapping Step by Step Guide. I will explain how foreign keys are populated using Siebel EIM.

A foreign key is a column in a table that holds the same value as a column in another table. The foreign key references the record in the other table. A Siebel example of a foreign key is the S_EVT_ACT.TARGET_OU_ID column. This foreign key column references S_ORG_EXT.ROW_ID column.

What is also important in understanding importing foreign keys with Siebel EIM is the use of user keys. Siebel EIM uses the foreign key table's user key to identify the foreign key record. This is best explained with an example, the following steps can be followed to populate foreign keys using Siebel EIM. I will use S_EVT_ACT.TARGET_OU_ID as an example.

1. Ensure that all required Siebel EIM columns are populated for the record that you wish to import using Siebel EIM. See Siebel EIM Mapping - Step By Step Guide - Part 1 for more information. You also need to verify that the foreign key can be populated through the Siebel EIM table that you select. To do this go to Siebel Tools and select "Flat Mode" on the Object Explorer. Click on the "Foreign Key Mapping" item in the Object Explorer. In the Siebel Tools list applet, query for the name of the foreign key column in the [Foreign Key Column] field (for my case this is TARGET_OU_ID) and the name of the base table in the [Parent EIM Table Mapping] field (for my case this is S_EVT_ACT). The records returned show all EIM tables that can import to the foreign key ([GParent EIM Interface Table] field).

2. Once you have all required columns populated on the EIM table to import the record as discussed in Siebel EIM Mapping - Step By Step Guide - Part 1, in the Siebel Tools Object Explorer select the "Type" tab and select the "EIM Interface Table" Object Explorer item. Query for the EIM table and drill expand the "EIM Interface Table" Object Explorer item. Select the "EIM Table Mapping" Object Explorer item and select the record in the list applet with [Destination Table] = the base table. Then expand the "EIM Table Mapping" Object Explorer item and select the "Foreign Key Mapping" Object Explorer item. In the "Foreign Key Mappings" list applet, query for [Foreign Key Column] = the foreign key column. Then expand the "Foreign Key Mapping" Object Explorer item and select the "Foreign Key Mapping Column" Object Explorer item. Each of the records shown in the "Foreign Key Mapping Columns" list applet represents the EIM table columns required to resolve the foreign key value. The columns listed for a foreign key mapping is always the user key of the destination table.

3. The columns required to be populated are in the [Interface Table Data Column] field. There are some exceptions which I will explain next. For the example of S_EVT_ACT.TARGET_OU_ID, the user key of the S_ORG_EXT table which this foreign key refers to is: NAME, LOC and BU_ID. The foreign key mapping columns are listed as (notice the resemblance):

TARGET_ACCNT_NAME - maps to the NAME of the S_ORG_EXT record. TARGET_ACCNT_LOC - maps to the LOC of the S_ORG_EXT record.

Birlasoft Ltd. Classification: CONFIDENTIAL

Page 13: EIM

TARGET_ACCNT_BI - maps to the BU_ID of the S_ORG_EXT record.

There is an exception for the above EIM columns where the TARGET_ACCNT_BI represents the value in BU_ID, the TARGET_ACCNT_BU column represents the name of the org that BU_ID joins to in S_BU. For some reason the TARGET_ACCNT_BI when populated will not always resolve the foreign key, however I have found that the equivalent TARGET_ACCNT_BU column when populated will resolve the foreign key. Many EIM tables have BU/BI related columns, there will always be a pair with the same name but differing BU/BI. My rule of thumb is to always use the "BU" column first and populate with the name of the Organization. Then if this does not resolve the foreign key then try the "BI" column.

4. Now that the above EIM columns are populated, the foreign key should resolve when the EIM task is executed. You need to ensure that if you have an ONLY BASE COLUMNS section in the IFB file for the EIM task, then you need to include the foreign key column in the ONLY BASE COLUMNS section (eg. S_EVT_ACT.TARGET_OU_ID).

5. When you execute the EIM task, ensure to include parameters: SQL Trace Flags = 8, SQL Error Flags = 8. This will give a lot of information in the EIM log file and helps for debugging.

6. Once the EIM task has executed search for the foreign key column name in the EIM log file. There should exist a section in the log file which specifies whether the foreign key was imported or if it failed. If the foreign key import failed there will be an explanation of what was wrong in the EIM table.

My next EIM article will discuss the EIM import of primary columns through explicit and implicit primary mappings.

This article is part 3 of the Siebel EIM Mapping Step by Step Guide. I will explain how primary foreign keys are populated using Siebel EIM. Prior to reading this article, I encourage you to read parts 1 and 2 of this series:

- Siebel EIM Mapping - Step By Step Guide - Part 1 - Siebel EIM Mapping - Step By Step Guide - Part 2 - Foreign Keys

In Siebel a primary foreign key is associated to the primary flag on multi value group (MVG) records. I will not go into too much detail on MVGs, Siebel Bookshelf provides a good source - start here: Siebel Bookshelf - Configuration MVG Applets. For example, a contact may have an MVG of preferred names where only one of the preferred names is the primary for the contact, this preferred name MVG record will have the primary flag tick shown in the MVG applet. So taking this example to the database level, the contact is based on the S_CONTACT table, the preferred names MVG is based on the S_CONTACT_XM table. Many

Birlasoft Ltd. Classification: CONFIDENTIAL

Page 14: EIM

S_CONTACT_XM records can exist that have a foreign key PAR_ROW_ID which refers to the S_CONTACT.ROW_ID of the contact. The primary flag is represented as a foreign key on the S_CONTACT table that refers to the ROW_ID of the S_CONTACT_XM record that is the primary.

Also before I get into the detail of how to populate the primary foreign key using Siebel EIM, I want to discuss the benefits of having a primary flag on an MVG. It is possible in Siebel to configure an MVG without a primary flag. If you have a primary flag configured on an MVG, when the parent business component is instantiated (ie. The data from the business component is rendered on screen) the MVG field will be populated with the value of the primary record, this data is retrieved through a join in the original BC query. However if an MVG does not have a primary field configured on the applet, when the parent BC is instantiated an additional query is executed to obtain all records and only one of these records is selected to show on the MVG field. Therefore any MVGs that dont have primary field configured will result in an additional query when the BC is instantiated.

Siebel EIM populates primary foreign keys through the use of explicit primary mapping. When importing MVG records through Siebel EIM a column exists in the EIM table which can be used to flag the record as a primary MVG record. This is called an explicit primary mapping. However if you do not explicitly flag an MVG as primary the MVG records will still import and will not be flagged as primary. This is called implicit primary mapping. The issue with implicit primary mapping is that if a particular MVG does not have any records flagged as primary, then the primary flag will not be set until the parent BC is instantiated. For example, if the preferred names MVG records are populated with Siebel EIM and the primary is not set, when the user navigates to this contact through the UI, at the point the contact record is rendered a SQL Update will occur to set the primary flag to one of these MVG records. I have seen major issues with this in practice where multiple users have navigated to the same record - rendering the record simultaneously - this caused the SQL Update statement to be executed twice and resulted in a table lock and severe performance problems.

Therefore I suggest that if you use Siebel EIM explicit primary mapping to populate MVG records that have a primary field, then ensure that the EIM task will result in an MVG record being flagged as primary. If you are importing MVG records but the MVG already contains MVG records with a primary, then there is no need to explicitly flag a record as primary (unless you want to change the primary MVG record) as there already exists a primary MVG record.

Use the following steps to populate a primary foreign key using Siebel EIM:

1. Determine the base table column that holds the primary foreign key value. In Siebel Tools Object Explorer select the "Types" tab and select the Business Component Object Explorer item. In the Business Components applet, query for the BC that contains the MVG. Expand the Business Component Object Explorer item and select Mutli Value Link. In the Mutlivalue Links applet, query for the MVL for the MVG you with to populate. Make a note of the value in [Primary ID Field], this is the primary foreign key field. Then select the Field Object Explorer item and query for the field specified in the [Primary ID Field]. Make a note of the

Birlasoft Ltd. Classification: CONFIDENTIAL

Page 15: EIM

value in the [Column] field of the Fields list applet. This is the primary foreign key.

2. Ensure that all required Siebel EIM columns are populated for the record that you wish to import using Siebel EIM. See Siebel EIM Mapping - Step By Step Guide - Part 1 for more information. You also need to verify that the primary foreign key can be populated through the Siebel EIM table that you select. To do this go to Siebel Tools and select "Flat Mode" on the Object Explorer. Click on the "EIM Explicit Primary Mapping" item in the Object Explorer. In the EIM Explicit Primary Mapping list applet, query for the name of the foreign key column in the [Base Table Primary ID Column Name] field and the name of the base table in the [Parent EIM Table Mapping] field. The records returned show all EIM tables that can import to the primary foreign key ([GParent EIM Interface Table] field) and also the column in the EIM table which flags the primary ([Inf Tbl Exp Primary Flg Col Name] field).

3. Now that you have the EIM column used to flag an MVG record as primary, ensure that you populate the column value with 'Y' for the MVG record you wish to explicitly set as primary.

4. The above EIM columns are now populated, the primary foreign key should resolve when the EIM task is executed. You need to ensure that if you have an ONLY BASE COLUMNS section in the IFB file for the EIM task, then you need to include the primary foreign key column in the ONLY BASE COLUMNS section. Also if you have an ONLY BASE TABLES section in the IFB file for the EIM task, when using Siebel EIM to import MVG records you need to ensure that you specify the parent base table and MVG child base table.

5. Lastly it is important to mention that Siebel 7 has some shortcomings with explicitly setting the primary foreign key if that is the only update the EIM task will make. If you populate an EIM table with the intention to only update a primary foreign key this will not always work. You have to also update a dummy column so that EIM will perform the update of the primary foreign key. For example, in addition to setting the explicit primary mapping column to 'Y' for a particular EIM record also populate the COMMENTS column so that EIM will perform an update of the COMMENTS column and force the primary foreign key update. This is a hassle - I know! You know have a dummy column (eg. COMMENTS) update to a value that you dont necessarily want to be updated to that value. In this instance, I create two EIM jobs, the first is to set the primary foreign key and the dummy column update. Then the second job is to set the dummy column value back to what it was originally.

Birlasoft Ltd. Classification: CONFIDENTIAL