|
|
Re: Invoke QVT In JAVA [message #726392 is a reply to message #726060] |
Sat, 17 September 2011 20:00 |
Eclipse User |
|
|
|
Originally posted by: Philipp Kalb
Hi Cindy
Maybe our problem is related. I posted a topic called "[QVT]
undeterministic behaviour..." some days ago.
Ed Willink suggested (to sum it up...) to test everything again and if
the error occurs (again) create a bugzilla report.
I will do this as soon as I have some time left.
It sounds like a stupid trick but we called the transformation in a loop
and check the result. If it is bad we transform everything again, if it
looks OK we take it :). I hope this helps you a little bit.
cheers
Philipp
Am 16.09.2011 15:42, schrieb Cindy:
> Since sometimes i could get the right output so i guess the problems
> doesnot lie in the code.. am i right?
|
|
|
|
|
|
Re: Invoke QVT In JAVA [message #727121 is a reply to message #726624] |
Tue, 20 September 2011 13:05 |
Philipp Zech Messages: 96 Registered: July 2009 |
Member |
|
|
On 09/19/2011 05:33 AM, Cindy wrote:
> Hey i got the solution~~ by changing the position of
> EPackage.Registry.INSTANCE.put().. actually i put this in the
> transform.java file where i write the ExecutionDiagnostic diagnostic =
> executor.execute(context, input, output);code
> now i change this to Activator.java where i extends AbstractUIPlugin..
> so i guess this EPackage.Registry.INSTANCE.put() could be only done once..
Hi,
to join this discussion about possible QvT bugs in combination with
programmatic execution in JAVA, I've developed a transformation and
running it standalone in eclipse via "Run as..." works seamlessly,
however, as soon as the transformation is embedded inside an eclipse
plug-in, somehow only half of the transformation is done, however, I get
no exception or anything else. Could this be another possible bug in QvT?
Cheers,
Philipp
|
|
|
Re: Invoke QVT In JAVA [message #727145 is a reply to message #727121] |
Tue, 20 September 2011 13:59 |
Philipp Zech Messages: 96 Registered: July 2009 |
Member |
|
|
On 09/20/2011 03:05 PM, Philipp Zech wrote:
> On 09/19/2011 05:33 AM, Cindy wrote:
>> Hey i got the solution~~ by changing the position of
>> EPackage.Registry.INSTANCE.put().. actually i put this in the
>> transform.java file where i write the ExecutionDiagnostic diagnostic =
>> executor.execute(context, input, output);code
>> now i change this to Activator.java where i extends AbstractUIPlugin..
>> so i guess this EPackage.Registry.INSTANCE.put() could be only done
>> once..
> Hi,
>
> to join this discussion about possible QvT bugs in combination with
> programmatic execution in JAVA, I've developed a transformation and
> running it standalone in eclipse via "Run as..." works seamlessly,
> however, as soon as the transformation is embedded inside an eclipse
> plug-in, somehow only half of the transformation is done, however, I get
> no exception or anything else. Could this be another possible bug in QvT?
>
> Cheers,
>
> Philipp
hi,
sorry for inconveniences, simply forgot a deepclone in my code.
cheers,
philipp
|
|
|
|
Re: Invoke QVT In JAVA [message #729185 is a reply to message #726392] |
Sun, 25 September 2011 10:24 |
Eclipse User |
|
|
|
Originally posted by: Philipp Kalb
Hi,
Just for your information:
I have now created a bugzilla report for my problem. Since I think that
it is similar to yours I mentioned that in the bugreport.
Here is a link:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=358814
Maybe if you have some more information you could add that to the report :-)
Best wishes
Philipp
Am 17.09.2011 22:00, schrieb Philipp Kalb:
> Hi Cindy
>
> Maybe our problem is related. I posted a topic called "[QVT]
> undeterministic behaviour..." some days ago.
>
> Ed Willink suggested (to sum it up...) to test everything again and if
> the error occurs (again) create a bugzilla report.
> I will do this as soon as I have some time left.
>
> It sounds like a stupid trick but we called the transformation in a loop
> and check the result. If it is bad we transform everything again, if it
> looks OK we take it :). I hope this helps you a little bit.
>
> cheers
> Philipp
>
>
> Am 16.09.2011 15:42, schrieb Cindy:
>> Since sometimes i could get the right output so i guess the problems
>> doesnot lie in the code.. am i right?
>
|
|
|
Re: Invoke QVT In JAVA [message #815685 is a reply to message #729185] |
Wed, 07 March 2012 23:50 |
sohaib soso Messages: 33 Registered: March 2012 |
Member |
|
|
Hi,I am new here and I have a similar problem:
code:
Diagnostic diag = executor.loadTransformation();
//EPackage.Registry.INSTANCE.put(ABCPackage.eNS_URI, ABCPackage.eINSTANCE);
//Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("abc", new XMIResourceFactoryImpl());
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getPackageRegistry().put(ABCPackage.eNS_URI, ABCPackage.eINSTANCE);
Resource inResource = resourceSet.getResource(inputFileURI, true);
ModelExtent input = new BasicModelExtent(inResource.getContents());
ModelExtent output = new BasicModelExtent();
ExecutionContextImpl context = new ExecutionContextImpl();
context.setConfigProperty("keepModeling", true);
ExecutionDiagnostic result = executor.execute(context, input, output);
**********************************************************************************
when I call System.out.println(output.getContents().toString());
System.out.println(result.toString());
i get
[]
Diagnostic ERROR source=org.eclipse.m2m.qvt.oml.execution code=130 Compilation errors found in unit 'file:/D:/workspace/org.emf.transformation/NewTransformation1.qvto' data=[] [Diagnostic ERROR source=file:/D:/workspace/org.emf.transformation/NewTransformation1.qvto code=0 Failed to resolve metamodel '///ABC.ecore' (at:1) data=[], Diagnostic ERROR source=file:/D:/workspace/org.emf.transformation/NewTransformation1.qvto code=0 Failed to resolve metamodel '[org.eclipse.ocl.cst.impl.SimpleNameCSImpl@d1c778 (startOffset: 19, endOffset: 21, startToken: null, endToken: null, ast: null) (value: ABC, type: identifier)]' (at:1) data=[], ...............
................................................
................................................
Any idea? I'm stuck with this error -_-
|
|
|
Re: Invoke QVT In JAVA [message #815777 is a reply to message #815685] |
Thu, 08 March 2012 02:54 |
Alan McMorran Messages: 55 Registered: July 2009 |
Member |
|
|
Sohaib,
Could you posted the first few lines of the transform? What I'm
guesing is that you have your meta-models specified explicitly as
references to the ecore. I've found that when running the transform
using the ExecutionDiagnostic you need to reference them by their URI.
e.g. If your ABCPackage.eNS_URI = http://example.com/model
Then your transform would have:
modeltype ABC "strict" uses 'http://example.com/model';
rather than an explicit reference to the ecore. The QVTO compliler
will then find the correct EPackage from the registry when it compiles
the transform.
I'm also not sure if it work successfully on transforms with an
explicit file URI, I think I remember finding that I had to use a
platform URI, so if you're running this as a JUnit plugin test for
example you'd have:
platform:/plugin/org.emf.transformation/NewTransformation1.qvto
As the workspace project will become a plugin at execution. If you're
referring to a workspace QVTO it would be:
platform:/resource/org.emf.transformation/NewTransformation1.qvto
Alan
On 2012-03-07 23:50:37 +0000, sohaib soso said:
> Hi,I am new here and I have a similar problem:
> code: Diagnostic diag = executor.loadTransformation();
> //EPackage.Registry.INSTANCE.put(ABCPackage.eNS_URI,
> ABCPackage.eINSTANCE);
> //Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("abc",
> new XMIResourceFactoryImpl());
> ResourceSet resourceSet = new ResourceSetImpl();
> resourceSet.getPackageRegistry().put(ABCPackage.eNS_URI,
> ABCPackage.eINSTANCE);
> Resource inResource = resourceSet.getResource(inputFileURI, true);
> ModelExtent input = new BasicModelExtent(inResource.getContents());
> ModelExtent output = new BasicModelExtent();
> ExecutionContextImpl context = new ExecutionContextImpl();
> context.setConfigProperty("keepModeling", true);
> ExecutionDiagnostic result = executor.execute(context, input, output);
> **********************************************************************************
when
>
> I call System.out.println(output.getContents().toString());
> System.out.println(result.toString());
> i get []
> Diagnostic ERROR source=org.eclipse.m2m.qvt.oml.execution code=130
> Compilation errors found in unit
> 'file:/D:/workspace/org.emf.transformation/NewTransformation1.qvto'
> data=[] [Diagnostic ERROR
> source=file:/D:/workspace/org.emf.transformation/NewTransformation1.qvto
> code=0 Failed to resolve metamodel '///ABC.ecore' (at:1) data=[],
> Diagnostic ERROR
> source=file:/D:/workspace/org.emf.transformation/NewTransformation1.qvto
> code=0 Failed to resolve metamodel
> '[mailto:org.eclipse.ocl.cst.impl.SimpleNameCSImpl@d1c778 (startOffset:
> 19, endOffset: 21, startToken: null, endToken: null, ast: null) (value:
> ABC, type: identifier)]' (at:1) data=[], ...............
> ...............................................
> ...............................................
>
> Any idea? I'm stuck with this error -_-
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04322 seconds