As stated above, an in-place transformation is one with only one model serving as its source and target. For example, if you have only one model with all your developments phases modeled in different packages, you can perform an in-place transformation from one phase (say Requirements) to another (say Use Case). Contrary to non in-place transformations, model elements created by the transformation are exposed to it again as candidate elements. Therefore, the engine executes such a transformation until no model element is created. To illustrate this, consider the following transformation below which creates a persistent class for every transient class and creates a package for every persistent class.
transformation umlToRdbmsExtended(source:SimpleUML, target:SimpleUML){ top relation TransientClassToPersistentClass { theName: String; checkonly domain source tc:UMLClass { name = theName, owningPackage = p:UMLPackage {}, kind = UMLElementKind::Transient }; enforce domain target pc:UMLClass { name = theName+'_Persistent', owningPackage = p, kind = UMLElementKind::Persistent }; } top relation PersistentClassToPackage { theName: String; checkonly domain source c:UMLClass { name = theName, kind = UMLElementKind::Persistent }; enforce domain target p:UMLPackage { name = theName+'_Package' }; } }
If the above transformation is not executed in-place with a model containing only transient classes, no package will be created. In in-place mode however, the relation 'PersistentClassToPackage' will be executed again for the newly created persistent UMLClass resulting from 'TransientClassToPersistentClass'.