Transform qvto file standalone [message #1469075] |
Tue, 11 November 2014 09:28 |
Lindung Manik Messages: 3 Registered: October 2014 |
Junior Member |
|
|
Hi all,
I have this snippet:
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("qvto", new QvtOperationalResourceFactoryImpl());
QVTOperationalPackage.eINSTANCE.eClass();
// Refer to an existing transformation via URI
URI transformationURI = URI.createFileURI("Trad2Pivot.qvto");
// create executor for the given transformation
TransformationExecutor executor = new TransformationExecutor(transformationURI);
// define the transformation input
// Remark: we take the objects from a resource, however
// a list of arbitrary in-memory EObjects may be passed
ResourceSet resourceSet = new ResourceSetImpl();
Resource inResource = resourceSet.getResource(URI.createFileURI("ATransformation.qvto"), true);
EList<EObject> inObjects = inResource.getContents();
// create the input extent with its initial contents
ModelExtent input = new BasicModelExtent(inObjects);
// create an empty extent to catch the output
ModelExtent output = new BasicModelExtent();
// setup the execution environment details ->
// configuration properties, logger, monitor object etc.
ExecutionContextImpl context = new ExecutionContextImpl();
context.setConfigProperty("keepModeling", true);
// run the transformation assigned to the executor with the given
// input and output and execution context -> ChangeTheWorld(in, out)
// Remark: variable arguments count is supported
ExecutionDiagnostic result = executor.execute(context, input, output);
The problems are:
1. Class org.eclipse.m2m.internal.qvt.oml.runtime.resource.QvtOperationalResourceFactoryImpl is hidden from the org.eclipse.m2m.qvt.oml.runtime.jar
2. Class org.eclipse.m2m.qvt.oml.ecore.QVTOperational.QVTOperationalPackage is not in plugin folder.
Do you have any better ideas?
Thanks.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02973 seconds