On 17 févr. 09, at 19:16, Tudor Girba wrote:
Hmm, this is a correct piece of code. I just evaluated
it on an
exported LAN model and it does what expected. I have a MooseModel
that has one entity that is another MooseModel with all the entities
inside.
Perhaps misleading is that in the result variable you will get the
model that you load, and then you add this to yet another model.
OK right, I overlooked that. The interesting model is indeed nested
into another model. Well at first I did without nesting but it didnt
work, probably because I forgot something else like
#resolveDanglingReferences
No problem now, thanks
This works well, when the parent model is the MooseModel root
because like this you see it in the browser, but otherwise you
should not need to add the result in another model.
Cheers,
Doru
On 17 Feb 2009, at 17:01, Simon Denier wrote:
Hi
I'm trying to load a mse file into VW Moose without using the GUI.
Below is my best shot right now: it doesnt fail but the created
model is empty. I guess that "MooseImporter withActiveMetamodel" is
too optimistic.
Anyway, before I dive once again into the peculiarities of VW, what
is the straightforward way to do that? I couldnt find the right API
in Moose.
model := MooseModel new name: (fileName asFilename tail
removeSuffix: '.mse').
self halt.
loader := MooseImporter withActiveMetamodel.
loader stream: fileName asFilename readStream.
result := loader asTask run.
loader resolveDanglingReferences.
model addEntity: result
--
Simon
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"Problem solving should be concentrated on describing
the problem in a way that is relevant for the solution."
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
Simon