Branching in batch mode
Description
We can find in the root directory of BranchManager for DOORS additional files :
- runBranchQuick.bat: - an example of how a call to the runBranch.bat file looks.
Syntax of a call :
Call runBanch.bat [DOORS Username] [DOORS Password] [Branch Script] [Taglist File] [Target Project] [Log File*]
"call" is used to run a batch file.
"runBranch.bat" is the batch file to run.
The following input are required parameters :
- DOORS username
- DOORS password
- Path to DXL script to execute ("src\scripts\branch\batchBranchRunnable.dxl").
- TagList File - text file containing the tags to branch. - which you can create by pasting a taglist created by the TagList Editor (using the TagLists tab and Edit TagList button)
- Target Project - where to branch the tags.
- runDXL.bat: - general batch file for executing a DXL file in DOORS batch mode. Finds the DOORS executable and libraries the same way as the start batch files.
- runBranch.bat - batch file to execute a branching operation. Mostly just a wrapper to call runDXL.bat file along with setting some environment variables needed by the branching code later.
Example
Objective: create our first branch by using Command Line script.
We will reproduce the first branching tutorial using Command Line.
In this first Tutorial, we will perform the simplest branch operation possible, that of a single module with no out-links.
(Help Contents…>Tutotials>Branch Lessons>Branch Lesson 1: The Simplest Branch)
-
Set up Tutorials Database. - For that you have to run the setup script provided.:

-
Create a new target project - ("BranchTutoCL") to branch into:
Before branching, you need to create a project to branch into.
For the purpose of this lesson, create a new project in the root directory of DOORS Database:
right-click in an empty space of the list view on the right side of the database explorer, choose New > Project...
Enter a name for the new project, e.g. "BranchTutoCL", and press OK.

-
Create the TagList File - text file containing the tags to branch:
The objectives is to create a taglist.txt which you can create by pasting a taglist created by the TagList Editor (using the TagLists tab and Edit TagList button).
Now start the "Edit Tag Lists" script by choosing the Configuration Mgt > Edit Tags List menu option.
Select the module baseline to branch: in our example we want to branch "Module X" from BranchManager Tutorial for [user] >2.0 Branch Lessons > 2.1 The Simplest Branch for [user]

Click on "Edit Taglist" button.
Select and copy the content.

Paste the content in a new a text file (Taglist.txt) created in the root directory of BranchManager.

The Taglist.txt will contain just one module in our example:

-
Create/Edit the Branch Script:
You can find in the root directory of BranchManager a script example ‘runBranchQuick.bat’.
It’s an example of how a call to the runBranch.bat file looks:
syntax:
- Call runBanch.bat [DOORS Username] [DOORS Password] [Branch Script] [Taglist File] [Target Project] [Log File*]
runBranchQuick.bat original example :

We will update this script as following:
- Update userName (knop in the example, with your userName)
- Update userPassword (x in the example, with your userPassword)
- Update Taglist File ("zcratch\taglist1.txt", with our new taglist TagList.txt)
- Update Target Project ("/SLBranch", with out new target project "/BranchTutoCL")
Result is something like this:

Note: There cannot be any spaces in the target project name! During DOS batch execution, it attempts to resolve it as a file name.
-
launch the script and check result:
Double click on the runBranchQuick.bat
Branching is completely the same, you will even see the progress bar.
To check the result: open BranchManager for DOORS and look in your Target Project ("BranchTutoCL"), you will find "Module X" branched.

Limitation
-
There cannot be any spaces in the target project name! During DOS batch execution, it attempts to resolve it as a file name.
-
When branching in batch mode, views are not copied.
This is one major difference between branching with the GUI and branching in batch mode.
This is because to copy a view from module to module in DOORS you must make the modules visible, and this is not possible in batch mode. (Fix will be investigate in future release)