|
|
Re: OCL Errors in StandAlone QVTo [message #1220760 is a reply to message #1220752] |
Fri, 13 December 2013 13:02 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
HI
QVTo does not (yet) use the Pivot version of OCL, so using pivot
installatiion is at best a waste of time and at worst a source of problem.
I would expect QVTo to pretty much just work, perhaps with some help on
the UML registrations; look for an example to copy.
Regards
Ed Willink
On 13/12/2013 11:54, Denis Nikiforov wrote:
> Hi
>
> Here is my standalone QVTo transformation:
> https://github.com/AresEkb/OclToXPath
>
> Here is a package registration:
> Xpath2Package.eINSTANCE.getEFactoryInstance();
> EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xsd/2002/XSD",
> SchemaPackageImpl.eINSTANCE);
> and a transformation part:
> TransformationExecutor executor = new
> TransformationExecutor(transformation);
> ExecutionContextImpl context = new ExecutionContextImpl();
> context.setConfigProperty("keepModeling", true);
> context.setLog(new WriterLog(new OutputStreamWriter(System.out)));
> ModelExtent input = new BasicModelExtent(source);
> ModelExtent output = new BasicModelExtent();
> ExecutionDiagnostic result = executor.execute(context, input,
> output);
> if(result.getSeverity() == Diagnostic.OK) {
> return output.getContents();
> } else {
> IStatus status = BasicDiagnostic.toIStatus(result);
> throw new Exception(status.getMessage());
> }
> I'm not sure, but maybe OCL must be initalized too:
> org.eclipse.ocl.examples.pivot.OCL.initialize(rs);
> org.eclipse.ocl.examples.pivot.uml.UML2Pivot.initialize(rs);
> org.eclipse.ocl.examples.pivot.model.OCLstdlib.install();
> org.eclipse.ocl.examples.pivot.delegate.OCLDelegateDomain.initialize(rs);
> org.eclipse.ocl.examples.xtext.completeocl.CompleteOCLStandaloneSetup.doSetup();
> org.eclipse.ocl.examples.xtext.oclinecore.OCLinEcoreStandaloneSetup.doSetup();
> org.eclipse.ocl.examples.xtext.oclstdlib.OCLstdlibStandaloneSetup.doSetup();
> org.eclipse.ocl.examples.domain.utilities.StandaloneProjectMap.getAdapter(rs);
> Actually I'm new to Eclipse and Java, I apologize if my suggestions
> will mislead you.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03328 seconds