|Loading oclxmi files [message #1749445]
||Tue, 06 December 2016 19:41
| Edoaurd Batot
Registered: March 2015
I'm currently working on a generic piece of software dealing with OCL abstract trees (ASTs). Generic means that models, metamodels, OCL files etc. are provided as input, they cannot be loaded, registered or what so ever by any clic. I don't use GUI nor any Eclipse plugin dependancy (standalone fever).|
Context : I load a metamodel (which is registered properly) and models on the fly without problems. To do so, I use the EMF and EMF-OCL librari(es). I manipulate OCL constraints (their AST) programmatically.
My problem is this one : how to load a set of constraints from a XMI for OCL file (usual extension is .oclxmi) ? I do load ocl (.ocl) files, no problem, but XMI ocl, I can't. (And, of course, the constraints I intend to use are encoded in XMI...)
When I try to do the lines from the tutos,
Resource res = Metamodel.resourceSet.getResource(
URI.createPlatformResourceURI(f1.getAbsolutePath(), true), true );
A Runtime exception is thrown : The resource cannot be created because "a registered resource factory is needed". Needless to say the this resourceSet (provided by the Metamodel class) is used to instanciate the conforming models. Am I wrong when I try to use the same resource set ?
Any hint of hope will be appreciated.
Thank you very much for your attention.
PS : it is all made programmatically, with basic Java.
(PPS : note that links in the manual (From the OCL Examples page) are not working :
(they are easily found via search engines) )
[Updated on: Tue, 06 December 2016 19:56]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01667 seconds