saveModel deletes the model [message #1140820] |
Wed, 16 October 2013 12:33  |
Eclipse User |
|
|
|
Hello everybody,
This is what I have:
packages -> metaModel
inModel -> input model
outModels -> output models
URI -> output URI (i have more than 1 output so I modify the URI while iterating)
here I save the input in the output URI (after I modify the input with other methods)
ModelManager.saveModel(this.inModel, URI);
here I save the modified input into de outputs array.
this.outModels.add(ModelManager.loadModel(packages, URI));
//Then I load the original input again
this.inModel = ModelManager.loadModel(packages, this.inModel.getURI().toString());
The thing is that after I execute the first ModelManager.saveModel(this.inModel, URI); the model's containment is deleted. While debugging (after that call) the model does not have the containment (the root).
What can I do to not loose the model after saving?
Best regards!
Victor.
|
|
|
|
|
Re: saveModel deletes the model [message #1141642 is a reply to message #1140882] |
Thu, 17 October 2013 01:38  |
Eclipse User |
|
|
|
Victor,
Comments below.
On 16/10/2013 7:28 PM, Victor Lopez wrote:
> Thanks for the answer. ModelManager is mine, but it just encapsulated
> there. What I do is how to save models in EMF.
> I will explain more:
>
> What i want to do is from an input Model, generate N output Models
> from a list of modification that I do in the input one.
But it sounds as if you didn't actually do that. It sounds more like
some what you describe as input you also consider to be output, so you
put it in a resource, thereby removing it from where ever it was before.
> I see that it does not work as I implemented it but it must be some way.
> How can I generate N models from an input without loosing the input?
As I said, it doesn't sound like that's what your doing. If your
inputs are also considered outputs you must consider whether you want a
copy of the input saved somewhere else or whether you should be
referring to the original object in its original location without moving
it, i.e., not consider it an output.
>
> If someone comes to the idea please share it.
>
> Best regards,
>
> Víctor.
|
|
|
Powered by
FUDForum. Page generated in 0.04607 seconds