does anybody know how to fix this problem caused by the bug described here https://bugs.eclipse.org/bugs/show_bug.cgi?id=322758
i have been trapped by this problem for several days~~ now i am waiting on line for somebody to help sincerely:-) could anyone be helpful here?? thanks a lot~

First thank you for your reply~~ while i do have some validity on the pim.ecore but not on the name there~~ does this affact the result?
will it be the version of the m2m or something like this? actually , i download gmf here with all the m2m included ..

The transformation code you provided is so simple that I would expect it
to work on any version... I tested it using a set of dummy models and it
works as expected, so the transformation code itself is OK.

I think it will be hard to find the cause for this without more
information. Can you find a strack trace somewhere with more details
about the exception?

On 22/07/11 10:15, Cindy wrote:
> First thank you for your reply~~ while i do have some validity on the
> pim.ecore but not on the name there~~ does this affact the result?
> will it be the version of the m2m or something like this? actually , i
> download gmf here with all the m2m included ..

hey the exception stack trace is as follows:
java.lang.IllegalArgumentException
at org.eclipse.ocl.ecore.EcoreEvaluationEnvironment.navigateProperty(EcoreEvaluationEnvironment.java:226)
at org.eclipse.m2m.internal.qvt.oml.ast.env.QvtOperationalEvaluationEnv.navigateProperty(QvtOperationalEvaluationEnv.java:198)
at org.eclipse.ocl.ecore.EcoreEvaluationEnvironment.navigateProperty(EcoreEvaluationEnvironment.java:1)
at org.eclipse.ocl.EvaluationVisitorImpl.visitPropertyCallExp(EvaluationVisitorImpl.java:1925)
at org.eclipse.ocl.EvaluationVisitorDecorator.visitPropertyCallExp(EvaluationVisitorDecorator.java:276)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitPropertyCallExp(QvtGenericEvaluationVisitor.java:271)
at org.eclipse.ocl.ecore.impl.PropertyCallExpImpl.accept(PropertyCallExpImpl.java:238)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitAssignExp(QvtOperationalEvaluationVisitorImpl.java:353)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitAssignExp(QvtGenericEvaluationVisitor.java:341)
at org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.impl.AssignExpImpl.accept(AssignExpImpl.java:404)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitObjectExp(QvtOperationalEvaluationVisitorImpl.java:948)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitObjectExp(QvtGenericEvaluationVisitor.java:406)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.ObjectExpImpl.accept(ObjectExpImpl.java:176)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitOperationBody(QvtOperationalEvaluationVisitorImpl.java:983)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitMappingBody(QvtOperationalEvaluationVisitorImpl.java:569)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitMappingBody(QvtGenericEvaluationVisitor.java:376)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingBodyImpl.accept(MappingBodyImpl.java:122)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitMappingOperation(QvtOperationalEvaluationVisitorImpl.java:732)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitMappingOperation(QvtGenericEvaluationVisitor.java:386)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingOperationImpl.accept(MappingOperationImpl.java:220)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.executeImperativeOperation(QvtOperationalEvaluationVisitorImpl.java:1613)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.doVisitOperationCallExp(QvtOperationalEvaluationVisitorImpl.java:638)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitOperationCallExp(QvtOperationalEvaluationVisitorImpl.java:597)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitMappingCallExp(QvtOperationalEvaluationVisitorImpl.java:587)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitMappingCallExp(QvtGenericEvaluationVisitor.java:381)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.MappingCallExpImpl.accept(MappingCallExpImpl.java:112)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitExpression(QvtOperationalEvaluationVisitorImpl.java:328)
at org.eclipse.ocl.EvaluationVisitorDecorator.visitExpression(EvaluationVisitorDecorator.java:156)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitExpression(QvtGenericEvaluationVisitor.java:205)
at org.eclipse.m2m.internal.qvt.oml.evaluator.iterators.QvtImperativeIteratorTemplate.evaluateResultTemplate(QvtImperativeIteratorTemplate.java:50)
at org.eclipse.m2m.internal.qvt.oml.evaluator.iterators.QvtIterationTemplate.evaluate(QvtIterationTemplate.java:84)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitImperativeIterateExp(QvtOperationalEvaluationVisitorImpl.java:1338)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitImperativeIterateExp(QvtGenericEvaluationVisitor.java:475)
at org.eclipse.m2m.qvt.oml.ecore.ImperativeOCL.impl.ImperativeIterateExpImpl.accept(ImperativeIterateExpImpl.java:210)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitOperationBody(QvtOperationalEvaluationVisitorImpl.java:983)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitEntryOperation(QvtOperationalEvaluationVisitorImpl.java:458)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitEntryOperation(QvtGenericEvaluationVisitor.java:485)
at org.eclipse.m2m.internal.qvt.oml.expressions.impl.EntryOperationImpl.accept(EntryOperationImpl.java:67)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.executeImperativeOperation(QvtOperationalEvaluationVisitorImpl.java:1613)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.runMainEntry(QvtOperationalEvaluationVisitorImpl.java:2126)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl$1.invoke(QvtOperationalEvaluationVisitorImpl.java:922)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.doVisitTransformation(QvtOperationalEvaluationVisitorImpl.java:896)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.execute(QvtOperationalEvaluationVisitorImpl.java:738)
at org.eclipse.m2m.qvt.oml.debug.core.vm.QVTODebugEvaluator$DebugInterceptor.execute(QVTODebugEvaluator.java:491)
at org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.doExecute(InternalTransformationExecutor.java:196)
at org.eclipse.m2m.internal.qvt.oml.InternalTransformationExecutor.execute(InternalTransformationExecutor.java:171)
at org.eclipse.m2m.internal.qvt.oml.TransformationRunner.execute(TransformationRunner.java:176)
at org.eclipse.m2m.qvt.oml.debug.core.app.DebugTransformationRunner$2.execute(DebugTransformationRunner.java:109)
at org.eclipse.m2m.qvt.oml.debug.core.vm.QVTOVirtualMachine.execute(QVTOVirtualMachine.java:225)
at org.eclipse.m2m.qvt.oml.debug.core.vm.QVTOVirtualMachine.access$10(QVTOVirtualMachine.java:222)
at org.eclipse.m2m.qvt.oml.debug.core.vm.QVTOVirtualMachine$1.run(QVTOVirtualMachine.java:212)
at java.lang.Thread.run(Unknown Source)

And i find another wierd phenomenon that when i set Instance Type Name in the property of ecore model, i will get an error like above when i call self.Name in both run and debug mode; but when i unset Instance Type Name ,the method of objectsOfType() could not work anymore in debug mode while i could get a right result in run mode.. this is really wierd and i cannot figure out why.. could anyone give me some direction about this?

It's probably not a matter of environment setup, but has something to do
with your model and/or model implementation. I tested with the simple
models below, i.e., only roles in the model, with a single attribute
'Name' of type string, and all other settings left to the default, which
worked perfectly well.

From the exception trace, the exception is trown by
EcoreEvaluationEnvironment.navigateProperty. This requires that the
target (i.e., the Role class in your case) is an EObject, and contains a
property 'Name'. Is this the case in your implementation? As I see in
another post that you have overridden the Instance Type Name, does your
implementation class still implement EObject?

While in my case, role is a subclass of a more generalized class which has the attribute of Name, in which case i do think role has the same attribute of Name.
As for Instance Type Name, i set it to Role ,for example, for the class of Role in my ecore model ,but when i try to generate the model code i got many errors in the interface package... i donot know why.. should i make some implementation manually？

at last , i have a new question about the graphic transformation.. i mean does this qvto support graphic transformation ,ie, when i transform pim to psm can i get an graphic model of psm or only get a xml-format file...?

On 25/07/11 15:42, Cindy wrote:
> While in my case, role is a subclass of a more generalized class which
> has the attribute of Name, in which case i do think role has the same
> attribute of Name.

That should be the case.

> As for Instance Type Name, i set it to Role ,for example, for the class
> of Role in my ecore model ,but when i try to generate the model code i
> got many errors in the interface package... i donot know why.. should i
> make some implementation manually？

As long as you get errors in the generated code, it's unlikely that the
transformation will work, so you should first fix those errors.

In general, you don't need to set the Instance Type Name attribute; a
Java class with the same name as your model element will be generated
automatically.

>
> at last , i have a new question about the graphic transformation.. i
> mean does this qvto support graphic transformation ,ie, when i transform
> pim to psm can i get an graphic model of psm or only get a xml-format
> file...?

Graphical representations of your models are not within scope of EMF nor
M2M. You could look at GEF, GMF or Graphiti for this.

hey Koen Yskout, I've made progress in this transformation work thanks to your help all the way . thank you very much!
as to the graphic transformation, i will refer to GMF for the solution..
however i am faced with new problems right now..
the problem I have is about flow transition in activity-alike diagram, for example ,i have an one to one transformation from PIM.ecore to PSM.ecore ..
in pim model , i have action a,b and flow c whose source is a and target b, now i can successfully transform a,b and c respectively to a1, b1 and c1, but i loss the relationship among them , ie i cannot make a1 to be c1's source and b1 target..

i failed to find a function in QVT to achieve this:-(
So do you have any idea how to realize this?

i succeeded in doing this by late resolveoneIn() and resolveone() function.. thanks all the same..
kind of excited after trapped by these days:-)
however problems seem to never stop..
i created dynamic instance from the pim.ecore in which way i got an input.xmi as input of this transformation.. now i can transform the element from input.xmi to output.psm(psm is the modeltype of my output model).. but i got an different structure from the input,and the example as fllows:input xmi format:
<role RoleName="role1">
<activity xsi:type="www.org.eclipse.PIM:Action" ActName="act1"/>
</role>

output psm format:

<cog CogName="role1">
<activity NodeName="act1"/>
</cog>

ie, i lost [xsi:type="www.org.eclipse.PIM:Action"] this type information.. i was supposed to have [xsi:type="www.org.eclipse.PSM:Node"] here..
do you know how to prevent this type loss..