Siebel EIM >  Introduction to EIM - creating and running a simple EIM job

EIM is short for Enterprise Integration Manager. Oracle says that we should not
update database tables directly. If you want to update/delete/insert/merge data
in Siebel database, we need to use EIM or alternatives like EAI or loaders.

For large data changes EIM is the preferred way. If you look at the database structure,
there are a large number of empty tables with names starting with EIM_, e.g. eim_contact,
eim_opty. Each of these tables are mapped to a data table(s) called base tables.
These base tables have the actual data which you can see in the GUI.

For example - contact data is mostly in base table s_contact. The EIM table for contact
is EIM_CONTACT. For Opportunities, the base and EIM tables are s_opty and EIM_OPTY.

Sometimes one EIM table can be mapped to many base tables or vice versa.

So lets do an easy EIM job. We shall update the currency of an Opportunity from US Dollars to
Euro. The name of the opportunity is test_opty and row_id of this opty in s_opty table is 1SN91R.

The first thing we need to do is insert data in table EIM_OPTY.

run this query first. If the results are zero, we will move to the next step.

select * from siebel.eim_opty where if_row_batch_num ='55555';

If the results are not zero, select another number and try again.
The next two sqls are

INSERT INTO siebel.EIM_OPTY(OPTY_NAME, DEPT_ACCNT_BU, DEPT_ACCNT_LOC,
DEPT_ACCNT_NAME, OPTY_BU, OPTY_CURCY_CD, IF_ROW_BATCH_NUM, IF_ROW_STAT, ROW_ID)
SELECT s_opty.name, org_bu.name, s_org_ext.loc, s_org_ext.name,
opty_bu.name, 'EUR', '55555', 'FOR IMPORT', s_opty.row_id
FROM siebel.s_opty, siebel.s_bu opty_bu, siebel.s_org_ext, siebel.s_bu org_bu
where s_opty.bu_id = opty_bu.row_id
and s_opty.pr_dept_ou_id = s_org_ext.row_id (+)
and s_org_ext.bu_id = org_bu.row_id (+)
and s_opty.row_id = '1SN91R';

commit;

The commit sql is important if you are using Oracle. Oracle does not autocommit inserts by default
and the EIM job will end in error if you do not commit.

After this we will need to create an IFB file. This is a text file and the contents will be like this

[Siebel Interface Manager]
PROCESS = UPDATE_OPTY

[UPDATEDEVLEAD]
TYPE = IMPORT
TABLE = EIM_OPTY
BATCH = 55555
INSERT ROWS = S_OPTY, FALSE
UPDATE ROWS = S_OPTY, TRUE
ONLY BASE TABLES = S_OPTY
ONLY BASE COLUMNS = S_OPTY.NAME, S_OPTY.PR_DEPT_OU_ID, S_OPTY.BU_ID, S_OPTY.CURCY_CD

save this file with name updateopty.ifb
Copy the file to a place where your siebel application can access it.
Ask your administrator which folder in which computer is accessible for siebel.

Now log into siebel as sadmin or a user with responsibility Siebel Administrator
Go to Site Map -> Administration Server Management -> Jobs

Create with these parameters

1)Component/Job = Enterprise Integration Manager
2)Mode = Asynchronous
3)Requested Server = servver name of a server which has EIM component enabled

Ask your team which server is preferred.

After this scroll down the screen and go to the bottom applet and fill in these values

Now go back up and wait. In the top right corner of the screen, you should see a magnifying
glass icon. Click that , it will refresh the screen. The status field in the top applet
should show status 'Success'.

Now go to opportunities screen and search for the currency. It should show EUR.
run this SQL

select if_row_batch_num, if_row_stat, count(*) from siebel.eim_opty
group by if_row_batch_num, if_row_stat
where if_row_batch_num = '55555'
order by if_row_batch_num, if_row_stat;

The value of if_row_stat should be IMPORTED.
This is how we check results of an EIM job.