In my code I'm trying to convert a file MDL to file XML using simex as a tool. Then I will use this xml file for some analysis. When I convert this file manually or if i treat a small model (via Process....) ,no error has been occured.
The problem is when I try to convert a big model via Process using this code :
if(!(xmlFile.exists()))
{Process child;
child = Runtime.getRuntime().exec("cmd.exe /C start /min "+System.getProperty("user.dir")+"\\simex\\MDLtoXML.bat "+path+" "+xmlpath+" " +System.getProperty("user.dir")+"\\simex\\",null,null);
try {
child.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
This code work good with a small model ,so I think the problem that's my project analyse the xml file before the end of transformation because the error is : Exception in thread "main" org.jdom2.input.JDOMParseExeception:Error on line of document file (......XML):Fin prématurée du fichier............
So I want to know how can wait the end of the transformation then execute the second part of the analyse of xml File.
Nb: I have also tried to put
child.getInputStream().close();
child.getOutputStream().close();
before child.waitFor();
Somaya.