wiki:FAQ

Version 10 (modified by kiegeland, 9 years ago) (diff)

--

Frequently Asked Questions

Q: How do I contact the developers of ikv in case of questions, ideas and comments?
A: Use the forum to post your questions.

Q: How do I post a bug or feature request?
A: Please post a new ticket.

Q: Can I use medini QVT in my commercial project? Do you offer commercial support?
A: Please contact us at contact page.

Q: Can you provide some examples for QVT relations?
A: In the medini QVT ZIP file there is a fully preconfigured workspace with two examples. To use them just leave the workspace location in the dialog that pops up when you first start mediniQVT.exe.

Q: When starting the QVT editor I get the following exception:

ClassNotFoundException: de.ikv.medini.qvt.ui.editors.QVTEditor

A: This indicates that you installed a wrong Java version. medini QVT requires Java 5.

Q: I get following exception when triggering my QVT transformation:

The object 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@15f235a (eClass: org.eclipse.emf.ecore.impl.EClassImpl@50617b (name: CTSheetData) ..)' is not contained in a resource.

A: This message appears when there is some element in the target model which is neither directly contained in the EMF resource nor it has another EMF element as container. The following example can produce this exception:

	top relation package2Worksheet {
			
		checkonly domain source pkg : uml::Package {
			packagedElement = usecase : uml::UseCase{
			}
		};
		
		
		enforce domain target worksheet : worksheet::CTWorksheet {
			sheetData = sd : CTSheetData {				
			} 
		};
		
	} 

If there are 2 or more use cases in a package, the first created CTSheetData will be assigned to a CTWorksheet's "sheetData" property, but the second created CTSheetData will be assigned to the "sheetData" property of the same CTWorksheet instance. Since the "sheetData" property has a 1-1 multiplicity in the metamodel, the first assignment will be overwritten, resulting in that the first CTSheetData instance has no container anymore. So when the EMF resource is saved, the EMF framework complains that it does not know where to save this instance.

The solution in this case would be to set the multiplicity to 1-* for the "sheetData" property.

Q: Can I use full qualified names in QVT?

A: Yes, but the EMF architecture can raise difficulties for some metamodels. E.g. image you want to use the qualified type name TheTopLevelPackage::ASecondLevelPackage::AMetaClass. You would have to register the namespace URI of TheTopLevelPackage with the QVT engine (for the mediniQVT Cockpit in the preferences page). However it can be impossible to register the namespace URI at the extension point org.eclipse.emf.ecore.generated_package if the EMF code generation did not generate code for this metamodel package. This is the case if the metamodel package only contains other metamodell packages, but no metamodel classes. Such metamodel package is further on called a "dummy package" and if you can influence the code generation for the metamodel, the next points explain how to convert a dummy package to a real package which can be registered with the extension point.

  • To each dummy package, add a new enumeration named DummyEnum in the ecore metamodel
  • Generate model code
  • Now delete all DummyEnum enumerations from the ecore metamodel
  • Generate model code again
  • Now, for each dummy package X there is created a class XPackage, XFactory, XPackageImpl, XFactoryImpl and also the DummyEnum classes. Delete the XFactory class, XFactoryImpl class and all DummyEnum classes.
  • Find all occurences of DummyEnum in the XPackage and XPackageImpl classes and carefully(!) delete them. You have also to delete methods returning the deleted factories. In the private constructor of XPackageImpl, you will have to remove the second parameter in the call to the super constructor.
  • In plugin.xml, add new extensions points to org.eclipse.emf.ecore.generated_package to register the URIs of all new packages (look in the ECORE to get to know the URIs).
  • To access the package classes from within other plugins, you may want to export the containing Java packages in plugin.xml.
  • If your metamodel plugin is versioned by Subversion: When you commit, beside the new generated classes, the modifications in the existing classes should only concern package imports.

An interesting discussion on this topic concerning Eclipse's OCL metamodel is here: http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg33499.html

Q: How do I put an element as first into a reference list?

A: In the following script, newB, which is bound by markerB, is put into the list a.b by executing b = newB: B {} and then newB is put into the front of the list by executing b = a.b -> excluding(newB) -> prepend(newB) :

	top relation prependB {
		newB: B;
		checkonly domain input a: A {};
		enforce domain output a: A { 
			b = newB: B {},
			b = a.b -> excluding(newB) -> prepend(newB)
		};
		when { 
			markerB(newB); 
		}
	}

	relation markerB {
		enforce domain output b: B {};
	}


Q: My QVT transformation not works and in the transformation log I see Relation 'AtoB' initially has 0 tuple(s) to evaluate

A: It seems that the QVT engine has no instances of type A as input for the relation AtoB. If your input model actually does not include instances of A, this is expected behaviour. However if you claim that there are instances of A in the input model(s), one reason might be that the Ns URI of the metamodel package is not correctly set. You can check this by opening the .ecore metamodel with Eclipse's editor and have a look at the property Ns URI of the metamodel package in which the metamodel class A is contained. This URI resemble the namespace URI of the XML element which represents an instance of A in the input model.