Importing SysML Programatically [message #1420309] |
Tue, 09 September 2014 20:38 |
Andrew Gacek Messages: 32 Registered: October 2011 |
Member |
|
|
I'm trying to use Papyrus to import a SysML file so that I can analyze / manipulate it using some Java code. That is, I want to go from a SysML file (exported in XMI format) to an EMF object. Here's the code I was using:
ResourceSetImpl set = new ResourceSetImpl();
URI uri = URI.createFileURI("c:/import.xml");
Resource res = set.getResource(uri, true);
System.out.println(res.getContents().get(0));
This fails with
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.omg.org/spec/XMI/20110701' not found. (file:/c:/desktop/import.sysml, 3, 76)
My SysML mode is exported from Enterprise Architect and starts with
<?xml version="1.0" encoding="windows-1252"?>
<xmi:XMI xmlns:uml="http://www.omg.org/spec/UML/20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:thecustomprofile="http://www.sparxsystems.com/profiles/thecustomprofile/1.0" xmlns:AADL_Elements="http://www.sparxsystems.com/profiles/AADL_Elements/0.1" xmlns:SysML="http://www.omg.org/spec/SysML/20120322/SysML">
<xmi:Documentation exporter="Enterprise Architect" exporterVersion="6.5"/>
<uml:Model xmi:type="uml:Model" name="EA_Model">
Is this the type of thing that Papyrus can be used for (as a plug-in developer)? How do I address this error?
Thanks,
Andrew
[Updated on: Tue, 09 September 2014 20:38] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02724 seconds