Setting Siebel EIM Process Batch Number in Command Line

My customer’s current process of importing data into Siebel database is to use Siebel EIM interface.  The data which needs to be imported will be formatted and inserted into EIM tables (or the staging tables), and then an EIM process will be ticked off in the command line to import the data into Siebel base tables.  The command is fairly simple, and should be similar to the following:

[Path to The Siebel Application Bin folder]\srvrmgr.exe /g [Siebel Application Server Name] /e [Target Siebel Environment] /s [Siebel Application Server Name] /u [User Name] /p [User Password]


run task for component EIM with config=”[Config File].ifb”,Process=”[Process Name]“

The first command starts the srvrmgr program, and the second one ticks off the EIM process.  The configuration file ([config File].ifb) specifies all the parameters needed by the EIM interface in order to complete the process.  One of the important parameters we need to set in the .ifb file is the BATCH, which is the identifier for the group of data being handled during the current process.  Normally, we set it to a fixed number or a range of numbers (for example, 500-600).  So, when the EIM process runs, only the data with a batch number equal to the BATCH or falling in the range specified in the .ifb file will be processed.  If in the EIM tables there are some records which are not ready to be processed at this moment, they can be skipped by identifying themselves with a different batch number.  This is helpful when you are managing multiple data importing tasks which share the same set of EIM tables, and run at different time.

However, we soon realized that it would be getting harder and harder to manage these .ifb files and to make sure these EIM processes don’t interfere with each other.  For example, one of our custom applications needs to import data into Siebel using EIM interface upon users’ requests.  The data importing process is exactly the same for all these requests, except for the data needed to be imported.  Multiple users need to be allowed to submit their requests at the same time, and their requests should be handled separately.  If we were going to do it in the old fashion, we would need to have a .ifb file for each of their requests, and use different batch numbers in these .ifb files.  It is not realistic, or it is something we want to do either.

The solution is actually very simple.  We took the BATCH setting out of the .ifb file, and instead we set it in the command line.  This was not documented in the Siebel EIM Admin Guide, but after our testing it was proved to be a working solution.  The command will look like the following now:

[Siebel Application Bin folder]\srvrmgr.exe /g [Siebel Application Server Name] /e [Target Siebel Environment] /s [Siebel Application Server Name] /u [User Name] /p [User Password]


run task for component EIM with config=”[Config File].ifb”,Process=”[Process Name]“,BATCH=[Batch Number]

This way the application can choose a BATCH number unique to the user’s request, construct the command, and then execute it to tick off the EIM process, and all these requests can share the same .ifb file.

To manage the batch numbers among different applications, we reserved a range of batch numbers for each application.  For example, from 500 to 549 will be used only by application A, and from 550 to 599 will be used only by application B.  Within each application, a batch number is assigned to each request based on the request identifier and the range of batch numbers reserved for the application.  In our case, the request ID is an auto-incrementing integer, and the equation for calculating the batch number is:

[Batch Number] = [Request ID] % [Total Number of Allocated Batch Numbers] + [The Lowest Batch Number]
(Where % stands for the modulus operator)

For example, if the allocated batch numbers are from 500 to 549, and the current request ID is 1034, the batch number for this request will then be:

534 = 1034 % (549 – 500 + 1) + 500

This way the adjacent requests would have different batch numbers, and the batch numbers are used in a cycle.  In our case, we will never have more than 50 users submitting their requests at the same time, but if this was for a larger user base, we could allocated a bigger range of batch numbers.

So, we finally were able to manage all users’ requests using limited batch numbers and a single .ifb file without the requests being interfered by each other.  Task accomplished!

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Twitter

Filed under: Application Development, Miscellaneous | Posted on March 25th, 2010 by Geer

Tags: , , ,

Leave a Reply

Links

Topics

Tags

Authors

Syndication

Archives

Copyright © 2012 Pearl Technology. All rights reserved.
The Tech Blue theme was modified to help create this blog.