|
|
Re: trouble with this bug [message #699731 is a reply to message #699661] |
Fri, 22 July 2011 08:00 |
Eclipse User |
|
|
|
Originally posted by: Koen Yskout
My first guess would be that the exception is not thrown by the
transformation, but by code from the PIM model. Is there any kind of
check on the validity of the name in there?
On 22/07/11 05:12, Cindy wrote:
> additional remarks about above:
> i meet the same problem which says: Diagnostic ERROR
> source=org.eclipse.m2m.qvt.oml.execution code=120 Unexpected runtime
> exception caught during execution data=[java.lang.IllegalArgumentException]
> i am confused about this because my code is quite simple,so i can not
> find where the problem is. now i paste my code here and hope someone can
> help:-P
> modeltype PIM 'strict' uses 'http:///PIM.ecore';
> modeltype PSMInteraction 'strict' uses 'http:///PSMInteraction.ecore';
> transformation InteractionTran(in inModel:PIM, out
> outModel:PSMInteraction);
>
> main() {
> inModel.objectsOfType(Role)-> map toPSMRole();
> }
>
> mapping PIM::Role::toPSMRole():PSMInteraction::Role
> {
> Name := self.Name;//when i run here (i this self.name attributes to
> bug) the program crashes
> }
>
>
> could anyone be helpful and give a direction for me?
|
|
|
|
Re: trouble with this bug [message #699781 is a reply to message #699736] |
Fri, 22 July 2011 09:36 |
Eclipse User |
|
|
|
Originally posted by: Koen Yskout
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 ..
|
|
|
|
|
Re: trouble with this bug [message #701029 is a reply to message #699886] |
Sun, 24 July 2011 13:21 |
Cindy Messages: 59 Registered: May 2011 |
Member |
|
|
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?
[Updated on: Mon, 25 July 2011 01:16] Report message to a moderator
|
|
|
Re: trouble with this bug [message #701551 is a reply to message #699886] |
Mon, 25 July 2011 08:40 |
Eclipse User |
|
|
|
Originally posted by: Koen Yskout
Cindy,
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?
## pim.ecore
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="pim"
nsURI="http://pim.ecore" nsPrefix="pim">
<eClassifiers xsi:type="ecore:EClass" name="Role">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Name"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>
## psm.ecore
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="psm"
nsURI="http://psm.ecore" nsPrefix="psm">
<eClassifiers xsi:type="ecore:EClass" name="Role">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="Name"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>
On 22/07/11 16:39, Cindy wrote:
> hi could you tell me how did you set your m2m environment? maybe i could
> follow your setting and have a try again..:)
|
|
|
Re: trouble with this bug [message #701722 is a reply to message #701551] |
Mon, 25 July 2011 13:42 |
Cindy Messages: 59 Registered: May 2011 |
Member |
|
|
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...?
Thank you for all your attention really:-)
best wishes!
|
|
|
Re: trouble with this bug [message #702350 is a reply to message #701722] |
Tue, 26 July 2011 08:55 |
Eclipse User |
|
|
|
Originally posted by: Koen Yskout
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.
>
> Thank you for all your attention really:-)
> best wishes!
|
|
|
Re: trouble with this bug [message #702453 is a reply to message #702350] |
Tue, 26 July 2011 11:49 |
Cindy Messages: 59 Registered: May 2011 |
Member |
|
|
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?
|
|
|
|
Powered by
FUDForum. Page generated in 0.02120 seconds