Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Henshin/Parameters"
(Create page with missing content in the late sections) |
(→Parameter mapping: Add screenshots and precise text.) |
||
Line 72: | Line 72: | ||
=== Parameter mapping === | === Parameter mapping === | ||
− | + | [[File:Henshin ParameterMapping Creation TreeEditor.png|600px]] | |
− | + | ||
− | You can define parameter mappings to pass parameters between | + | You can define parameter mappings to pass parameters between a unit and its sub-unit(s). |
− | + | A mappings is implicitly defined when using the same name for two parameters. | |
Mappings for parameters with different names can be created manually using the tree-based editor. | Mappings for parameters with different names can be created manually using the tree-based editor. | ||
− | Therefore right-click the unit | + | Therefore right-click the unit and select ''New Child → Parameter Mapping''. |
The mapping can be edited using its ''Properties'' view. | The mapping can be edited using its ''Properties'' view. | ||
+ | |||
+ | [[File:Henshin ParameterMapping Editing PropertiesView.png]] | ||
== Usage during execution == | == Usage during execution == |
Revision as of 18:45, 5 April 2018
Parameters allow to shape the behavior of units, including rules, with variable information. A unit can have an arbitary number of parameters. Parameters have a name, a description, a kind, and, optionally, a type.
Contents
Parameter kinds
The kind specifies the time when the parameter is bound to a concrete value, and whether the parameter is intended to be accessed after the unit has been applied. There are four parameter kinds (in, out, inout, var) and an additional legacy parameter kind (unknown)
Parameter kind | IN | OUT | INOUT | VAR | UNKOWN |
---|---|---|---|---|---|
settable before application | x | x | x | ||
settable during application | x | x | x | ||
readable after application | x | x | x |
Usage during definition
Parameters can be created using the tree-based or the graphical editor. They can be edited using the latter or the Properties view.
Parameter creation and editing in graphical editor
To create or edit a parameter with the graphical editor open the according *.henshin_diagram file. Select the name of a unit or rule by clicking on it. Click a second time to edit the title. You can now text-based add, edit and remove parameters which follow the unit/rule name -- encompassed by parentheses and separated by commas. The parameter entries adhere to the following scheme: <kind> <name>:<type> .
Parameter creation in tree-based editor
To create a parameter with the tree-based editor open the according *.henshin-file. Right-click on the desired rule or unit and navigate to New Child → Parameter. You can continue with editing the parameter in its Properties view.
Parameter editing in properties view
In the Properties view you can edit a parameter after selecting it in the tree-based editor. To edit a value click in the according row of the Value column.
Parameter mapping
You can define parameter mappings to pass parameters between a unit and its sub-unit(s). A mappings is implicitly defined when using the same name for two parameters. Mappings for parameters with different names can be created manually using the tree-based editor. Therefore right-click the unit and select New Child → Parameter Mapping. The mapping can be edited using its Properties view.
Usage during execution
Before unit or rule execution parameters of kind in and inout have to be set. Parameters of kind unknown may be set depending on their usage in their units/rules. This can be done using the Interpreter Wizard or the API.
Interpreter Wizard
<Bild von Eingabemaske Interpreter Wizard>
API