Sie sind auf Seite 1von 8

Siebel EIM Mapping Step By Step Guide

For mapping external source data to EIM tables in order to insert/import to a


Siebel base table:

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

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.

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.
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.

How primary foreign keys are populated using Siebel EIM:

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 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 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.

How to associate an address to an entity and then set the primary address
MVG flag using Siebel EIM.

The example provided below is to associate an address to a division and set the primary address flag.
The relationship between the division and the address in my example is described as such:

S_ORG_EXT -> S_CON_ADDR (Intersection Table) -> S_ADDR_PER

Relationship between S_ORG_EXT and S_CON_ADDR: S_ORG_EXT.ROW_ID =


S_CON_ADDR.ACCNT_ID
Relationship between S_CON_ADDR and S_ADDR_PER: S_CON_ADDR.ADDR_PER_ID =
S_ADDR_PER.ROW_ID

Primary Address Flag relationship between S_ORG_EXT and S_ADDR_PER: S_ORG_EXT.PR_ADDR_ID =


S_ADDR_PER.ROW_ID

This concepts in this example can be used to associate address to any entity and ensure that primary is
checked using Siebel EIM. The example provided below is using an Oracle database on Siebel 7.7.

Firstly, we want to insert a record into EIM table EIM_ACCNT_CUT to associate an existing address
to the division:

INSERT INTO EIM_ACCNT_CUT


(
ROW_ID
,CREATED
,CREATED_BY
,IF_ROW_STAT
,IF_ROW_BATCH_NUM
,PARTY_UID
,PARTY_TYPE_CD
,ADR_ADDR_NAME
,AC_BU
,AC_LOC
,AC_NAME
,CO_RELATIONTYPE_CD
,CO_START_DT
,CO_ACTIVE_FLG
,CO_BL_ADDR_FLG
,CO_MAIN_ADDR_FLG
,CO_SHIP_ADDR_FLG
,ACC_PR_ADDR
,ADDR_ACTIVE_FLG
,FRAUD_FLG
)
SELECT ROWNUM
,SYSDATE
,'0-1'
,'FOR_IMPORT'
,1
,par.PARTY_UID
,'Organization'
,'Addr Name Of The Address'
,'Default Organization'
,NULL
,org.NAME
,'ContactPointUsage'
,NULL
,'Y'
,'N'
,'N'
,'N'
,'Y'
,'Y'
,'N'
FROM S_ORG_EXT org
,S_PARTY party
WHERE org.PAR_ROW_ID = party.ROW_ID
AND org.NAME = 'My Test Division';

COMMIT;

Now we want to insert another record into EIM_ACCNT_CUT with a different batch number to update
the primary address. To ensure that the primary address foreign key is updated, we also need to
update a dummy column on the parent S_ORG_EXT table. Therefore I am inserting a value of
'BLAH' into the AC_URL column (which maps to the URL column of S_ORG_EXT). For my current
implementation, the URL column is not used, you need to find a dummy column on the parent
table S_ORG_EXT that is not currently used.

INSERT INTO EIM_ACCNT_CUT


(
ROW_ID
,CREATED
,CREATED_BY
,IF_ROW_STAT
,IF_ROW_BATCH_NUM
,PARTY_UID
,PARTY_TYPE_CD
,ADR_ADDR_NAME
,AC_BU
,AC_LOC
,AC_NAME
,CO_RELATIONTYPE_CD
,CO_START_DT
,CO_ACTIVE_FLG
,CO_BL_ADDR_FLG
,CO_MAIN_ADDR_FLG
,CO_SHIP_ADDR_FLG
,ACC_PR_ADDR
,ADDR_ACTIVE_FLG
,FRAUD_FLG
,AC_URL
)
SELECT ROWNUM
,SYSDATE
,'0-1'
,'FOR_IMPORT'
,2
,par.PARTY_UID
,'Organization'
,'Addr Name Of The Address'
,'Default Organization'
,NULL
,org.NAME
,'ContactPointUsage'
,NULL
,'Y'
,'N'
,'N'
,'N'
,'Y'
,'Y'
,'N'
,'BLAH'
FROM S_ORG_EXT org
,S_PARTY party
WHERE org.PAR_ROW_ID = party.ROW_ID
AND org.NAME = 'My Test Division';

COMMIT;

Now we want to insert a record into EIM_ACCOUNT to update the dummy column
(S_ORG_EXT.URL) back to NULL - we dont want to have 'BLAH' in URL do we?.

INSERT INTO EIM_ACCOUNT


(
ROW_ID
,IF_ROW_BATCH_NUM
,IF_ROW_STAT
,CREATED
,CREATED_BY
,PARTY_TYPE_CD
,PARTY_UID
,NAME
,PAR_ACCNT_LOC
,PAR_ACCNT_BU
,ACCNT_BU
,URL
)
SELECT ROWNUM
,3
,'FOR_IMPORT'
,SYSDATE
,'SADMIN'
,'Organization'
,par.PARTY_UID
,org.NAME
,NULL
,'Default Organization'
,'Default Organization'
,NULL
FROM S_ORG_EXT org
,S_PARTY party
WHERE org.PAR_ROW_ID = party.ROW_ID
AND org.NAME = 'My Test Division';

COMMIT;

Now we have 3 records in Siebel EIM tables, we will now execute the EIM task to import this address
association and primary flag as such:

IFB File (AssociateAddress.ifb):

[Siebel Interface Manager]


USE INDEX HINTS = TRUE
LOG TRANSACTIONS = FALSE
[ASSOCIATE_ADDRESS]
TYPE=IMPORT
TABLE= EIM_ACCNT_CUT
BATCH = 1
ONLY BASE TABLES = S_CON_ADDR,\
S_PARTY

[SET_PRIMARY_FLAG]
TYPE=IMPORT
TABLE= EIM_ACCNT_CUT
BATCH = 2
ONLY BASE TABLES = S_CON_ADDR, S_ORG_EXT, \
S_PARTY

[BLANK_OUT_DUMMY_COLUMN]
TYPE=IMPORT
TABLE=EIM_ACCOUNT
NET CHANGE=FALSE
BATCH=3
ONLY BASE TABLES=S_ORG_EXT, S_PARTY
ONLY BASE COLUMNS = S_ORG_EXT.URL, \
S_PARTY.PARTY_TYPE_CD, \
S_PARTY.PARTY_UID, \
S_ORG_EXT.NAME, \
S_ORG_EXT.BU_ID

[IMPORT_ADDRESS]
TYPE=SHELL
INCLUDE="ASSOCIATE_ADDRESS"
INCLUDE="SET_PRIMARY_FLAG"
INCLUDE="BLANK_OUT_DUMMY_COLUMN"

EIM task to execute:

Component: Enterprise Integration Mgr


Process: IMPORT_ADDRESS
Config: AssociateAddress.ifb