Closed lengoccanh84 closed 11 years ago
Can you please give some more details on what you're trying to do? With that little information we can't provide help.
Hi mirko
Please see red section in attached image. There are 3 problems: 1.When I run uml2java.atl, in console it shows many warning eg: Metamodel contains several classifiers with same name: Annotable Metamodel contains several classifiers with same name: AnnotationInstance Metamodel contains several classifiers with same name: AnnotationParameter Metamodel contains several classifiers with same name: SingleAnnotationParameter Metamodel contains several classifiers with same name: AnnotationParameterList ......................................................................................................................
3.It doesnot add function content from file ClassDiagram.uml.Person.print.javabehavior import de.tudresden.contact_management.*;
public void print () { Person p = this; String fullName = p.forename + " " + p.surname; String msg = "My name is " + fullName + "."; System.out.println(msg); } to method class Person extends Contact { protected //@classifiers[name='String'] forename; protected //@classifiers[name='String'] surname; public void print() { { //i dont see content added here........................ } }
I already install atl, jamopp in eclipse Please help
Could you attach an example project and state which Eclipse/ATL/JaMoPP versions you are using?
Could you suggest me the best eclipse version, ATL, JaMoPP version and where to download? I download example project from github https://github.com/DevBoost/JaMoPP When I tried with three version of Eclipse, it showed the same issue.
Here are there version of Eclipse and JaMoPP, ATL version:
Eclipse Standard/SDK Version: Kepler Service Release 1 Build id: 20130919-0819 ATL 3.3.1 EMFText 1.4.1 JaMoPP 1.4.0
Version: Indigo Service Release 2 Build id: 20120216-1857 ATL 3.3.1 EMFText 1.4.1 JaMoPP 1.4.0
Eclipse Modeling Tools Version: Helios Service Release 2 Build id: 20110218-0911 ATL 3.3.1 JaMoPP 1.4.0
I see that atl source( eg: rule Property) on github is different from atlsource example on http://www.jamopp.org/index.php/JaMoPP_Applications_ATL
Other issue is when I create attribute of class and set type is Interger/Boolean. It show error:
org.eclipse.m2m.atl.engine.emfvm.VMException: org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl cannot be cast to org.emftext.language.java.classifiers.Classifier
at applyProperty#67(uml2java.atl[55:3-55:42])
local variables: self=uml2java : ASMModule, link=TransientLink {rule = Property, sourceElements = {umlProperty = org.eclipse.uml2.uml.internal.impl.PropertyImpl@1b73ecd (name: surname, visibility:
The warnings are not a problem (I do not know why they appear).
The problem was that java.lang and java.util packages need to be defined as input models to make classes like String or List available. This was configured in the build.xml (which can only be used with am3 ant tasks) but not the launch config. I added this to the launch config as well.
The second issue (org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl cannot be cast to org.emftext.language.java.classifiers.Classifier) appears, because the transformation is far from complete. It is only a very minimal example of giving an idea of how UML2Java with ATL and JaMoPP can work.
The error means that some UML type is not translated into a corresponding Java type. To fix that, you need to extend the transformation script.
It seem that the changed code does not resolve problem. It still shows: protected //@classifiers[name='String'] forename; protected //@classifiers[name='String'] surname;
I see atl has changed and different from content on website. When I build atl file, it generate class with incorrect class structure: class Address { protected //@classifiers[name='List']contact;
}
Please help urgent