Community
Participate
Working Groups
I'm trying to add a getURI() black box implementation to my MWE launched QVTO transformation and failing abysmally. a) The QVTo Documentation section is incomplete. There is no working example of a *.qvto using a blackbox, since the BlackBox example has no *.qvto. Pasting the main() example into temp.qvto gives a syntax error. No missing module declaration. I can fix that but it doesn't help. What I want to know about is what library/import declaration to use. b) I find no explanation for the "unit" level in the extension point. What do "name" and "namespace" signify? They seem irrelevant to me. Conversely they explain why nothing works. The FAQ is similarly lacking and has non-hyperlink references. c) I suspect that I need to know more to make a MWE launch work. What is it that I do now know? probably how to declare the extension point programmatically.
Hi Ed, I'm fully agree that documentation on BlackBox in QVTo is totally incomplete. Will be updated. About launching QVTO from MWE. Am I correct that it is standalone execution of QVTO (i.e. by means of TransformationExecutor class) ?
The extension point schema sheds some insight and also confusion. It would appear that the name and namespace should contribute to some kind of import declaration enabling the library name to be used. But how? The extension point schema has a broken link to blackboxing.html (In reply to Sergey Boyko from comment #1) > About launching QVTO from MWE. Am I correct that it is standalone execution > of QVTO (i.e. by means of TransformationExecutor class) ? Yes.
(In reply to Ed Willink from comment #2) > The extension point schema sheds some insight and also confusion. It would > appear that the name and namespace should contribute to some kind of import > declaration enabling the library name to be used. But how? Found a working example. It looks as if in the documentation main() { var date : ecore::EDate := createDate('2008-10-31'); var isBefore := date.before(createDate('2008-11-01')); var eClass := object ecore::EClass {}; var qname := eClass.getQualifiedName(); } should be replaced by at least (and added to the FAQ) import m2m.qvt.oml.ExampleJavaLib; modeltype Ecore uses 'http://www.eclipse.org/emf/2002/Ecore'; transformation PruneUML(in ecore: Ecore, out Ecore); main() { var date : ecore::EDate := createDate('2008-10-31'); var isBefore := date.before(createDate('2008-11-01')); var eClass := object ecore::EClass {}; var qname := eClass.getQualifiedName(); } with a a little bit more so that it actually does something useful. Maybe insert an EAnnotation with today's date at the root and change all names to qualified names. --- Further confusion arises from the failure of the editor to understand the plugin.xml extension point, making it appear as if a nested Eclipse session is needed to ensure that the blackbox is installed. --- No idea what the purpose of the <library name in the extebnsion point is. The extra <unit level is very flexible but an inordinate pain. Why not allow it to be omitted so that it is taken from the classpath of the class? <extension point="org.eclipse.m2m.qvt.oml.javaBlackboxUnits"> <library class="my.path.BlackBoxLibrary"> <metamodel nsURI="http://www.eclipse.org/emf/2002/Ecore"/> </library> </extension> seems enough to configure import my.path.BlackBoxLibrary; for the 99% of users who don't need to obfuscate their lookups.
Found the great progress in Bug 326871 using @Module. A real shame that it doesn't work. See Bug 326871.
(In reply to Ed Willink from comment #4) > Found the great progress in Bug 326871 using @Module. > > A real shame that it doesn't work. See Bug 326871. Commit aba87c8d8f495ec6dd4b9c02ca892825aa007241 for Bug 427237 introduced API for "standalone setup" of blackbox modules. See Javadoc for BlackboxRegistry interface: http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/tree/plugins/org.eclipse.m2m.qvt.oml/src/org/eclipse/m2m/qvt/oml/TransformationExecutor.java Thus no contributions via extension point is needed. JUnit test case: Java blackbox module http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/tree/tests/org.eclipse.m2m.tests.qvt.oml/src/org/eclipse/m2m/tests/qvt/oml/bbox/StandaloneBBoxModule2.java JUnit test class http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/tree/tests/org.eclipse.m2m.tests.qvt.oml/src/org/eclipse/m2m/tests/qvt/oml/callapi/BlackboxModuleStandaloneSetupTest.java Qvto script http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/tree/tests/org.eclipse.m2m.tests.qvt.oml/parserTestData/models/bug326871_standalone or http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/tree/tests/org.eclipse.m2m.tests.qvt.oml/parserTestData/models/bug326871a_standalone
Bug 472482 identifies Bug 289982 as a source of design information that should be in /org.eclipse.m2m.qvt.oml.doc/references/blackboxing.html which should be revamped to be signifcantly more accurate and readable, have proper hyperlinks and an installable example.