M2MImportRuleset inheritance modeling

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

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

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

select inheritsFrom

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

inheritsFrom example

If a transformation is executed from the M2MImportRuleset SysML2Ar42, the M2M Engine will execute the ImportMappingRules of SysML2Ar42 and SysML2Ar3x. If a transformation is executed from the M2MImportRuleset SysML2Ar3x, the M2M Engine will execute the ImportMappingRule of SysML2Ar3x only.

This relation is used to link a M2MImportRuleset to a ImportMappingRule from a M2MImportRuleset parent. When the M2M Engine executes a transformation based on the M2MImportRuleset which is the source of the disableRule, it will skip the ImportMappingRule 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 ImportMappingRule SysML2Ar3x::mappingrule_2:

disableRule example

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

overrideRule example