Example of Export XML
import com.change_vision.jude.api.inf.AstahAPI; import com.change_vision.jude.api.inf.project.ProjectAccessor; public class Test { public static void main(String[] args) { try { ProjectAccessor prjAccessor = AstahAPI.getAstahAPI().getProjectAccessor(); prjAccessor.open("C:\\API\\pro305.asta"); prjAccessor.exportXMI("C:\\API\\pro305_xmi.xml"); prjAccessor.close(); } catch (Exception e) { e.printStackTrace(); } } } |
Example of XML Import and saving it as Project with name
import com.change_vision.jude.api.inf.AstahAPI; import com.change_vision.jude.api.inf.project.ProjectAccessor; public class Test { public static void main(String[] args) { try { ProjectAccessor prjAccessor = AstahAPI.getAstahAPI().getProjectAccessor(); prjAccessor.importXMI("C:\\API\\pro305_xmi.xml"); prjAccessor.saveAs("C:\\API\\pro305_2.asta"); prjAccessor.close(); } catch (Exception e) { e.printStackTrace(); } } } |
Example: Export astah* project file to XML - Modify the XML - Import XML - Save as astah* project file
import com.change_vision.jude.api.inf.AstahAPI; import com.change_vision.jude.api.inf.project.ProjectAccessor; public class Test { public static void main(String[] args) { try { ProjectAccessor prjAccessor = AstahAPI.getAstahAPI().getProjectAccessor(); prjAccessor.open("C:\\API\\pro305.asta"); prjAccessor.exportXMI("C:\\API\\pro305_xmi.xml"); prjAccessor.close(); // Edit prjAccessor.importXMI("C:\\API\\pro305_xmi.xml"); prjAccessor.saveAs("C:\\API\\pro305_2.asta"); prjAccessor.close(); } catch (Exception e) { e.printStackTrace(); } } } |