Community
Participate
Working Groups
If a transformation includes workspace blackboxes, serializing and reloading that transformation to/from *.qvtox fails with an IllegalArgumentException "imported module must be in a resource". The failure is due to a bad choice of the artificial URIs used by QVTo to reference blackbox units. These blackbox URIs have the following form: qvto://blackbox/org.eclipse.m2m.qvt.oml.MyBlackboxUnit?jdt#MyJavaProject What are they used for? To indicate that BlackboxResourceFactory must be used when resolving a blackbox unit referenced by a *.qvtox file. BlackboxResourceFactory registers a parser for the qvto:// protocol, which then delegates the creation and loading of units to the blackbox mechanism. The problem is the use of the fragment to encode the Java project in which a blackbox unit resides. A fragment usually represents a specific model element inside a unit, not the unit itself. Thus fragments are trimmed during EMF's default XMI serialization, so that URIs are serialized incompletely in the following form: qvto://blackbox/org.eclipse.m2m.qvt.oml.MyBlackboxUnit?jdt Obviously the above URI lacks an indication of the project and thus can't be resolved to a blackbox unit. Adjusting the *.qvtox serialization to our needs is possible but relatively cumbersome. Instead, the form of the URIs should be changed so that the Java project is encoded by the query: qvto://blackbox/org.eclipse.m2m.qvt.oml.MyBlackboxUnit?jdt=MyJavaProject This way, the fragment no longer encodes the project, so the URIs are intact using the default XMI serialization.
One could say that *.qvtox does not play a role in daily business, but it's heavily used by QVTo's test infrastructure. Therefore, this bug blocks the reproduction or repair of several other blackbox-related bugs and should be fixed immediately.
Obviously the use of fragments is broken. Queries seem a little perverse. But since it's broken you have a clean slate. You don't provide an example of the invocation. If the XMI invocation is for a reference then to make the Sample Ecore Model Editor work there must be a registration of the qvto: scheme. For which //blackbox seems like bloat. If the XMI invocation is of a String, then there is no problem for other XMI loaders and you may emulate the Pivot OCL's duality of name / quoted string identifier which allows an import to be encoded as a quoted-string name. I suggest ensuring that a String is used and that when its value is something like 'java:my.project.MyJavaProject' it is a directive to use a Java blackbox. This is much shorter, avoids problems for other tools and provides a potential opening for other languages; even ada:.
New Gerrit change created: https://git.eclipse.org/r/c/mmt/org.eclipse.qvto/+/190146
New Gerrit change created: https://git.eclipse.org/r/c/mmt/org.eclipse.qvto/+/190147
New Gerrit change created: https://git.eclipse.org/r/c/mmt/org.eclipse.qvto/+/190148
New Gerrit change created: https://git.eclipse.org/r/c/mmt/org.eclipse.qvto/+/190474
New Gerrit change created: https://git.eclipse.org/r/c/mmt/org.eclipse.qvto/+/190475
New Gerrit change created: https://git.eclipse.org/r/c/mmt/org.eclipse.qvto/+/190476
New Gerrit change created: https://git.eclipse.org/r/c/mmt/org.eclipse.qvto/+/190901
New Gerrit change created: https://git.eclipse.org/r/c/mmt/org.eclipse.qvto/+/190900
Gerrit change https://git.eclipse.org/r/c/mmt/org.eclipse.qvto/+/190474 was merged to [master]. Commit: http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/commit/?id=789a0978a663a7644230ccbfb76cdd4524ede79d
Gerrit change https://git.eclipse.org/r/c/mmt/org.eclipse.qvto/+/190901 was merged to [master]. Commit: http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/commit/?id=4ed507482c96c9578b8b971e8d774a0cb97c207f
Gerrit change https://git.eclipse.org/r/c/mmt/org.eclipse.qvto/+/190900 was merged to [master]. Commit: http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/commit/?id=9730ed6ed3085ee03516f1d33af92fdb4c80b0d0