Batch Mode Automatization
5 min read
last updated: 10/26/2021
ReqEdit can be used without GUI in a command line to import or export ReqIF files.
Batch mode functionality:
- Import RIF1.1a to ReqIF
- Export ReqIF to RIF1.1a
- Import from MS Word (.docx) to ReqIF
- REQXML to ReqIF, read the xml format specification
Examples
Import from a RIF11a to a ReqIF file
ReqEdit.exe -batch -in "D:\Workplace\Input Folder\requirements.zip" -out "D:\Workplace\Output Folder" -mapping "D:\ Workplace\RifToReqif.txt" -jobid "001" -logfile "D:\Workplace\Log.txt"
Export from a ReqIF to a RIF11a file
ReqEdit.exe -batch -in "D:\Workplace\Input Folder\requirements.reqifz" -out "D:\Workplace\Output Folder" -mapping "D:\ Workplace\ReqifToRif.txt" -jobid "002" -outtype RIF11a -logfile "D:\Workplace\Log.txt"
Export from a ReqIF to a REQIF DNG file (obsolete)
ReqEdit.exe -batch -in "D:\Workplace\Input Folder\requirements.reqifz" -out "D:\Workplace\Output Folder" -jobid "003" -outtype REQIFDNG -logfile "D:\Workplace\Log.txt"
Import from a Word .docx to a ReqIF file
ReqEdit.exe -batch -in "D:\Workplace\Input Folder\requirements.docx" -out "D:\Workplace\Output Folder" -mapping "D:\ Workplace\WordToReqif.txt" -jobid "004" -logfile "D:\Workplace\Log.txt" –keephierarchy -removechapternumberings –tables –attachments –images -attributetable row
Import from REQXML to ReqIF file, read more here: REQXML format
ReqEdit.exe -batch -in "D:\Workplace\Input Folder\requirements.reqxml"
-out "D:\Workplace\Output Folder" -jobid "003"
-mapping "D:\ Workplace\ReqXmltoReqIF.txt" -logfile "D:\Workplace\Log.txt"
Parameters
General batch parameters
-batch | mandatory enable batch mode without displaying GUI |
-in | mandatory indicates the input file |
-out | mandatory indicates the output folder |
-mapping | optional used only for ReqIF~RIF conversions if a mapping is not specified, the default mapping of the system attributes is used |
-jobid | optional sets a custom prefix for the output file if not set, the output file will have a datetime prefix |
-logfile | optional indicate the absolute path to the user desired logfile if the logfile already exists, the new information will be appended if not specified, the logs will be written to the standard ReqEdit log |
ReqIF and RIF import/export parameters
-outtype | indicate the output type possible values are “RIF11a”, “REQIF” or “REQIFDNG” for Rational DOORS Next Generation compatible files |
Word import parameters
-keephierarchy | optional will recreate the parent/child hierarchy in the Word file based on Heading levels. If not enabled, all Headings will be displayed on the first level |
-removechapternumberings | optional removes manual chapter numberings |
-tables | optional all tables will be converted to a ReqIF compatible (HTML) table, else all tables in the file will be ignored |
-attachments | optional embedded objects (Word (rtf, doc, docx), Excel (xls, xlsx), Powerpoint (ppt, pptx)) in the Word document will be imported to ReqIFz file and referenced inside the ReqIF object, else all objects in the Word file will be ignored |
-images | optional embedded images (JPG, PNG, BMP) in the Word document will be imported to ReqIFz file and referenced inside the ReqIF object, else all images in the Word file will be ignored |
-attributetable | optional possible values “row” or “column” the word document parser will look in the first row/column of all tables for the values given in the mapping file to assert if the table should be treated as an attribute table |
NOTE: Parameter values which contain empty spaces or special characters like slash, backslash and others, need to be written between quotes
Mapping file
The mapping files are used to translate attribute names from RIF to ReqIF standard and vice-versa. The mapping file is a simple .txt file with the format shown below in two examples with IBM DOORS system attribute names and two custom attributes displayed with red text.
Example of a RifToReqif mapping file
Absolute Number - ReqIF.ForeignID
Created By - ReqIF.ForeignCreatedBy
Created On - ReqIF.ForeignCreatedOn
Created Thru - ReqIF.ForeignCreatedThru
Last Modified By - ReqIF.ForeignModifiedBy
Object Heading - ReqIF.ChapterName
Object Number - ReqIF.ChapterNumber
Object Short Text - ReqIF.Name
Object Text - ReqIF.Text
Description - ReqIF.Description
Customer_Description - Supplier_Description
Customer_Status - Supplier_Status
Example of a ReqifToRif mapping file
ReqIF.ForeignID - Absolute Number
ReqIF.ForeignCreatedBy - Created By
ReqIF.ForeignCreatedOn - Created On
ReqIF.ForeignCreatedThru - Created Thru
ReqIF.ForeignModifiedBy - Last Modified By
ReqIF.ChapterName - Object Heading
ReqIF.ChapterNumber - Object Number
ReqIF.Name - Object Short Text
ReqIF.Text - Object Text
ReqIF.Description - Description
Supplier_Description - Customer_Description
Supplier_Status - Customer_Status
Example of a WordToReqif mapping file
ID | ReqIF.ForeignID | integer
Heading | ReqIF.ChapterName | text
Text | ReqIF.Text | text
Customer_Desc | Supplier_Descr | text
Release Date | Release Date | date: dd.MM.yyyy
Price | Price | real: .
Example of a REQXML to ReqIF mapping file
Last Modified By - ReqIF.ForeignModifiedBy
Object Heading - ReqIF.ChapterName
Object Number - ReqIF.ChapterNumber
Object Short Text - ReqIF.Name
Object Text - ReqIF.Text
Customer_Description - Supplier_Description
Customer_Status - Supplier_Status
REQXML
This is a simplified custom XML format to speed up data exchange to ReqIF format. Read here the REQXML documentation.
Output files
If the target type is ReqIF or ReqIF DNG, there will be only one output file (reqif or reqifz)
If the target type is single Spec RIF, there will be only one output file (xml or zip)
If the target type is multi Spec RIF, there will be one output file for each Specification (xml or zip); the file names will contain the names of the specifications
Logging
For each batch operation, an entry will be added to the logfile. Each entry will contain the date and time of the operation, the input and output file(s) path and names, the output file(s) type and the job ID.
If an error occurs during the operation, the report will include an exit code and message. You can see the complete list of exit codes and messages below.
General Exit Codes
5 | Batch Feature ID is missing |
10 | Error during Conversion |
20 | Mandatory Parameter “batch” is missing |
21 | Mandatory Parameter “in” is missing |
22 | Mandatory Parameter “out” is missing |
23 | Invalid output type value |
24 | Job id can not be empty |
25 | Has invalid parameter |
26 | Incompatible output type value |
Input File Related Exit Codes
110 | Input File is not readable or does not exist |
120 | Input File has not defined type (Autodetection fails) |
130 | Input File is not valid (Schema validation fails) |
Output File Related Exit Codes
210 | Not enough space in output folder (3*size of input file required to be free) |
220 | Outputfolder is not writable |
240 | Output folder does not exist |
Mapping File Related Exit Codes
310 | Mapping file does not exist or is not readable |
320 | Mapping file has wrong format |
Log File Related Exit Codes
410 | Access denied; Cannot create not existing log file on creation mode |
411 | Access denied; Cannot write to existing log file on update mode |