Rule Overriding

Transformation rules in MOFScript can override other rules, either from imported transformations or within the same transformation. This has two possible effects:

Overriding a rule from a super transformation in a sub transformation (inheritance overriding). The sub transformation rule will be called instead of the super one. The specializing rule may invoke the rule of the super transformation by using the ‘super’ keyword.

uml.Package::uml2ecore () {
'
  <ecore:EPackage name="'self.name'">
'
  self.ownedMember->forEach(member:uml.Element)
       member.uml2ecore() 
'
  </ecore:EPackage>
'
}
 
uml.Class::uml2ecore () {
  …
}