Exporting from the command-line interface is useful when you want to export files automatically, e.g., once a day at midnight.

 

To export a ReqIF file from the command-line interface


  1. Open the Command Prompt window
  2. Go to the <model editor installation directory>/plugins/com.nomagic.requirements directory containing the reqifexport.exe file.
  3. At the command prompt, type the following command and specify the values of the required arguments:
    reqifexport project_descriptor=<project URL> reqif_file=<path to ReqIF file> export_type=<specifications|elements> elements=
    <hyperlinks or qualified names of elements> source_tool_id=<ReqIF flavor>

    Where:

  4. Press Enter.

The ReqIF file with the desired data is now exported to the specified directory.
 

Using a properties file

To make exporting from the command-line interface quicker you can specify arguments in a properties file, which can be easily edited or reused.

 

To export a ReqIF file from the command-line interface using a properties file


  1. Create a properties file and specify the values of the following arguments:

    See the example of a properties file below.

    project_descriptor=file:/C:/Users/johnsmith/Downloads/MagicDraw_185/samples/requirements/MagicLibrary%20requirements.mdzip
    #
    # Specify the project URL.
    # To get a project descriptor, open a project and in the main menu go to File > Project Properties > General.
    #
    reqif_file=C:/Users/johnsmith/Documents/Project_Requirements/project_requirements.reqif
    #
    # Specify the path to the ReqIF file.
    # NOTE: If there is a space in a path, surround the argument and its value with escaped quote (\").
    #
    export_type=elements
    #
    # Specify the type of exported data. The value of the argument can be "specifications" or "elements".
    #
    elements=mdel://_17_0_2_8f90291_1308667744583_445317_24132;mdel://_17_0_2_8f90291_1308667618344_111153_24071
    #
    # Specify the hyperlinks or qualified names (or the combination  of both) of the elements to be exported.
    # To get the hyperlink of an element, open a project, right-click the element in the Containment tree and select "Copy Element Hyperlink".
    #
    source_tool_id=MagicDraw
    #
    # Specify the flavor of the ReqIF file. Supported flavors are: "MagicDraw", "IBM Rational DOORS", "Polarion", "Teamcenter" and "Reqtify".
    # NOTE: This argument is optional.
    #


    When creating a properties file on Windows OS, use only / or \\ as a path separator, otherwise the command will fail.


  2. Open the Command Prompt window.
  3. Go to the <model editor installation directory>/plugins/com.nomagic.requirements directory containing the reqifexport.exe file.
  4. At the command prompt, type the following command and specify the value of the properties_file argument.

    reqifexport properties_file=<path to properties file>

    Where properties_file is the path to the properties file to be used.

  5. Press Enter.

The ReqIF file with the desired data is now exported to the specified directory.