2

I wanna get data from DOORS with Java. I found out that I can run DOORS using Jacob but it doesn't work. Can anyone please guide me to the solution even without using Jacob? I appreciate if someone can give me some specific code.

My code :

import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.*;

String dxlFile = "" + appDir + "\\dxl\\transferTraceInfoToDOORS.dxl";
try {
      //Try and get the active instance of doors first
      ComThread.InitMTA();
     //ActiveXComponent runningDoors = new ActiveXComponent("DOORS.Application");

    ActiveXComponent runningDoors = 
                   ActiveXComponent.connectToActiveInstance("DOORS.Application");
   if( runningDoors ==null) {
       JOptionPane.showMessageDialog(null,
             "This application needs an active running instance of DOORS to work,
             please fire DOORS up and try again");
       System.exit(0);
   } else {
       runningDoors.invoke("RunStr", "print(\"Testing\");
       oleSetResult(\"Finished\")");
       //runningDoors.invoke("RunFile", dxlFile);
                System.out.println(runningDoors.getPropertyAsString("Result"));
   }
} catch (Exception e) {
    e.printStackTrace();
}  finally {
    ComThread.Release();
}

This code works well when I use "Excel.Application", but with DOORS it doesn't detect the active instance So I got this message: "This application needs an active running instance of DOORS to work, please fire DOORS up and try again". Please help me. I couldn't found a solution.

Thank you.

Sana.Mejri
  • 21
  • 2
  • Are you sure that the path of dxlFile is correct and does exists? Does an exception raise? – Reporter Jul 20 '17 at 09:20
  • the problem that it doesn't detect the active instance of DOORS running. So I got this message: "This application needs an active running instance of DOORS to work, please fire DOORS up and try again" . – Sana.Mejri Jul 20 '17 at 09:35

1 Answers1

0

a general remark about Java and DXL can be found at https://www.ibm.com/developerworks/community/forums/html/topic?id=269a1e10-da03-4df4-9eaa-1415e30329cb

And: There is a problem in the installer of several DOORS versions, DOORS fails to register correctly as a COM server during installation. See https://www.ibm.com/developerworks/community/forums/html/topic?id=c5154866-d0ec-4900-906d-a4c532fc11a4 for details and suggestions

Mike
  • 2,098
  • 1
  • 11
  • 18