Question & Answer
Question
I'd like to have a solution for automating the export from IBM Rational DOORS to Word
Answer
1. Create file export_batch.dxl. Put the following content in it:
- ********************************************************************
// override some default message box functions, so they will only print the data but
// not pause execution. Write to a log file here!
bool confirm (string s) { print "Confirmed: " s "\n"; return true }
void ack (string s) {print "Acknowledge: " s "\n" }
// void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infobox (string s) {print "Info: " s "\n" }
void info (string s) {print "Info: " s "\n" }
DB theDiag = null
// Now override block and show, to only do realize
void show (DB x) { realize x; theDiag = x }
void block (DB x) { realize x; theDiag = x }
if (null current Module) {
print "You need to have a current Module set for the export."
halt
}
// we need braces, since -D will be executed at top level and we will get name
// clashes for variable defined in word.dxl and the other includes of it.
{
// now include the word.dxl -> this will pop up the dialog, but not halt execution
// due to the overrides above
#include <standard/export/office/word.dxl>
// here we can change the dialog options. See itfui2.inc and word.dxl for all
// the options
set(exportHeadingsToggle, false) // turn off export of headings
set(exportLayoutChoice, 1)
// now manually launch the export button callback
doExport theDiag
// get rid of the dialog
if (!null theDiag) destroy theDiag
// close DOORS
exit_
}
************************************************************************
2. Create a batch file export.bat, and put the following in it:
- ************************************************************************
@echo off
if "%~1"=="" (
echo You need to start this script with a DOORS Module
goto :real_end
)
"C:\Program Files (x86)\IBM\Rational\DOORS\9.3\\bin\DOORS.exe" -u Administrator -password password -f "%TEMP%" -D "current = read(\"%~1\", true); #include <export_batch.dxl>"
:real_end
**************************************************************************
3. Make sure that the export_batch.dxl and the export.bat are in the same directory. Then can call it (from that directory, so that -D command can find the relative include!). Open a command prompt inside the directory where export.bat and export_batch.dxl are located. Execute the following command:
export.bat "/My Project/My Module"
4. Or, you can create another bat file in the same folder. Name it doors_export.bat and put the following content inside:
- ***************************************************************************
@echo off
export.bat "/My Project/My Module"
***************************************************************************
Note:
- This example contains the default path for the DOORS 9.3 client and needs to be edited accordingly.
- In this example the DOORS user is "Administrator" with the password "password" and they need to be edited accordingly.
- The value "/My Project/My Module" represents the DOORS path to the module to be exported and needs to be edited accordingly.
_________________________________________________________________________________
Any assistance that IBM gives in issues regarding private DXL scripting and/or modified DOORS scripts are not covered under the IBM - Licensee maintenance/support agreement. All suggestions IBM provides should be tested on either a test server or a back-up database, and never in a production environment. IBM shall not be responsible for loss of data or down time through the interaction with these unsupported scripts. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |
---|
Was this topic helpful?
Document Information
Modified date:
01 May 2020
UID
swg21567793