Blocker: Tefkat does not find any model content

4 views
Skip to first unread message

Jörn Guy

unread,
Oct 30, 2007, 11:50:05 PM10/30/07
to Tefkat
The following transformation I have written as a debugging test case.
It should match all elements in a model and print their metaclasses as
a side-effect. For the model below it does not find anything, but the
model does definetely contain model elements in the root. It also
loads the resource, as I get an exception to that effect, if the file
is moved or removed.

TRANSFORMATION list : src -> src

RULE listObjects
FORALL _ Src
WHERE println(Src.eClass().getName())
;


INFO: Loaded (10885246) platform:/resource/
au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/transformations/list.qvt
INFO: Loaded (7197832) platform:/resource/
au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/instances/
Minimal.modelmanagement
INFO: Transformation started: list
INFO: Constructing stratification...
INFO: ... 1 levels.
INFO: Stratum 0 : listObjects
INFO: Evaluating listObjects
INFO: []
INFO: TRule: listObjects 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>

michael lawley

unread,
Oct 31, 2007, 12:00:23 AM10/31/07
to Tef...@googlegroups.com
Hi Jörn,

You've specified the same variable (src) for both input and output
extents. Thus Tefkat is loading your input model and binding the var
"src" to that extent, then creating the output extent and re-binding
the same var "src" to this new, empty, extent (Resource). Thus there
are no model elements found. If you change the first line to

TRANSFORMATION list : src -> tgt

then it should work as you expect.

michael

Jörn Guy

unread,
Oct 31, 2007, 12:10:34 AM10/31/07
to Tefkat
Nope. No change.

TRANSFORMATION list : src -> tgt

RULE listObjects


FORALL _ Src
WHERE println(Src.eClass().getName())
;

INFO: Loaded (1001124) platform:/resource/
au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/transformations/list.qvt
INFO: Loaded (2826541) platform:/resource/


au.edu.uq.itee.mdavv.wrsa.foxbus.test2code/instances/
Minimal.modelmanagement
INFO: Transformation started: list
INFO: Constructing stratification...
INFO: ... 1 levels.
INFO: Stratum 0 : listObjects
INFO: Evaluating listObjects
INFO: []
INFO: TRule: listObjects completed.
INFO: Transformation finished
INFO: ResourceSet event 8: null

On Oct 31, 2:00 pm, "michael lawley" <mich...@lawley.id.au> wrote:
> Hi J?rn,


>
> You've specified the same variable (src) for both input and output
> extents. Thus Tefkat is loading your input model and binding the var
> "src" to that extent, then creating the output extent and re-binding
> the same var "src" to this new, empty, extent (Resource). Thus there
> are no model elements found. If you change the first line to
>
> TRANSFORMATION list : src -> tgt
>
> then it should work as you expect.
>
> michael
>

> > </au.edu.uq.itee.mdavv.wrsa.foxbus.modelManagement:Repository>- Hide quoted text -
>
> - Show quoted text -

michael lawley

unread,
Oct 31, 2007, 2:14:56 AM10/31/07
to Tef...@googlegroups.com
Hmm, very strange. I have one project where this works and another
where it doesn't. Will look further.

michael

On 10/31/07, Jörn Guy <jgs...@itee.uq.edu.au> wrote:
>

michael lawley

unread,
Oct 31, 2007, 11:43:53 PM10/31/07
to Tef...@googlegroups.com
Hi Jörn,

Further digging has revealed that the src and tgt extent variables are
not being bound to the correct resources. You can check this with:

TRANSFORMATION testIt: src -> tgt

RULE navExtents
WHERE println("src", src) AND println("tgt", tgt)
;

A work-around for this until the next release is to explicitly set the
Var Group for the source and target models to be the same name as the
corresponding input variable:

michael

Jörn Guy

unread,
Nov 1, 2007, 3:52:13 AM11/1/07
to Tefkat
Could you include the setting you are making. I have only found one
other mention of the meaning of var group in the FAQ
http://tefkat.sourceforge.net/FAQ.html . I have run the testIt.qvt and
can confirm your analysis. My src binds to what I have defined as the
target.

michael lawley

unread,
Nov 1, 2007, 8:12:30 PM11/1/07
to Tef...@googlegroups.com
Var Groups are a very recent addition to Tefkat (i.e., they were added
for the current build).

After some further digging, the issue is related to the difference
between an unset String attribute, and a String attribute set to the
empty string (fixed in next release). If you're up to hand-editing
the tefkatconfig file, you can remove the varGroup="" bits and all
will work well.

Otherwise, the way Var Groups work is that the value specified is used
to identify the extent variable of the transformation to which the
resource should be bound. If there are multiple resources with the
same Var Group, then they are treated as a virtual compound resource
with the union of the individual contents.

michael

Reply all
Reply to author
Forward
0 new messages