Using Subversion With Siebel

Using version control has become the default position in the programming world, and with good reason. Code checked into version control doesn’t get lost, the entire history of the code is available for viewing, you can tell exactly who has changed what and it allows for parallel development.

Developing on Siebel is not your typical programming project though. For one, the entire codebase (configuration, scripts etc) is stored in a database and not flat files. This means that using version control with Siebel is not as valuable as using it in a programming project. It’s also more difficult as version control isn’t well catered for by Siebel Tools.

The Siebel repository is the ‘code’. Version control is just a way to track changes made.

Integrating version control with Siebel will not allow you to:

  • Build the SRF from files under version control. You’ll still need to do this based in the Siebel repository.
  • Easily rollback changes as with other IDEs. You will need to import the sif files automatically generated by Siebel Tools.
  • Work on a branch, as the Siebel repository cannot be branched

That being said, there are still a few benefits that make the integration worthwhile. It does give you the ability to:

  • See who changed an object, what they changed and when they changed it. You will be able to see an objects entire history, as opposed to the default Siebel behaviour of simply telling you who last updated the object.
  • Find out why they changed it (via check in comments)

To set up Siebel to work with Subversion you need to:

1. Install a Subversion client

I used TortoiseSVN. It’s easy to use, and has a graphical as well as command line interface.

2. Modify the srcctrl.bat file

This file is executed by Siebel Tools each time you check in an object. It is not set up for Subversion by default.

You will need to modify the variables in the “User defined parameters” section of the file.

Siebel Tools will call the batch file below twice for each object selected for check in. The first is to do a check out, the second is to do the check in. This means it’s not a particularly efficient mechanism, and only one file will have changed between each revision in Subversion. It does however do the job.

I made the following modifications to the batch file that came with Siebel:
The DIR parameter was passed in with enclosing quotes by Siebel. This meant I couldn’t tack on the repository name to the path. I stripped the enclosing quotes and assigned the new path to the DIR_NO_QUOTE variable.

I’d prefer to specify where my local copy of the repository is located. I do not want it to be in the Tools temp directory by default. Allowing the developer to have full control over the location allows for the use of multiple repositories without having to delete or move working copies. The WORKING_DIR variable defines where the local copy of the version control structure is stored.

I also didn’t rely on changing the current directory and favoured using absolute paths instead.

The modified srcctrl.bat file:

@echo off
 
set SOFTWARE=svn
set CHECKIN=%SOFTWARE% commit
set CHECKOUT=%SOFTWARE% checkout
set ADD=%SOFTWARE% add
 
 
rem ==================================================================
rem =============== User defined parameters ================================
rem ==================================================================
set PATH=C:\Program Files\TortoiseSVN\bin;%PATH%
set SVN_URL=svn://svn_ip_address/svn_example
set SVN_REPOS=trunk
set SRC_USR=yourusername
set SRC_PSWD=yourpassword
set LOGFILE=D:\development\projects\svn_example\svn_integration.log
set WORKING_DIR=D:\development\projects\svn_example
rem LOGFILE SHOULD NOT HAVE SPACES IN ITS PATH
rem ==================================================================
rem ==================================================================
 
 
set OPTIONS=--username %SRC_USR% --password %SRC_PSWD%
set COMMENT=-F
set FILE=
 
echo %* >> %LOGFILE%
echo =======================Srcctrl.bat========================== >> %LOGFILE%
 
set ACTION=%1
shift
set DIR=%1
shift
set COMMENT=%COMMENT% %1
set COMMENT_FILE=%1
shift
set FILE=%1
 
SET DIR_NO_QUOTE=###%DIR%###
SET DIR_NO_QUOTE=%DIR_NO_QUOTE:"###=%
SET DIR_NO_QUOTE=%DIR_NO_QUOTE:###"=%
SET DIR_NO_QUOTE=%DIR_NO_QUOTE:###=%
 
if errorlevel 100 goto END
 
if %ACTION%==checkout goto CHECK_OUT
if %ACTION%==checkin goto CHECK_IN
 
:CHECK_OUT
echo ============Check out file %FILE% from Source Control System============ >> %LOGFILE%
 
echo Change local directory to %DIR% >> %LOGFILE%
chdir %DIR% >> %LOGFILE% 2>&1
 
echo Start checking out %FILE% from Source Control System >> %LOGFILE%
echo %CHECKOUT% %SVN_URL%/%SVN_REPOS% %OPTIONS% "%WORKING_DIR%\%SVN_REPOS%" >> %LOGFILE%
%CHECKOUT% %SVN_URL%/%SVN_REPOS% %OPTIONS% "%WORKING_DIR%\%SVN_REPOS%" >> %LOGFILE% 2>&1
 
goto END
 
:CHECK_IN
echo ============Check in file %FILE% into Source Control System============ >> %LOGFILE%
 
echo Change local directory to %WORKING_DIR%\%SVN_REPOS% >> %LOGFILE%
chdir %WORKING_DIR%\%SVN_REPOS% >> %LOGFILE% 2>&1
 
if exist %FILE% goto FILE_EXIST >> %LOGFILE% 2>&1
 
echo Copying %FILE% to local Working Copy Folder: %WORKING_DIR%\%SVN_REPOS% >> %LOGFILE%
copy "%DIR_NO_QUOTE%%FILE%" "%WORKING_DIR%\%SVN_REPOS%\%FILE%" >> %LOGFILE% 2>&1
 
echo Add %FILE% in case it doesn't exist in Source Control System >> %LOGFILE%
echo %ADD% %WORKING_DIR%\%SVN_REPOS%\%FILE% %OPTIONS% >> %LOGFILE%
%ADD% %WORKING_DIR%\%SVN_REPOS%\%FILE% %OPTIONS% >> %LOGFILE% 2>&1
 
goto COMMIT
 
:FILE_EXIST
 
echo Copying %FILE% to local Working Copy Folder: %WORKING_DIR%\%SVN_REPOS% >> %LOGFILE%
echo copy "%DIR_NO_QUOTE%%FILE%" "%WORKING_DIR%\%SVN_REPOS%\%FILE%" >> %LOGFILE%
copy "%DIR_NO_QUOTE%%FILE%" "%WORKING_DIR%\%SVN_REPOS%\%FILE%" >> %LOGFILE% 2>&1
 
:COMMIT
echo Check in %WORKING_DIR%\%SVN_REPOS%\%FILE% into Source Control System >> %LOGFILE%
echo %CHECKIN% %WORKING_DIR%\%SVN_REPOS%\%FILE% %COMMENT% %OPTIONS% >> %LOGFILE%
echo ***** COMMENT_FILE ***** >> %LOGFILE%
type %COMMENT_FILE% >> %LOGFILE% 2>&1
echo . >> %LOGFILE%
echo ************************ >> %LOGFILE%
%CHECKIN% %WORKING_DIR%\%SVN_REPOS%\%FILE% %COMMENT% %OPTIONS% >> %LOGFILE% 2>&1
 
goto END
 
:END
echo ===================End Of Srcctrl.bat====================== >> %LOGFILE%

2. Configure Siebel to use version control
Once the file has been modified, tell Siebel Tools to use version control and where to find the batch file:

Siebel SVN Integration Settings

Siebel SVN Integration Settings

From now on, changes you make to objects will be stored in the version control repository when you check into the Siebel repository.

When you want to track down the person responsible for nuking a piece of working functionality (and it will eventually happen), simply navigate to your working directory and type svn log filename. Happy hunting 🙂

If you’ve got any comments, suggestions or corrections, let me know!

Credits:
The sparse Siebel Bookshelf documentation.

This entry was posted in Programming and tagged , , , , , . Bookmark the permalink.

15 Responses to Using Subversion With Siebel

  1. Milind says:

    hi Michael,
    Please take a look at our Siebel version control tool it is tailor made for Siebel and has a db repository just like Siebel.
    http://www.enterprisebeacon.com/siebel_version_control_tool.html

  2. santosh says:

    hi michael,

    is it possible to branch multiple branches used for development in svn when using siebel.
    in a multiple release projects, is it possible to set up multiple branches for different streams and merge them while giving a release.

    Regards,
    Santosh

    • Michael says:

      Hi Santosh

      There is a one to one relationship between a Siebel repository and an SVN directory. So if you made a copy of the repository, you would make a copy of the SVN directory or branch it. You would not eventually merge the SVN branch as you would not merge the Siebel repositories.

      Because an SRF is built from a Siebel repository and not Subversion, you cannot do branching , merging and releases as you would for a Java project.

      I hope that helps?

      Michael

  3. Taher Moosa says:

    Hi Michael

    I am not a Siebel Developer at all. I have experience with source control and was asked if Siebel applications can be version controlled in SVN.

    I have read the article but I am unsure about the following.
    Does this mean that the SVN repository:
    – would only provide change history information
    – the artefacts stored on SVN are not very useful

    For informational purposes, how do you promote code from environment to environment in Siebel? How do I copy my code from localhost to a server.
    Surely this artefact can be versioned?

    Thanking you in advance for any advise offered.

    • Michael says:

      Hi Taher

      Yes, the files that are version controlled aren’t as useful as in other environments (Java or .NET for example). They’d give you some idea of what had changed, but that would be about it.

      You’d compile into a srf (the equivalent of a war file in a Java environment) that would be promoted to different environments. The srf file can be versioned, but just as you use an artifact repository rather than version control for jars, you’d probably do the same for srf files.

      You can make copies of the repository itself which would give you some of the same features a branch would.

  4. Mincy Eapen says:

    Hi Michael,

    We are planning to use Tortoise SVN for version controlling with Siebel 8.1.1.7
    Could you please let me know what steps needs to be covered prior to placing the above modified srcctrl.bat file you have provided.
    because i am facing an issue with the same.
    I used the above file on my Siebel Env, enabled the ‘source Control Integration’ on Siebel Tools as well and tried a checkout and checkin, but here though checkout-checkin was successful it didnot create a copy of the object in teh version control repository.

    Regards,
    Mincy

  5. I just saw this post and thought of expressing it here.

    Have build a Tool called SSCRiM (Siebel Source Control & Integrated Release Management) that would Version Control all the 3 entities that need to be Version Controled ( Siebel Objects , Master Data & Files) per Sprint/Release. It also generates build accross multiple release / sprint (bundles srf + repository.dat + Delta Changes in master data + files) which is then consumed by our another tool call “Deployment Automation” which would deployment this Pack/ build that was generated.
    This has helped us reduce the efforts required / wasted in
    – Environment stability (Due to inaccurate builds and deployement)
    – Configuration Management and build is very easy and less time and efforts consuming.
    – Deployment team size was reduced to very few people
    Backbone of this application is SVN & My SQL DB
    Current limitations are it does not support ADM packages (soon it would).

    – Vibhav Kelkar
    Techmahindra.com

  6. Girish Kurup says:

    Hi Michael , Vibhav

    I am new to Siebel/SVN and automatic deployment
    Could you please share experience (if any) for using Siebel code/ SVN version control/Jenkins automatic deployment?
    Also please correct my understanding
    1) developer checks out Siebel code from SVN into local client. Edits the Siebel code/objects/create SRF and checks back the code to SVN
    2)developer logs in the Sieble adminstrator of deployment server to deploy the SRF into dev environment. If Development testing is OK.
    3) Tag is created in SVN to deploy SRF to Test or Acceptance or Prod
    4) While deployment for example to Test environment, deployment team will check out the Tag SRF back to Siebel environment. And after logging in to Siebel adminstrator of Test server, deploy SRF to Test Environment

    My another Question: Does deployment team have to create scripts to deploy SRF to Test, Acceptance and Production? Can you please share deployment framework for Siebel?

    Any support for above is very useful

    Thanks and Regards
    Girish Kurup

  7. Ahmed Jeff says:

    Hello everybody!

    Thanks Michael for this usefull “tuto” it’s very interesting

    I have on question please:

    -the use of svn with siebel tools can allow to us to use branches (trunk, branch 1, …) and specify them somewhere?

    Thanks for your response

  8. Ahmed Jeff says:

    can we create a new branch before that?
    can we report a specific fix on a specific branch?

    Thanks a lot

  9. Maksym says:

    Hi William,

    I guess a slash is missing here as the script is failing on SVN add stage saying file not found, because it is not being properly copied:
    copy “%DIR_NO_QUOTE%%FILE%”

  10. Ben says:

    Hi,

    Thanks for your article. Loved it. I hope you don’t mind that I essentially just modified your srcctrl.bat for our purposes.

    What I am wondering is, though, once you’ve got the srcctrl.bat file plugged into Siebel correctly, what is the correct way of making a first commit? Is it just that the next time you change an object, everything will be pushed?

    Regards,
    Ben

  11. Santosh says:

    How to import siebel repository in SVN ?

  12. Nimmi Kumari says:

    Hi ,I am new to svn ,we have integrated svn with siebel tools .For svn server we are using Apache svn and for svn client we are using Tortoise Svn ,your blog was very helpful in integrating the svn with siebel tools .
    I have modified my srcctrl.bat file like above .My queries were like below :-
    1. When we check out and check in an object,the log file getting generated is only having the check in object details and not check out ,why so?
    2.When we simply check out an object and not check in does that objects sif file also gets stored in svn server repository and our local client repository .
    3. Say i want to do some changes on an object ,that objects latest sif file is not present in svn server repository ,so after doing a check in the objects sif file with latest changes will be reflected in svn server repository.My point is how can i get my changes back if my latest changes have issue ,because this object past sif file is not present in svn,so how is svn useful in this case ?

Leave a Reply

Your email address will not be published. Required fields are marked *