M2MRuleset inheritance modeling

M2MRuleset inheritance is supported to ease the reuse of MappingRules. This inheritance relation is mono-directional. When a transformation is launched from a M2MRuleset which inherits from another M2MRuleset, the inherited MappingRules are executed as well. It is also possible to disable or override a specific MappingRule of the M2MRuleset parent.

To add an inheritance relation relation between two M2MRuleset, right-click on the M2MRuleset you want it inherits from another M2MRuleset, and click on Add new | M2M | inheritsFrom: add inheritsFrom

After clicking, a dialog window is displayed to select the M2MRuleset parent:

select inheritsFrom

Once the M2MRuleset parent is selected, it creates a the Dependency inheritsFrom which link a M2MRuleset to its parent.
Here is an example of how it looks:

inheritsFrom example

If a transformation is executed from the M2MRuleset SysML2Ar42, the M2M Engine will execute the MappingRules of SysML2Ar42 and SysML2Ar3x. If a transformation is executed from the M2MRuleset SysML2Ar3x, the M2M Engine will execute the MappingRule of SysML2Ar3x only.

This relation is used to link a M2MRuleset to a MappingRule from a M2MRuleset parent. When the M2M Engine execute a transformation based on the M2MRuleset which is the source of the disableRule, it will skip the MappingRule which is the target of the disableRule relation. In the example below, when SysML2Ar42 is executed, SysML2Ar3x rules will also be executed due to the inheritsFrom relation, but it will skip the MappingRule SysML2Ar3x::mappingrule_2:

disableRule example

This relation is used to link a MappingRule to a MappingRule from a M2MRuleset parent. When the M2M Engine execute a transformation based on the M2MRuleset which is the owner of the overrideRule relation source, it will skip the MappingRule which is the target of the overrideRule relation, and execute the source MappingRule. In the example below, when SysML2Ar42 is executed, SysML2Ar3x rules will also be executed due to the inheritsFrom relation, but it will execute the MappingRule SysML2Ar42::mappingrule_4 instead of SysML2Ar3x::mappingrule_2:

overrideRule example