General (#1) - QVT Transformation with Java doesn't find any matches (#22) - Message List

QVT Transformation with Java doesn't find any matches

Hi ! I wrote a QVT transformation and it worked perfectly with the help of the Medini QVT runconfiguration. I now want to directly use the QVTEngine, as in the example (UsingMediniQVTfromApplications), but then the transformation doesn't find any matches in the source model for the top relation, so nothing happens ("Relation 'AssertUsageModel' initially has 0 tuple(s) to evaluate")...As I wrote, the exact same transformation with the exact same models works fine when using a runconfig.

I attempted to determine the cause, but the only thing I found, is that it won't find any match because the condition "instanceTyp.isInstance(content)" in EmfEvaluationAdapter.internalAllInstances is always false, i.e. there is no instanceClass for the object content. I then tried to find out where the difference with the runconfig were and found out that the loaded models (OclProcessorImpl.setModels) contain objects of type DynamicEObjectImpl while using the runconfig whereas they contain self defined object types (xxxImpl) while trying to use directly the engine. But the example does the exact same thing and loaded models also contain self defined types, so I don't think there is a problem there.

I can't figure out where my problem is...has anybody an idea ?

  • Message #53


    I suggest to open a ticket for your problem, where you please attach your metamodel, model, a snapshot of your run configuration and the your changes code of !UsingMediniQVTfromApplications.

    Your found difference between running in the application mode and running from Java is clear: In the application, your metamodel is not registered via the EMF extension points. Thus, in the mediniQVT application every model is loaded reflective (you see instances of !DynamicEObjectImpl in the debugger). In the Java version, your generated Model Code registers the metamodel and so real instances are created using the xxxImpl Java classes.


    • Message #77


      I thought I'd share my experience regarding this issue here. I had the same problem, which I solved simply by changing the order of the input models. The example application describes this issue, but I overlooked the comment:

      142' The models must be added in the same order as defined in your transformation!
      143' Collection<Collection<Resource>> modelResources = new ArrayList<Collection<Resource>>();

      Is this perhaps something that can be changed? Seeing that it's such an important step, the QVT engine probably shouldn't make assumptions about the order in which the models appear...


      • Message #90

        Thanks for helping. I had some other things to do so I didn't try to fix it for a while. I tried to invert the order models are registered as you said, but it didn't change anything (the models where already in the right order). I also changed the order metamodels where registered, but as I expected, it also didn't work. I will try to debug as suggested in Ticket #13 in the coming days.

      • Message #78

        Somewhere you have to specify which model is associated with which domain. And this is expressed by the order in this model list, which corresponds to the domain list in the first line of your QVT transformation.


No attachments created.