Access to model elements in referenced EPackages?

已查看 1 次
跳至第一个未读帖子

Jörn Guy

未读,
2007年10月30日 20:22:182007/10/30
收件人 Tefkat
I am trying to list the contents of a model instance, as a start. The
instance loads in an editor plugged intor the design-time-workbench,
so the metamodels are all registered. Tefkat loads the content, but
does produce any out put. I have produced a minimal test case below.

The only thing that is different from the standard examples is that I
have my metamodel broken into several packages. The instance is
contained in a single container, however. Does this affect Tefkats
ability to match elements? Are the elements lazy-loaded and hence do
not show up when Tefkat enumerates candidate elements in the extent?

TRANSFORMATION test2code : bla -> blub

NAMESPACE http:///au/edu/uq/itee/mdavv/wrsa/foxbus/modelManagement.ecore
NAMESPACE http:///au/edu/uq/itee/mdavv/wrsa/foxbus/code.ecore
NAMESPACE http:///au/edu/uq/itee/mdavv/wrsa/foxbus/designtime/components.ecore

RULE list
FORALL Repository r, Component c, DesignTime d
MAKE println(r, c.name, d.name)
;

<?xml version="1.0" encoding="UTF-8"?>
<au.edu.uq.itee.mdavv.wrsa.foxbus.modelManagement:Repository
xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:au.edu.uq.itee.mdavv.wrsa.foxbus.modelManagement="http:///au/edu/
uq/itee/mdavv/wrsa/foxbus/modelManagement.ecore">
<designTime>
<components name="Basic Calculations">
<configurator name="standard"/>
</components>
</designTime>
</au.edu.uq.itee.mdavv.wrsa.foxbus.modelManagement:Repository>


INFO: Loaded (32633691) platform:/resource/
au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/transformations/
test2code.qvt
INFO: Loaded (10966007) platform:/resource/
au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/instances/
Minimal.modelmanagement
INFO: Transformation started: test2code
INFO: Constructing stratification...
INFO: ... 1 levels.
INFO: Stratum 0 : list
INFO: Evaluating list
INFO: [list::r/Repository@platform:/resource/
au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/instances/My.code] [] []
INFO: TRule: list completed.
INFO: Transformation finished
INFO: ResourceSet event 8: null

michael lawley

未读,
2007年10月31日 00:19:392007/10/31
收件人 Tef...@googlegroups.com
Hi Jörn,

Your rule is producing output here:

INFO: [list::r/Repository@platform:/resource/au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/instances/My.code]
[] []

Which indicates that the rule is finding a single Repository instance
but no Component or DesignTime instances (with names). This looks
possibly correct to me since, from my reading of the XMI below, the
instance with name="Basic Calculations" is of the class "Component" in
the http:///au/edu/uq/itee/mdavv/wrsa/foxbus/modelManagement.ecore
namespace but the transformation is probably resolving Component to a
class from here
http:///au/edu/uq/itee/mdavv/wrsa/foxbus/designtime/components.ecore?
However, I'm just guessing at causes here (I don't parse XMI :-) What
happens if you try to match the objects in separate rules?

michael

回复全部
回复作者
转发
0 个新帖子