Topic
  • 2 replies
  • Latest Post - ‏2013-01-11T10:03:02Z by Mathias Mamsch
SystemAdmin
SystemAdmin
3180 Posts

Pinned topic How to run a command line scripts via DXL

‏2013-01-08T06:16:39Z |
Here I need to generate documents from DOORS using RPE, but I want to use a DXL button to set the RPE parameters and fire it without any manual action.

I know that we can run RPE with a command line switch, So can we just run a command line via DXL and do what I want?

or anyone know some other methods to impelement my requirement?

many thanks!!
Updated on 2013-01-11T10:03:02Z at 2013-01-11T10:03:02Z by Mathias Mamsch
  • Tony_Goodman
    Tony_Goodman
    270 Posts

    Re: How to run a command line scripts via DXL

    ‏2013-01-10T10:49:55Z  

    This example should get you started. This is cut from a larger script that dynamically creates a specification file before calling RPE, but you could create this manually and store it somewhere.
     

    //   RPE Launcher
     
    /*
    
        12-OCT-2011         Tony Goodman    Server installation
    */
     
    const string RPE_FOLDER = "<server location>"
     
    const string RPE_HOME = RPE_FOLDER "\\Rational\\Publishing Engine\\1.1.2"
     
    const string RPE_LAUNCHER = RPE_HOME "\\launcher\\rpe-launcher.exe"
     
    // you must first create he specification file
    const string SPECIFICATION_FILE = "generated.dsx"
     
    bool showResults = true
     
    void rpeLauncher()
    {
            Buffer cmd = create
     
            // Set the RPE_HOME environment variable before calling launcher
            // This does not interfere with any local installation of RPE as it gets
            // overwritten when RPE in started locally.
            setenv("RPE_HOME", RPE_HOME)
            
            cmd += RPE_LAUNCHER
            
            // specify the output folder
            cmd += " -data "
            cmd += "\"" rpeOutputFolder "\""
            
            // publish from the supplied specification file
            cmd += " -publish "
            cmd += "\"" SPECIFICATION_FILE "\""
            
            if (!showResults)
            {
                    // inhibit display of launcher results window
                    cmd += " -noresult"
            }
            
            // give command string to windows for execution
            // We cannot wait for the result by using win32SystemWait_() because RPE is using the current instance of DOORS
            // and doing so would result in dead-lock (RPE trying to communicate with a process that is stopped, 
            // waiting for RPE to finish).
            system(stringOf(cmd))
            
            delete(cmd)
    }
     
    rpeLauncher()
    


    Tony Goodman, www.smartdxl.com

    Updated on 2014-01-09T00:53:09Z at 2014-01-09T00:53:09Z by iron-man
  • Mathias Mamsch
    Mathias Mamsch
    2003 Posts

    Re: How to run a command line scripts via DXL

    ‏2013-01-11T10:03:02Z  
    The following post might also help you. It deals with automating the RPE GUI to start the RPE export. Regards, Mathias

    https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14612904&#14612904


    Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS