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()) ;
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
On 10/31/07, Jörn Guy <jgsu...@itee.uq.edu.au> wrote:
> 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.
> 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
> On 10/31/07, J?rn Guy <jgsu...@itee.uq.edu.au> wrote:
> > 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.
> 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
> > On 10/31/07, J?rn Guy <jgsu...@itee.uq.edu.au> wrote:
> > > 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.
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:
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.
On Nov 1, 1:43 pm, "michael lawley" <mich...@lawley.id.au> wrote:
> 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:
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
On 11/1/07, Jörn Guy <jgsu...@itee.uq.edu.au> wrote:
> 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.
> On Nov 1, 1:43 pm, "michael lawley" <mich...@lawley.id.au> wrote: > > 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: