|
|
|
|
|
|
Re: Acceleo transformation [message #1786423 is a reply to message #1786416] |
Thu, 03 May 2018 08:12   |
Julieth Castellanos Messages: 8 Registered: April 2018 |
Junior Member |
|
|
Hi again
Thank you very much for your answers... I will try to explain better my purpose with this transformation. Well, I need to transform an .xml file created with EPF composer... The file is called SoftwareUnitProcess.xml (it is attached). As I understand, the file is created, based on the UMA metamodel. I have the UMA.ecore, and the uma.xsd, and even the jar org.eclipse.epf.uma_1.5.0.201611202248, from epf composer. To try to read the model, I imported the previous jar, and other jars in the referenced Libraries.
Then I modified the public void registerPackages(ResourceSet resourceSet), addign this code:
if (!isInWorkspace(org.eclipse.epf.uma.UmaPackage.class)) {
resourceSet.getPackageRegistry().put(org.eclipse.epf.uma.UmaPackage.eINSTANCE.getNsURI(), org.eclipse.epf.uma.UmaPackage.eINSTANCE);
But this error happends:
Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/epf/uma/1.0.6' not found. (file:/C:/Users/jcs01/Dropbox/EclipseOxigeno-workspace/org.eclipse.acceleo.module.sampleRegorousTransformation/Model/SoftwareUnitProcess.xml, 2, 309)
The error, as you say, is that the library is not register, so I deleted the previous line and instead I add this :
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/epf/uma/1.0.6", org.eclipse.epf.uma.UmaPackage.eINSTANCE);
The error is
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/resources/IFile
I even tried with
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/epf/uma/1.0.6", UMLPackage.eINSTANCE);
and
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/epf/uma/1.0.6", EcorePackage.eINSTANCE);
But in both I got this error:
Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'MethodLibrary' is not found or is abstract. (file:/C:/Users/jcs01/Dropbox/EclipseOxigeno-workspace/org.eclipse.acceleo.module.sampleRegorousTransformation/Model/SoftwareUnitProcess.xml, 2, 309)
The transformation code is :
[comment encoding = UTF-8 /]
[**
* The documentation of the module generate.
*/]
[module generate('http://www.eclipse.org/epf/uma/1.0.6')]
[**
* The documentation of the template generateElement.
* @param a
*/]
[template public generateElement(a : uma::DeliveryProcess )]
[comment @main/]
[file (a.name, false, 'UTF-8')]
[/file]
[/template]
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01937 seconds