Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Henshin/Rule Generation"

(Created page with "Apart from creating Henshin transformation rules from scratch, you can also generate a rule from a pair of models that demonstrates the effect of a transformation. == Generat...")
 
Line 1: Line 1:
Apart from creating Henshin transformation rules from scratch, you can also generate a rule from a pair of models that demonstrates the effect of a transformation.
+
Apart from creating Henshin [[Henshin/Transformation Meta-Model#Basic_building_blocks:_Rules|transformation rules]] from scratch, you can also generate a rule from a pair of models that demonstrates the effect of a transformation.
  
 
== Generation of transformation rules ==
 
== Generation of transformation rules ==
Line 7: Line 7:
 
== Applying the Henshin rule generator to models ==  
 
== Applying the Henshin rule generator to models ==  
 
In the package explorer, select the two models that will serve as an input for the rule generation. Next, right-click on the selection and choose Henshin > Henshin Rule Generation > Create Example-based Transformation Rule.
 
In the package explorer, select the two models that will serve as an input for the rule generation. Next, right-click on the selection and choose Henshin > Henshin Rule Generation > Create Example-based Transformation Rule.
 
[[File:Henshin rule generation example 1.png|900px]]
 
  
 
A window will pop up that asks you to specify the left-hand side of the rule, i.e., the model that demonstrates the original state. The other model will be considered as the changed model from which the right-hand side of the rule is derived.
 
A window will pop up that asks you to specify the left-hand side of the rule, i.e., the model that demonstrates the original state. The other model will be considered as the changed model from which the right-hand side of the rule is derived.
 
+
[[File:Henshin rule generation example 2.png]]
+
 
+
 
Thereupon, you obtain a Henshin module including the necessary meta-model imports as well as the generated transformation rule. You can view/edit/use this automatically created rule like any other Henshin rule.
 
Thereupon, you obtain a Henshin module including the necessary meta-model imports as well as the generated transformation rule. You can view/edit/use this automatically created rule like any other Henshin rule.
  
[[File:Henshin rule generation example 3.png|900px]]
+
<gallery mode="packed">
 +
File:Henshin rule generation example 1.png|Applying Henshin Rule Generation to two models
 +
File:Henshin rule generation example 2.png|Selecting the LHS
 +
File:Henshin rule generation example 3.png|Automatically generated rule
 +
</gallery>

Revision as of 06:23, 6 July 2018

Apart from creating Henshin transformation rules from scratch, you can also generate a rule from a pair of models that demonstrates the effect of a transformation.

Generation of transformation rules

In particular, one of the two input models shows the original state, whereas the other model demonstrates the changes made during the transformation. By use of EMF Compare, those two models are first compared with each other in order to identify corresponding elements, i.e., those elements which are considered to be the same in both models. Thereupon, a transformation rule is basically generated as follows: The original model is converted to a Henshin graph and used as the left-hand side (LHS) of the resulting rule, while the Henshin graph obtained from the changed model serves as the right-hand side (RHS). Next, LHS-RHS mappings are created for all node based on pairs of corresponding elements. Eventually, those mappings are used to derive which elements are either preserved, deleted or created in the final Henshin rule.

Applying the Henshin rule generator to models

In the package explorer, select the two models that will serve as an input for the rule generation. Next, right-click on the selection and choose Henshin > Henshin Rule Generation > Create Example-based Transformation Rule.

A window will pop up that asks you to specify the left-hand side of the rule, i.e., the model that demonstrates the original state. The other model will be considered as the changed model from which the right-hand side of the rule is derived.

Thereupon, you obtain a Henshin module including the necessary meta-model imports as well as the generated transformation rule. You can view/edit/use this automatically created rule like any other Henshin rule.

Back to the top