Loading and running a egl on a custom profile in java (standalone) [message #989106] |
Tue, 04 December 2012 15:46 |
Chrisy Pel Messages: 2 Registered: December 2012 |
Junior Member |
|
|
Hi All,
I am trying to create a standalone that uses egl on a uml model which has a custom profile applied.
Am I able to do this successful when I run a EGLTemplate through run configuration.
But when I try to replicate this programmatically, using only the UML metamodel as a parameter to the function that creates the EmfModel, I get the PackageNotFoundException for a package with URI:...
I initially had this same issue when doing it with the EGL Template through the run configuration method, but that got resolved when I manually removed the extra metamodels entries automatically loaded from the model file in the run configuration, leaving just that for UML, applying the changes before running the configuration.
I believe that is the difference between the 2 approaches.
My question is, is it possible to programmatically load a model, without it trying to expand and resolve the whole tree as the package it cannot find, though is inside the model file, does not necessarily need to be loaded in my current case.
or at least is it possible to remove some of the metamodels its loads from the model file as I manually did through the run configurations before the EmfModel object is actually returned.
|
|
|
|
Re: Loading and running a egl on a custom profile in java (standalone) [message #990917 is a reply to message #989213] |
Fri, 14 December 2012 21:08 |
Chrisy Pel Messages: 2 Registered: December 2012 |
Junior Member |
|
|
The code am using is pretty mmuch the same from the standalone egl example.
models.add(createEmfModelByURI("Model-Tester", "Tester.uml", UMLPackage.eNS_URI, true, true));
I correctly register the UML package instance in the package registry before calling the code.
the code above calls the following code in the parent class
protected EmfModel createEmfModelByURI(String name, String model, String metamodel, boolean readOnLoad, boolean storeOnDisposal) throws EolModelLoadingException, URISyntaxException {
StringProperties properties = new StringProperties();
properties.put(EmfModel.PROPERTY_NAME, name);
properties.put(EmfModel.PROPERTY_METAMODEL_URI, metamodel);
properties.put(EmfModel.PROPERTY_MODEL_URI, "file:/" + getFile(model).getAbsolutePath());
properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "false");
properties.put(EmfModel.PROPERTY_READONLOAD, readOnLoad + "");
properties.put(EmfModel.PROPERTY_STOREONDISPOSAL, storeOnDisposal + "");
emfModel.load(properties, null);
return modelG;
}
I hope this can help in making my question more clearer.
thanks for the help.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04334 seconds