Topic
35 replies Latest Post - ‏2013-11-15T10:01:38Z by Mathias Mamsch
StephenValliere
StephenValliere
30 Posts
ACCEPTED ANSWER

Pinned topic RPE Lite export with DXL

‏2011-04-01T11:25:05Z |
Does anyone know of any DXL support for exporting through the RPE Lite (File -> Export -> Document Generation) buit in to DOORS 9.3?

I am trying to script an Export to a PDF so if anyone knows another way to do that I would also be interested.

Thanks,
Steve Valliere
Updated on 2012-06-05T13:07:58Z at 2012-06-05T13:07:58Z by Yujhe.li
  • SystemAdmin
    SystemAdmin
    3180 Posts
    ACCEPTED ANSWER

    Re: RPE Lite export with DXL

    ‏2011-04-05T11:42:37Z  in response to StephenValliere

    The PDF export dialog is built by the following script: DOORS\9.3\lib\dxl\standard\export\RPE_light\rpe_to_pdf.dxl which does not have much content:
     

    #include <standard/export/RPE_Light/DoorsExport.inc>
     
    showRPEExportDialog(LS_("String_Export_To_PDF", NLSTEMP_("Export to PDF")), 
                (NLS_("pdf")), (NLS_(".pdf")))
    

     


    But, testing the above I was able to start the dialog from my own script. Did not find any other functions.

     

    Updated on 2014-01-02T18:32:23Z at 2014-01-02T18:32:23Z by iron-man
    • StephenValliere
      StephenValliere
      30 Posts
      ACCEPTED ANSWER

      Re: RPE Lite export with DXL

      ‏2011-04-05T13:50:16Z  in response to SystemAdmin
      I got that far, but I need to be able to do this without the user being prompted for information.
  • Mathias Mamsch
    Mathias Mamsch
    1762 Posts
    ACCEPTED ANSWER

    Re: RPE Lite export with DXL

    ‏2011-04-05T13:27:02Z  in response to StephenValliere
    You can automate the export dialog, like described in other batch export dialogs. You can use the DBE variables like exportFileName, includeEmptyAttrsToggle, viewNameToggle or includeTablesToggle to define the options before launching exportCB(DBE) to simulate the button press. Maybe that helps, Regards, Mathias

    Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
    • Mathias Mamsch
      Mathias Mamsch
      1762 Posts
      ACCEPTED ANSWER

      Re: RPE Lite export with DXL

      ‏2011-04-05T13:27:47Z  in response to Mathias Mamsch
      I wanted to say: You can automate the export dialog, like described in other batch export posts in this forum.
      • StephenValliere
        StephenValliere
        30 Posts
        ACCEPTED ANSWER

        Re: RPE Lite export with DXL

        ‏2011-04-05T13:51:17Z  in response to Mathias Mamsch
        Thanks Methias,

        I will look into that. I have not tried to automate a dialog before.
    • StephenValliere
      StephenValliere
      30 Posts
      ACCEPTED ANSWER

      Re: RPE Lite export with DXL

      ‏2011-04-05T16:50:52Z  in response to Mathias Mamsch

      I get an error when I execute the following code:
       

      // 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 tmpDB = null
       
      // Now override block and show, to only do realize
      void show  (DB x) { realize x; tmpDB = x }
      void block (DB x) { realize x; tmpDB = x }
       
      {
          #include <standard/export/RPE_Light/DoorsExport.inc>
       
              set(exportFileName,"C:\\Documents and Settings\\user\\Desktop\\Test.pdf")
              set(includeEmptyAttrsToggle, true)
              set(viewNameToggle, true)
              set(includeTablesToggle, true)
              
              exportCB(DBE)
              
              if(!null tmpDB) destroy tmpDB
              
              //showRPEExportDialog(LS_("String_Export_To_PDF", NLSTEMP_("Export to PDF")), (NLS_("pdf")), (NLS_(".pdf")))
      }
      

       


      The error I get is:

       

       

       

      -R-E- DXL: <Line:20> unassigned variable (exportFileName)
      



      Any ideas? Did I set this up wrong?

      Thanks,
      Steve



       

       

      Updated on 2014-01-02T18:33:37Z at 2014-01-02T18:33:37Z by iron-man
      • llandale
        llandale
        2809 Posts
        ACCEPTED ANSWER

        Re: RPE Lite export with DXL

        ‏2011-04-05T17:12:30Z  in response to StephenValliere
        exportFileName hasn't yet been defined. I don't have that include file DoorsExport.inc, but probably the code that defines that DBE in a dialog is not automatically called, you must do that. And it probably also issues the "show" command which means you won't be able create the dialog, change its elements, and display it that way.

        • Louie
      • Mathias Mamsch
        Mathias Mamsch
        1762 Posts
        ACCEPTED ANSWER

        Re: RPE Lite export with DXL

        ‏2011-04-06T06:52:18Z  in response to StephenValliere

        You still need to call the
         

        showRPEExportDialog(LS_("String_Export_To_PDF", NLSTEMP_("Export to PDF")), 
                    (NLS_("pdf")), (NLS_(".pdf")))
        

         


        function, before you start modifying the dialog ... Otherwise it will not exist and you get the "unassigned variable" error ... :-) Otherwise the code should be fine...

        Regards, Mathias

         

         


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

         

        Updated on 2014-01-02T18:34:14Z at 2014-01-02T18:34:14Z by iron-man
        • StephenValliere
          StephenValliere
          30 Posts
          ACCEPTED ANSWER

          Re: RPE Lite export with DXL

          ‏2011-04-06T17:06:16Z  in response to Mathias Mamsch

          So I added that line back in and this is what I have now:
           

          // 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 "Ack: " s "\n" }
          void errorBox (string s) {print "Error: " s "\n"; }
          void warningBox (string s) {print "Warning: " s "\n"; }
          void acknowledge (string s) {print "Acknowledge: " s "\n"  }
          void infobox (string s) {print "InfoBox: " s "\n" }
          void info (string s) {print "Info: " s "\n" }
           
          DB tmpDB = null
           
          // Now override block and show, to only do realize
           
          void show  (DB x) { realize x; tmpDB = x }
           
           
          {
              #include <standard/export/RPE_Light/DoorsExport.inc>
                  
                  showRPEExportDialog(LS_("String_Export_To_PDF", NLSTEMP_("Export to PDF")), (NLS_("pdf")), (NLS_(".pdf")))
           
                  set(exportFileName,"C:\\Users\\THEUSER\\Desktop\\Test4.pdf")
                  set(includeEmptyAttrsToggle, true)
                  set(viewNameToggle, true)
                  set(includeTablesToggle, true)
                  set(styleChoice,0)
                  
                  exportCB(DBE)
          }
          

           


          I Don't get the error anymore, now I get a bar showing the export progress (which is fine I am not trying to run totally silent) but when the bar gets to the end it says "Timed out whilst trying to create C:\Users\THEUSER\Desktop\Test4.pdf" (THEUSER is actually the username not THEUSER).
          Also I was able to play around with some code and get it to export while giving me the error that says "unassigned variable", but everything I do to get rid of the error either gives me a different error or produces the same result as the code above...

          Any ideas? I am running out of hair to pull out.

          -Steve

          THANKS FOR ALL THE HELP! I wouldn't have gotten this close without it!

           

          Updated on 2014-01-02T18:35:03Z at 2014-01-02T18:35:03Z by iron-man
          • Mathias Mamsch
            Mathias Mamsch
            1762 Posts
            ACCEPTED ANSWER

            Re: RPE Lite export with DXL

            ‏2011-04-06T21:20:06Z  in response to StephenValliere

            Hey Steve,

            don't worry about the "Timed Out" message for starters. The export script will wait for 75 seconds if that file that you specified got exported. If it cannot find that file it will tell you the time our error. This does not mean, that your export has not been started. The RPE light plugin will just start java over the commandline, so you want to check, if you have a 'java.exe' running, after you start your script. What you should do in any case is to verify that you can do the export over the normal GUI (and will not timeout after 75 seconds) and then you can add

            ...
              // add this before the show ...
              void oldshow(DB x) { show x }
              void show  (DB x) { realize x; tmpDB = x }
              ...
            

             


            and call "oldshow tmpDB" instead of doexport. This should popup the export GUI with your new settings applied. Then you can verify the settings, and press the export button manually and see if it will bring a different result. Maybe this helps, regards, Mathias

             

             

             


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

             

             

            Updated on 2014-01-02T18:35:38Z at 2014-01-02T18:35:38Z by iron-man
            • StephenValliere
              StephenValliere
              30 Posts
              ACCEPTED ANSWER

              Re: RPE Lite export with DXL

              ‏2011-04-07T11:55:46Z  in response to Mathias Mamsch
              Ok, that functioned as you expected... Adding in that line and calling it instead of the exportCB allowed me to generate the PDF with the settings I chose. And I monitored the processes and in both cases javaw.exe runs while the file is trying to export. However in the automated one javaw.exe stops and the export times out, no file being created. It seems like there is something else being called or set that I am missing when i override show.
              • Mathias Mamsch
                Mathias Mamsch
                1762 Posts
                ACCEPTED ANSWER

                Re: RPE Lite export with DXL

                ‏2011-04-07T14:10:28Z  in response to StephenValliere

                Ok, I think I know what the problem is (unfortunately I cannot try for myself, so we need to keep up the trial and error). But don't worry, we will get this running.

                My guess is that the java program will reconnect to DOORS using the COM interface. Since this is not possible while another DXL program runs (i.e. our export script that was never actually shown or blocked) the script will fail controlling DOORS and therefore quit without doing the export.

                So we need to take another approach. Since we need to be into show or block, we must simulate the buttonpress after a call to block / show. We will do this using a timer:
                 

                bool confirm (string s) { print "Confirmed: " s "\n"; return true }
                void ack (string s) {print "Ack: " s "\n" }
                void errorBox (string s) {print "Error: " s "\n"; }
                void warningBox (string s) {print "Warning: " s "\n"; }
                void acknowledge (string s) {print "Acknowledge: " s "\n"  }
                void infobox (string s) {print "InfoBox: " s "\n" }
                void info (string s) {print "Info: " s "\n" }
                 
                DB tmpDB = null
                DBE tm = null
                 
                // Notice that show will only store the variable now. 
                void oldshow  (DB x) { show x} 
                void show  (DB x) { tmpDB = x }
                 
                {
                    #include <standard/export/RPE_Light/DoorsExport.inc>
                 
                        // create the dialog but do not show it yet
                        showRPEExportDialog(LS_("String_Export_To_PDF", NLSTEMP_("Export to PDF")), (NLS_("pdf")), (NLS_(".pdf")))
                        
                        // add a timer to it, it will 'press' the button now after we do show ...
                        void newcb(DBE x) {
                            print "Calling timercallback ...\n"           
                            stopTimer tm; exportCB(null)
                        }
                 
                        tm = timer(tmpDB, 0.2, newcb, ""); 
                        // realize the dialog box, so we can apply the settings ....
                        realize tmpDB; 
                        // apply the settings
                        set(exportFileName,"C:\\Users\\THEUSER\\Desktop\\Test4.pdf")
                        set(includeEmptyAttrsToggle, true)
                        set(viewNameToggle, true)
                        set(includeTablesToggle, true)
                        set(styleChoice,0)
                 
                        // show the dialog, timer will kick in and press our button
                        print "About to enter message loop ...\n"
                        oldshow tmpDB
                }
                

                 


                Lets see if we got luck with this one ;-) Regards, Mathias

                 

                 

                 


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

                 

                 

                Updated on 2014-01-02T18:36:30Z at 2014-01-02T18:36:30Z by iron-man
                • StephenValliere
                  StephenValliere
                  30 Posts
                  ACCEPTED ANSWER

                  Re: RPE Lite export with DXL

                  ‏2011-04-07T14:29:04Z  in response to Mathias Mamsch
                  You're good! That works great.

                  Thanks for the help, I really appreciate it!
                • StephenValliere
                  StephenValliere
                  30 Posts
                  ACCEPTED ANSWER

                  Re: RPE Lite export with DXL

                  ‏2011-05-04T11:53:02Z  in response to Mathias Mamsch

                  Hey Mathias,

                  I have run into another problem with this script.

                  I need to run it from within another script and so I set up a function to call eval_ as shown below:
                   

                  void preDocumentCheckIn(DBE x)
                  {
                      documentExistsTimer = timer(optionsDB, 0.2, checkForPDF, "")
                          eval_("
                                  Module thisM = current
                          
                                  bool confirm (string s) { print \"Confirmed: \" s \"\\n\"; return true }
                                  void ack (string s) {print \"Ack: \" s \"\\n\" }
                                  void errorBox (string s) {print \"Error: \" s \"\\n\"; }
                                  void warningBox (string s) {print \"Warning: \" s \"\\n\"; }
                                  void acknowledge (string s) {print \"Acknowledge: \" s \"\\n\"  }
                                  void infobox (string s) {print \"InfoBox: \" s \"\\n\" }
                                  void info (string s) {print \"Info: \" s \"\\n\" }
                                  
                                  DB tmpDB = null
                                  DBE tm1 = null
                                  
                                  string pdfPath = \"C:\\\\\" name(thisM) \".pdf\"
                                  string err = \"\"
                                  
                                  // Now override block and show, to only do realize
                                  void oldshow(DB x) { show x }
                                  void show  (DB x) { tmpDB = x }
                                  {
                                          
                                          #include <standard/export/RPE_Light/DoorsExport.inc>
                                          
                                          showRPEExportDialog(LS_(\"String_Export_To_PDF\", NLSTEMP_(\"Export to PDF\")), (NLS_(\"pdf\")), (NLS_(\".pdf\")))
                                          
                                          void hitButtonCB(DBE x) {
                                          stopTimer tm1
                                          exportCB(null)
                                      }
                                      
                                      tm1 = timer(tmpDB, 0.2, hitButtonCB, \"Hit Button\"); 
                                      realize tmpDB; 
                                          
                                          set(exportFileName,pdfPath)
                                          set(includeEmptyAttrsToggle, true)
                                          set(viewNameToggle, true)
                                          set(includeTablesToggle, true)
                                          set(styleChoice,0)
                                          
                                          oldshow tmpDB
                                  }
                                  
                          ")
                  }
                  

                   


                  However, when I call this function it seems to be executing but the progress bar eventually gets to the end and I get an error saying that it timed out while trying to create the PDF.

                  But the same code:

                   

                   

                   

                  Module thisM = current
                   
                  bool confirm (string s) { print "Confirmed: " s "\n"; return true }
                  void ack (string s) {print "Ack: " s "\n" }
                  void errorBox (string s) {print "Error: " s "\n"; }
                  void warningBox (string s) {print "Warning: " s "\n"; }
                  void acknowledge (string s) {print "Acknowledge: " s "\n"  }
                  void infobox (string s) {print "InfoBox: " s "\n" }
                  void info (string s) {print "Info: " s "\n" }
                   
                  DB tmpDB = centered("Export to PDF")
                  DBE tm1 = null
                   
                  string pdfPath = "C:\\" name(thisM) ".pdf"
                  string err = ""
                   
                  // Now override block and show, to only do realize
                  void oldshow(DB x) { show x }
                  void show  (DB x) { tmpDB = x }
                   
                  {
                      #include <standard/export/RPE_Light/DoorsExport.inc>
                          
                          showRPEExportDialog(LS_("String_Export_To_PDF", NLSTEMP_("Export to PDF")), (NLS_("pdf")), (NLS_(".pdf")))
                          
                          void hitButtonCB(DBE x) {
                          stopTimer tm1
                          exportCB(null)
                      }
                      
                      tm1 = timer(tmpDB, 0.5, hitButtonCB, ""); 
                      
                      realize tmpDB; 
                          
                          set(exportFileName,pdfPath)
                          set(includeEmptyAttrsToggle, true)
                          set(viewNameToggle, true)
                          set(includeTablesToggle, true)
                          set(styleChoice,0)
                   
                      oldshow tmpDB
                   
                  }
                  



                  Works when not in the eval_ function.

                  Any ideas?

                  -Thanks
                  Steve



                   

                   

                  Updated on 2014-01-02T18:38:09Z at 2014-01-02T18:38:09Z by iron-man
                  • Mathias Mamsch
                    Mathias Mamsch
                    1762 Posts
                    ACCEPTED ANSWER

                    Re: RPE Lite export with DXL

                    ‏2011-05-04T14:34:35Z  in response to StephenValliere
                    Probably for the same reason the last approach did time out ... When you call showRPEExportDialog() you must be in the callback of a shown dialog, since RPE will try to call back over COM to DOORS. Unfortunately you did not post, how you call your "preDocumentCheckIn" function. This seems to already be a DBE callback, so you might be able to considerably simplify the code, but still this should work. What is definitvely wrong is, that the 'current' module is not set in the eval context, so this could be the secret. Try redefining the current module in the eval_ context correctly, by passing the module name as a string into the eval code, get a handle to the module, and set the current Module to it.

                    Regards, Mathias

                    Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
                    • StephenValliere
                      StephenValliere
                      30 Posts
                      ACCEPTED ANSWER

                      Re: RPE Lite export with DXL

                      ‏2011-05-04T14:45:06Z  in response to Mathias Mamsch

                      I get the same result with this:
                       

                      void preDocumentCheckIn(DBE x)
                      {
                          documentExistsTimer = timer(optionsDB, 0.2, checkForPDF, "")
                              eval_("
                                      Module thisM = edit(\"" fullName(m) "\",true)
                                      
                                      current = thisM
                              
                                      bool confirm (string s) { print \"Confirmed: \" s \"\\n\"; return true }
                                      void ack (string s) {print \"Ack: \" s \"\\n\" }
                                      void errorBox (string s) {print \"Error: \" s \"\\n\"; }
                                      void warningBox (string s) {print \"Warning: \" s \"\\n\"; }
                                      void acknowledge (string s) {print \"Acknowledge: \" s \"\\n\"  }
                                      void infobox (string s) {print \"InfoBox: \" s \"\\n\" }
                                      void info (string s) {print \"Info: \" s \"\\n\" }
                                      
                                      DB tmpDB = null
                                      DBE tm1 = null
                                      
                                      string pdfPath = \"C:\\\\\" name(thisM) \".pdf\"
                                      string err = \"\"
                                      
                                      // Now override block and show, to only do realize
                                      void oldshow(DB x) { show x }
                                      void show  (DB x) { tmpDB = x }
                                      {
                                              
                                              #include <standard/export/RPE_Light/DoorsExport.inc>
                                              
                                              showRPEExportDialog(LS_(\"String_Export_To_PDF\", NLSTEMP_(\"Export to PDF\")), (NLS_(\"pdf\")), (NLS_(\".pdf\")))
                                              
                                              void hitButtonCB(DBE x) {
                                              stopTimer tm1
                                              exportCB(null)
                                          }
                                          
                                          tm1 = timer(tmpDB, 0.2, hitButtonCB, \"Hit Button\"); 
                                          realize tmpDB; 
                                              
                                              set(exportFileName,pdfPath)
                                              set(includeEmptyAttrsToggle, true)
                                              set(viewNameToggle, true)
                                              set(includeTablesToggle, true)
                                              set(styleChoice,0)
                                              
                                              oldshow tmpDB
                                      }
                                      
                              ")
                      }
                      

                       


                      It does seem like an environment or context problem like you said, I am just not sure what else I need to define or pass in to get it to work.

                      -Steve

                       

                      Updated on 2014-01-02T18:39:01Z at 2014-01-02T18:39:01Z by iron-man
                      • StephenValliere
                        StephenValliere
                        30 Posts
                        ACCEPTED ANSWER

                        Re: RPE Lite export with DXL

                        ‏2011-05-04T14:51:06Z  in response to StephenValliere
                        Since RPE Lite is a java-based function it seems to me that it is failing to initialize the java code, and since DOORS gets no response from the java, it gives the time-out error. I have no idea what would need to be initialized to get the java function to work inside of the eval_ function.

                        When I run my script on its own out side of the eval_ function the progress bar only gets about 1/8th of the way across and it creates the PDF.

                        -Steve
                        • Mathias Mamsch
                          Mathias Mamsch
                          1762 Posts
                          ACCEPTED ANSWER

                          Re: RPE Lite export with DXL

                          ‏2011-05-04T19:52:35Z  in response to StephenValliere

                          It has nothing to do with the eval_ context ... As I said you need to post how you call the 'preDocumentCheckIn' function. Chances are you are locking DOORS up with a DXL script while the RPE is trying to connect back to DOORS over COM.

                          Regards, Mathias

                          The following code using eval_ works for me from a current module (yeah I have access to DOORS 9.3 now):

                          print fullName current Module
                           
                          void cb (DBE x) {
                           
                              eval_("
                                          Module thisM = edit(\"" fullName(current Module) "\",true)
                                          
                                          current = thisM
                                  
                                          bool confirm (string s) { print \"Confirmed: \" s \"\\n\"; return true }
                                          void ack (string s) {print \"Ack: \" s \"\\n\" }
                                          void errorBox (string s) {print \"Error: \" s \"\\n\"; }
                                          void warningBox (string s) {print \"Warning: \" s \"\\n\"; }
                                          void acknowledge (string s) {print \"Acknowledge: \" s \"\\n\"  }
                                          void infobox (string s) {print \"InfoBox: \" s \"\\n\" }
                                          void info (string s) {print \"Info: \" s \"\\n\" }
                                          
                                          DB tmpDB = null
                                          DBE tm1 = null
                                          
                                          string pdfPath = \"C:\\\\\" name(thisM) \".pdf\"
                                          string err = \"\"
                                          
                                          // Now override block and show, to only do realize
                                          void oldshow(DB x) { show x }
                                          void show  (DB x) { tmpDB = x }
                                          {
                                                  
                                                  #include <standard/export/RPE_Light/DoorsExport.inc>
                                                  
                                                  showRPEExportDialog(LS_(\"String_Export_To_PDF\", NLSTEMP_(\"Export to PDF\")), (NLS_(\"pdf\")), (NLS_(\".pdf\")))
                                                  
                                                  void hitButtonCB(DBE x) {
                                                  stopTimer tm1
                                                  exportCB(null)
                                              }
                                              
                                              tm1 = timer(tmpDB, 0.2, hitButtonCB, \"Hit Button\"); 
                                              realize tmpDB; 
                                                  
                                                  set(exportFileName,pdfPath)
                                                  set(includeEmptyAttrsToggle, true)
                                                  set(viewNameToggle, true)
                                                  set(includeTablesToggle, true)
                                                  set(styleChoice,0)
                                                  
                                                  oldshow tmpDB
                                          }
                                          
                                  ")
                          }
                           
                          DB diag = create("Export Test") 
                          button (diag, "Do Export Of Current", cb)
                           
                          show diag
                          

                           


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

                           

                          Updated on 2014-01-02T18:39:54Z at 2014-01-02T18:39:54Z by iron-man
                          • StephenValliere
                            StephenValliere
                            30 Posts
                            ACCEPTED ANSWER

                            Re: RPE Lite export with DXL

                            ‏2011-05-05T12:00:18Z  in response to Mathias Mamsch
                            Thanks Mathias, you saved the day again... I was using block on my DB, when i switched it to show it worked.

                            I owe you one!

                            -Steve
                • Yujhe.li
                  Yujhe.li
                  5 Posts
                  ACCEPTED ANSWER

                  Re: RPE Lite export with DXL

                  ‏2012-06-05T06:22:53Z  in response to Mathias Mamsch
                  Hi, Mathis

                  Where can I get these attribute about the following setting ?

                  set(exportFileName,"C:\\Users\\THEUSER\\Desktop\\Test4.pdf")
                  set(includeEmptyAttrsToggle, true)
                  set(viewNameToggle, true)
                  set(includeTablesToggle, true)
                  set(styleChoice,0)

                  Thanks.
                  • Mathias Mamsch
                    Mathias Mamsch
                    1762 Posts
                    ACCEPTED ANSWER

                    Re: RPE Lite export with DXL

                    ‏2012-06-05T11:57:25Z  in response to Yujhe.li
                    Sorry, what is the question? Regards, Mathias

                    Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
                    • Yujhe.li
                      Yujhe.li
                      5 Posts
                      ACCEPTED ANSWER

                      Re: RPE Lite export with DXL

                      ‏2012-06-05T13:07:58Z  in response to Mathias Mamsch
                      I mean how do you know these attributes, like "exportFileName", "includeEmptyAttrsToggle", "viewNameToggle",...etc. Because I can't find them in the DOORS manual.

                      Thanks.
                • mcrv
                  mcrv
                  4 Posts
                  ACCEPTED ANSWER

                  Re: RPE Lite export with DXL

                  ‏2013-11-05T13:37:52Z  in response to Mathias Mamsch

                  I'm trying export to Word through RPE Lite on DOORS 9.4, using the DXL retrieved from this forum.

                  The script in the attachment launchs the export and shows the progress bar. At the bar completion it arises the "Exporting large modules can take some time. Do you want to continue?" dialog box: if I choose "yes/yes to all" a new progress bar is shown, and so on; the "no" choice terminates the process without makes the DOC file. I noted that the javaw.exe has been run.

                  I also tried with the original version on DOORS 9.3, getting the same behaviour.

                  Maybe something occurs on RPE Lite since the posts within this forum. Has anyone any idea about the reason of export fail?

                  Thanks in advance.
                  Regard, Marco.

                  Attachments

                  • Mathias Mamsch
                    Mathias Mamsch
                    1762 Posts
                    ACCEPTED ANSWER

                    Re: RPE Lite export with DXL

                    ‏2013-11-06T11:03:12Z  in response to mcrv

                    Hi Marco,

                    wow it took me a while to find the problem ;-) At some point I noticed the original code was still working, while your code did not work. I was stumped until I compared the call from rpe_to_word.dxl (in the standard/export/RPE_light/rpe_to_word.dxl) with your code. Their code reads:

                     

                    ...
                    showRPEExportDialog(LS_("String_Export_To_Word", NLSTEMP_("Export to Word")(NLS_("Word")), (NLS_(".doc")))
                    ...

                    Your code reads:

                    ...
                    showRPEExportDialog(LS_("String_Export_To_Word", NLSTEMP_("Export to Word")), (NLS_("doc")), (NLS_(".doc")))
                    ...

                    Now find the difference, and you should be able to correct your problem. The problem is, that IBM did a very bad job of error handling - the RPE export just waits for the export file to appear, so if anything goes wrong the Export Dialog will wait forever.

                    Regards, Mathias

                     

                    • mcrv
                      mcrv
                      4 Posts
                      ACCEPTED ANSWER

                      Re: RPE Lite export with DXL

                      ‏2013-11-06T13:26:01Z  in response to Mathias Mamsch

                      Ooops!.... a small correction for a great improve. It works!... Thanks a lot.

                      I'm also trying to run the script automatically at the DOORS start-up, using the command line switch -D "#include <....dxl>", where the pointed dxl open the module to export and execute the same operation of the cmd_RPE_lite. Unfortunally it does not run, and many warning are arisen at the include line:

                      #include <standard/export/RPE_Light/DoorsExport.inc>

                      Why?

                      Regards, Marco.

                      • Mathias Mamsch
                        Mathias Mamsch
                        1762 Posts
                        ACCEPTED ANSWER

                        Re: RPE Lite export with DXL

                        ‏2013-11-06T13:43:09Z  in response to mcrv

                        Can't say - You need to post some of the warnings. The most obvious reason is, that you need to have a current module, but you probably thought of that? Regards, Mathias

                        • mcrv
                          mcrv
                          4 Posts
                          ACCEPTED ANSWER

                          Re: RPE Lite export with DXL

                          ‏2013-11-11T15:39:59Z  in response to Mathias Mamsch

                          Mathias,

                          As your suggestion, I check my code in order to assure that the module is opened (I add to my DXL a 'flush ' instruction to avoid an unexpected stack underflow error...). Now, if I halt the DXL before the include statement of <DoorsExport.inc> and comment the rest of the code, no error is arisen :-), and I see my module opened, in read only.

                          On the contrary, the execution of the entire DXL is suspended for too many errors, the log is in the attachment. Many of these errors regard with entities already declared into DoorsExport.inc... but why only executing DOORS externally (-D switch)? They do no occur running from the DOORS main window.

                          Again, thanks in anvance.

                          Regards, Marco.

                          Attachments

                          • Mathias Mamsch
                            Mathias Mamsch
                            1762 Posts
                            ACCEPTED ANSWER

                            Re: RPE Lite export with DXL

                            ‏2013-11-11T16:08:24Z  in response to mcrv

                            From the log it seems, that you somehow include the necessary files for the export twice - that is why you are getting messages like:

                            -E- DXL: <standard/export/RPE_Light/DoorsExport.inc:37> (format) already declared in this scope

                            Please post the full commandline that you use to start DOORS and the content of the DXL script that is invoked (if it is not one of the build in ones).

                            Regards, Mathias

                            • mcrv
                              mcrv
                              4 Posts
                              ACCEPTED ANSWER

                              Re: RPE Lite export with DXL

                              ‏2013-11-14T08:48:55Z  in response to Mathias Mamsch

                              Hi Mathias,

                              I post in the attachments the called DXL and the batch DOS that invokes it. Within it the critical points have been marked as "// ****".

                              I'm sure that the scripts can be improved both: I apologize for that, but it's a starting point... I need something that works even if it's not in so good programming style!

                              Wow! It's great to see that someone else is interested on this approach to do more publishs on one shot! Maybe this batch DOS could be used... adding a loop on data retrieve from data.log... taking into account to solve this noisly errors on duplicated vars, of course!

                              Sure of your and community's good suggestions.

                              Many thanks to you/everybody, in advance.

                              Regards, Marco.

                              • dieli
                                dieli
                                3 Posts
                                ACCEPTED ANSWER

                                Re: RPE Lite export with DXL

                                ‏2013-11-14T16:31:09Z  in response to mcrv

                                I'm trying to do something similiar. I have a list of modules which i want to export as pdf with a predefined view. So far I have gotten is to iterate through the list (without export). As soon as i use the RPE my loop stops after one iteration. The export works fine though. I have attached my script. Maybe someone knows how to fix this.

                                 

                                Attachments

                                • Mathias Mamsch
                                  Mathias Mamsch
                                  1762 Posts
                                  ACCEPTED ANSWER

                                  Re: RPE Lite export with DXL

                                  ‏2013-11-15T10:01:38Z  in response to dieli

                                  Well I guess your problem is pretty obvious ... the oldshow tmpDB command will issue a "show()" halting your DXL script. You will have to use the eval_ version of the script to be able to iterate over multiple versions. Regards, Mathias

                      • BillTidy
                        BillTidy
                        25 Posts
                        ACCEPTED ANSWER

                        Re: RPE Lite export with DXL

                        ‏2013-11-11T09:38:40Z  in response to mcrv

                        Please also note that the dialog has changed in DOORS 9.5, so you may need to update the script.

  • dieli
    dieli
    3 Posts
    ACCEPTED ANSWER

    Re: RPE Lite export with DXL

    ‏2013-11-12T15:41:01Z  in response to StephenValliere

    From the code above I have created a script which runs the RPE export on a given set of modules, but I could not find a way to change the Template the export uses. Can anyone give me a hint? I suppose its something like set(exportTemplate, myTemplateFile). I'm using DOORS 9.5.

    showRPEExportDialog(LS_("String_Export_To_PDF", NLSTEMP_("Export to PDF")), (NLS_("pdf")), (NLS_(".pdf")))
    // add a timer to it, it will 'press' the button now after we do show ... 
    void newcb(DBE x){
    print "Calling timercallback ...\n";
    stopTimer tm;
    exportCB(null)
    }
    tm = timer(tmpDB, 0.2, newcb,"")
     
    // realize the dialog box, so we can apply the settings ....
    realize tmpDB;
    set(exportFileName, sFileName)
    //set(exportTemplateName, sTemplateName)
    //set(styleChoice, 0) // styleChoice gives an error
     
    // show the dialog, timer will kick in and press our button
    print "About to enter message loop ...\n";
    oldshow tmpDB
     
    Updated on 2013-11-12T15:41:45Z at 2013-11-12T15:41:45Z by dieli
    • StephenValliere
      StephenValliere
      30 Posts
      ACCEPTED ANSWER

      Re: RPE Lite export with DXL

      ‏2013-11-12T15:50:01Z  in response to dieli

      The command you are looking for is:

      set(templateName,"test")

      • dieli
        dieli
        3 Posts
        ACCEPTED ANSWER

        Re: RPE Lite export with DXL

        ‏2013-11-13T08:58:03Z  in response to StephenValliere

        Hi Stephen,

        I've tried the command you suggested, but I get the following error:

        -E- DXL: <Line:106> incorrect arguments for function (set)
        -I- DXL: All done. Errors reported: 1. Warnings reported: 0.
        I have called the command like this (and variations of sTemplateName):
        string sTemplateName = "C:\\Program Files\\Telelogic\\Doors9_5\\lib\\dxl\\standard\\export\\RPE_light\\source\\DOORS\\examples\\doorsView.dta"
        set(templateName,sTemplateName)

        Any ideas what is wrong?

        EDIT: I found the correct command is "set(templateFile, sTemplateName)

        Updated on 2013-11-14T14:04:34Z at 2013-11-14T14:04:34Z by dieli