A quick question: is there a way to generate random number values or random strings in ATL? Or, invoke an imported Java method?
Also, if I have a source and target metamodel with classes that are identical - is it a shortcut for transferring objects of the source classes to the target classes without creating rules for each class?
1.a. In regular ATL, it is only possible to invoke EOperations specified in the metamodel. You will have to generate Java code from your Ecore metamodel, and implement the EOperation in Java. Things like random numbers will have to be programmed in Java as well.
1.b. In the new EMFTVM, you can invoke any Java method. For example, you can generate unique UUIDs for each object like this:
--- Returns a random UUID for the given object.
helper context OclAny def : randomUUID : String =
2. Implicit "copying" is supported through refining mode. Refining mode requires input and output metamodels to be the same. The current implementation of refining mode does not actually copy elements, but performs in-place transformation on the input model.