Topic
  • 6 replies
  • Latest Post - ‏2013-09-13T13:32:27Z by MarcvanLint
MarcvanLint
MarcvanLint
57 Posts

Pinned topic Dynamics around RPE Launching

‏2013-09-12T11:06:57Z |

Hello World,

I've got a nice template which generates an output (e.g. pdf, html or word) of a test case.

Now I want to generate individual documents for each test case available in the Jazz database.

For example:

TC1 ->    tc1.pdf

TC2 ->    tc2.pdf

The challenge is around the filename. Can I use a command prompt argument to set a external variable?

How can I accomplish this?

 

Updated on 2013-09-12T12:32:09Z at 2013-09-12T12:32:09Z by MarcvanLint
  • Dragos.Cojocari
    Dragos.Cojocari
    1617 Posts
    ACCEPTED ANSWER

    Re: Dynamics around RPE Launching

    ‏2013-09-13T12:36:12Z  

    Nearly there...

    I got that working for the OUTPUT.

    Now I want to steer the INPUT. I want to give an argument to the template. So created external variable and placed $USERNAME in the variable value in the launcher. That didnt work.

    So I want to give variable to the template. So we're able to do something like

    set TCTOPRINT="5"

    set OUTPUT_PDF=D:\DOCUMENTARCHIVE\TC$TCTOPRINT.pdf

    set INPUT_PROC_TC=TCTOPRINT

    %RPE_HOME%\launcher\....

    In the specification, the output-file for the PDF is defined as $OUTPUT_PDF .

    When a external declared variable grabs the INPUT_PROC_TC variable.

     

    >>> So created external variable and placed $USERNAME in the variable value in the launcher. That didnt work.

    This only works for the paths of the outputs and the URLs of the inputs. If you use that in the URL of the data source it should work. For example the following string resolves to the XML file shipped with the RPE Examples:

    ${RPE_HOME}\source\XML\examples\Requirements_PR.xml

    Alternatively you can read the value of the system's variable inside the template in a java script ( the DDS URI property I would say) with a code like this:

    java.lang.System.getenv( "USERNAME");

    >>> Can I use a definition file to set a external parameter?

    No.

    Regards,

        Dragos

  • Dragos.Cojocari
    Dragos.Cojocari
    1617 Posts

    Re: Dynamics around RPE Launching

    ‏2013-09-13T10:20:20Z  

    Marc,

     

    you can use system variables when defining the path name. For example if I set the PDF output to

    d:\${USERNAME}.pdf

    than the output will be generated on my machine as d:\dragos.pdf

    So in your scenario what  you could do is define a new system variable to hold the name of the output, use it in the docspec to control the output path and define its value that in the btach script that invokes RPE's command line API. Example:

    set OUTPUT_PATH=d:\TC1.pdf

    %RPE_HOME%\launcher\rpe-launcher.exe....

     

    Regards,

        Dragos

  • MarcvanLint
    MarcvanLint
    57 Posts

    Re: Dynamics around RPE Launching

    ‏2013-09-13T10:33:05Z  

    Marc,

     

    you can use system variables when defining the path name. For example if I set the PDF output to

    d:\${USERNAME}.pdf

    than the output will be generated on my machine as d:\dragos.pdf

    So in your scenario what  you could do is define a new system variable to hold the name of the output, use it in the docspec to control the output path and define its value that in the btach script that invokes RPE's command line API. Example:

    set OUTPUT_PATH=d:\TC1.pdf

    %RPE_HOME%\launcher\rpe-launcher.exe....

     

    Regards,

        Dragos

    Thanks. Using the tip. Testing approach ...

  • MarcvanLint
    MarcvanLint
    57 Posts

    Re: Dynamics around RPE Launching

    ‏2013-09-13T11:12:08Z  

    Marc,

     

    you can use system variables when defining the path name. For example if I set the PDF output to

    d:\${USERNAME}.pdf

    than the output will be generated on my machine as d:\dragos.pdf

    So in your scenario what  you could do is define a new system variable to hold the name of the output, use it in the docspec to control the output path and define its value that in the btach script that invokes RPE's command line API. Example:

    set OUTPUT_PATH=d:\TC1.pdf

    %RPE_HOME%\launcher\rpe-launcher.exe....

     

    Regards,

        Dragos

    Nearly there...

    I got that working for the OUTPUT.

    Now I want to steer the INPUT. I want to give an argument to the template. So created external variable and placed $USERNAME in the variable value in the launcher. That didnt work.

    So I want to give variable to the template. So we're able to do something like

    set TCTOPRINT="5"

    set OUTPUT_PDF=D:\DOCUMENTARCHIVE\TC$TCTOPRINT.pdf

    set INPUT_PROC_TC=TCTOPRINT

    %RPE_HOME%\launcher\....

    In the specification, the output-file for the PDF is defined as $OUTPUT_PDF .

    When a external declared variable grabs the INPUT_PROC_TC variable.

     

  • MarcvanLint
    MarcvanLint
    57 Posts

    Re: Dynamics around RPE Launching

    ‏2013-09-13T11:55:04Z  

    Nearly there...

    I got that working for the OUTPUT.

    Now I want to steer the INPUT. I want to give an argument to the template. So created external variable and placed $USERNAME in the variable value in the launcher. That didnt work.

    So I want to give variable to the template. So we're able to do something like

    set TCTOPRINT="5"

    set OUTPUT_PDF=D:\DOCUMENTARCHIVE\TC$TCTOPRINT.pdf

    set INPUT_PROC_TC=TCTOPRINT

    %RPE_HOME%\launcher\....

    In the specification, the output-file for the PDF is defined as $OUTPUT_PDF .

    When a external declared variable grabs the INPUT_PROC_TC variable.

     

    Can I use a definition file to set a external parameter?

  • Dragos.Cojocari
    Dragos.Cojocari
    1617 Posts

    Re: Dynamics around RPE Launching

    ‏2013-09-13T12:36:12Z  

    Nearly there...

    I got that working for the OUTPUT.

    Now I want to steer the INPUT. I want to give an argument to the template. So created external variable and placed $USERNAME in the variable value in the launcher. That didnt work.

    So I want to give variable to the template. So we're able to do something like

    set TCTOPRINT="5"

    set OUTPUT_PDF=D:\DOCUMENTARCHIVE\TC$TCTOPRINT.pdf

    set INPUT_PROC_TC=TCTOPRINT

    %RPE_HOME%\launcher\....

    In the specification, the output-file for the PDF is defined as $OUTPUT_PDF .

    When a external declared variable grabs the INPUT_PROC_TC variable.

     

    >>> So created external variable and placed $USERNAME in the variable value in the launcher. That didnt work.

    This only works for the paths of the outputs and the URLs of the inputs. If you use that in the URL of the data source it should work. For example the following string resolves to the XML file shipped with the RPE Examples:

    ${RPE_HOME}\source\XML\examples\Requirements_PR.xml

    Alternatively you can read the value of the system's variable inside the template in a java script ( the DDS URI property I would say) with a code like this:

    java.lang.System.getenv( "USERNAME");

    >>> Can I use a definition file to set a external parameter?

    No.

    Regards,

        Dragos

  • MarcvanLint
    MarcvanLint
    57 Posts

    Re: Dynamics around RPE Launching

    ‏2013-09-13T13:32:27Z  

    >>> So created external variable and placed $USERNAME in the variable value in the launcher. That didnt work.

    This only works for the paths of the outputs and the URLs of the inputs. If you use that in the URL of the data source it should work. For example the following string resolves to the XML file shipped with the RPE Examples:

    ${RPE_HOME}\source\XML\examples\Requirements_PR.xml

    Alternatively you can read the value of the system's variable inside the template in a java script ( the DDS URI property I would say) with a code like this:

    java.lang.System.getenv( "USERNAME");

    >>> Can I use a definition file to set a external parameter?

    No.

    Regards,

        Dragos

    Got some bits working. Now I'm able to steer what's documented (using the getenv option) and steer where the output to route to. Thanks!