Inaccessible Instances

5 views
Skip to first unread message

Jörn Guy

unread,
Nov 1, 2007, 8:03:34 PM11/1/07
to Tefkat
I have a problem with rule matching. I have an MM structured into
recursive packages. The source is a resource that is strictly
contained (Everything in one root element, stored in one xmi file). I
find that I am able to match elements defined in the package that
contains the root element, but in none of the other packages using a
FORALL statement. I am uncertain wether this is by design or a bug.
DesignTime is in the root package, Component is defined in a
referenced package.

Below is the transform, dump and model.

TRANSFORMATION test2code : src -> tgt

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


RULE nowYouSeeMe
FORALL DesignTime d
MAKE println(d, d.components.name,d.components.eClass());

RULE nowYouDont
FORALL Component c
MAKE println(c.name);


INFO: Loaded (11681394) platform:/resource/
au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/transformations/
inaccessibleObjects.qvt
INFO: Loaded (3538808) platform:/resource/
au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/instances/
My.modelmanagement
INFO: Transformation started: test2code
INFO: Constructing stratification...
INFO: ... 1 levels.
INFO: Stratum 0 : nowYouSeeMe, nowYouDont
INFO: Evaluating nowYouSeeMe
INFO: Evaluating nowYouDont
INFO: []
INFO: [nowYouSeeMe::d/
Desig...@tefkat.model.impl.ReferenceExtentImpl@905eb5 (resources:
[org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl@35ff78 uri='platform:/
resource/au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/instances/
My.modelmanagement'])] [Basic Calculations]
[org.eclipse.emf.ecore.impl.EClassImpl@ce88d2 (name: Component)
(instanceClassName: null) (abstract: false, interface: false)]
INFO: TRule: nowYouDont completed.
INFO: TRule: nowYouSeeMe completed.
INFO: Transformation finished
INFO: ResourceSet event 8: null

<?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"/>
</designTime>
</au.edu.uq.itee.mdavv.wrsa.foxbus.modelManagement:Repository>

If this behavior is by design this makes writing transformations very
hard, as you have to write recursive traversal just as you do in Java.
All the nice declarative ease of use immediately goes away. It would
also make debugging very much harder, as you constantly have to watch
you back if you are crossing a package boundary.

michael lawley

unread,
Nov 1, 2007, 8:26:20 PM11/1/07
to Tef...@googlegroups.com
The problem is that the Components is in
http:///au/edu/uq/itee/mdavv/wrsa/foxbus/designtime/components.ecore,
not http:///au/edu/uq/itee/mdavv/wrsa/foxbus/designtime.ecore -- it's
in a nested package.

The fully-qualified name will work.

RULE nowYouDont
FORALL ::designtime::components::Component c
MAKE println(c.name);


michael

Jörn Guy

unread,
Nov 1, 2007, 9:17:45 PM11/1/07
to Tefkat
Does not fix it (See below). However, the parser detects the ambiguity
when I include the other namespace, saying that 'Component' matches in
both spaces.

TRANSFORMATION inaccessible: src -> tgt

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

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


RULE stillDontSeeIt


FORALL ::designtime::components::Component c
MAKE println(c.name);


INFO: Loaded (25058902) http:///au/edu/uq/itee/mdavv/wrsa/foxbus/designtime.ecore
INFO: Loaded (9545769) platform:/resource/
au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/transformations/
inaccessibleObjects.qvt
INFO: Loaded (18353341) platform:/resource/


au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/instances/
My.modelmanagement
INFO: Transformation started: test2code
INFO: Constructing stratification...
INFO: ... 1 levels.

INFO: Stratum 0 : nowYouDont
INFO: Evaluating nowYouDont
INFO: []
INFO: TRule: nowYouDont completed.


INFO: Transformation finished
INFO: ResourceSet event 8: null


On Nov 2, 10:26 am, "michael lawley" <mich...@lawley.id.au> wrote:
> The problem is that the Components is in
> http:///au/edu/uq/itee/mdavv/wrsa/foxbus/designtime/components.ecore,
> not http:///au/edu/uq/itee/mdavv/wrsa/foxbus/designtime.ecore -- it's
> in a nested package.
>
> The fully-qualified name will work.
>
> RULE nowYouDont
> FORALL ::designtime::components::Component c
> MAKE println(c.name);
>
> michael
>

> > DesignT...@tefkat.model.impl.ReferenceExtentImpl@905eb5 (resources:


> > [org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl@35ff78 uri='platform:/
> > resource/au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/instances/
> > My.modelmanagement'])] [Basic Calculations]
> > [org.eclipse.emf.ecore.impl.EClassImpl@ce88d2 (name: Component)
> > (instanceClassName: null) (abstract: false, interface: false)]
> > INFO: TRule: nowYouDont completed.
> > INFO: TRule: nowYouSeeMe completed.
> > INFO: Transformation finished
> > INFO: ResourceSet event 8: null
>
> > <?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"/>
> > </designTime>
> > </au.edu.uq.itee.mdavv.wrsa.foxbus.modelManagement:Repository>
>
> > If this behavior is by design this makes writing transformations very
> > hard, as you have to write recursive traversal just as you do in Java.
> > All the nice declarative ease of use immediately goes away. It would
> > also make debugging very much harder, as you constantly have to watch

> > you back if you are crossing a package boundary.- Hide quoted text -
>
> - Show quoted text -

Jörn Guy

unread,
Nov 1, 2007, 9:25:39 PM11/1/07
to Tefkat
Even stranger, the rule below works!

TRANSFORMATION test2code : src -> tgt

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


RULE butNowIdo


FORALL Component c
MAKE println(c.name);


INFO: Loaded (19509258) platform:/resource/
au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/transformations/
inaccessibleObjects.qvt
INFO: Loaded (20383660) platform:/resource/


au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/instances/
My.modelmanagement
INFO: Transformation started: test2code
INFO: Constructing stratification...
INFO: ... 1 levels.
INFO: Stratum 0 : nowYouDont
INFO: Evaluating nowYouDont

INFO: [Basic Calculations]


INFO: TRule: nowYouDont completed.
INFO: Transformation finished
INFO: ResourceSet event 8: null

> > - Show quoted text -- Hide quoted text -

Jörn Guy

unread,
Nov 1, 2007, 9:31:09 PM11/1/07
to Tefkat
TRANSFORMATION test2code : src -> tgt

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


RULE cannotResolveType
>>> FORALL ::modelManagement::designtime::components::Component
c
MAKE println(c.name);

This one does not parse.

And this one does not find anything:

TRANSFORMATION test2code : src -> tgt

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


RULE cantSeeFromHere


FORALL ::designtime::components::Component c
MAKE println(c.name);

INFO: Loaded (16019520) http:///au/edu/uq/itee/mdavv/wrsa/foxbus/designtime.ecore
INFO: Loaded (8334151) platform:/resource/
au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/transformations/
inaccessibleObjects.qvt
INFO: Loaded (12677894) platform:/resource/


au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/instances/
My.modelmanagement
INFO: Transformation started: test2code
INFO: Constructing stratification...
INFO: ... 1 levels.

INFO: Stratum 0 : cantSeeFromHere
INFO: Evaluating cantSeeFromHere
INFO: []
INFO: TRule: cantSeeFromHere completed.


INFO: Transformation finished
INFO: ResourceSet event 8: null

michael lawley

unread,
Nov 5, 2007, 7:30:23 AM11/5/07
to Tef...@googlegroups.com
Hi I've committed changes to fix this problem and they'll be in the
next build, lawley246, as soon as I can access the site to upload the
files.

Other bonus features of the new build include major improvements to
error reporting from the parser.

michael

Reply all
Reply to author
Forward
0 new messages