Difference between revisions of "Henshin/Units"
(→Unit creation in graphical editor: Distinct two screenshots from another.) |
(Remove property 'Execution unsuccessful if') |
||
Line 37: | Line 37: | ||
** '''strict=true:''' all sub-units successful | ** '''strict=true:''' all sub-units successful | ||
** '''strict=false:''' at least one sub-unit successful or no sub-units existing | ** '''strict=false:''' at least one sub-unit successful or no sub-units existing | ||
− | |||
− | |||
− | |||
* '''Control flow: ''' The sub-units are executed in the given order. | * '''Control flow: ''' The sub-units are executed in the given order. | ||
** '''strict=false, rollback=true/false:''' If one of the sub-units cannot be executed, the next sub-unit is executed. | ** '''strict=false, rollback=true/false:''' If one of the sub-units cannot be executed, the next sub-unit is executed. | ||
Line 52: | Line 49: | ||
* '''Available Flags/Properties:''' ''none'' | * '''Available Flags/Properties:''' ''none'' | ||
* '''Execution successful if:''' one sub-unit successful | * '''Execution successful if:''' one sub-unit successful | ||
− | |||
* '''Control flow:''' The sub-units are checked in the given order for executability. The first sub-unit found to be executable is executed. | * '''Control flow:''' The sub-units are checked in the given order for executability. The first sub-unit found to be executable is executed. | ||
Line 62: | Line 58: | ||
* '''Available Flags/Properties:''' ''none'' | * '''Available Flags/Properties:''' ''none'' | ||
* '''Execution successful:''' one sub-unit succesful | * '''Execution successful:''' one sub-unit succesful | ||
− | |||
* '''Control flow:''' The sub-units are checked in nondeterministic order for executability. The first sub-unit found to be executable is executed. | * '''Control flow:''' The sub-units are checked in nondeterministic order for executability. The first sub-unit found to be executable is executed. | ||
Line 74: | Line 69: | ||
* '''Available Flags/Properties:''' ''none'' | * '''Available Flags/Properties:''' ''none'' | ||
* '''Execution successful:''' always | * '''Execution successful:''' always | ||
− | |||
* '''Control flow:''' The sub-unit is executed as often as it is executable. | * '''Control flow:''' The sub-unit is executed as often as it is executable. | ||
Line 86: | Line 80: | ||
** '''strict=true:''' all iterations successful | ** '''strict=true:''' all iterations successful | ||
** '''strict=false:''' at least one iteration successful | ** '''strict=false:''' at least one iteration successful | ||
− | |||
− | |||
− | |||
* '''Control flow:''' The sub-unit is executed as often as specified in the ''iterations'' property. | * '''Control flow:''' The sub-unit is executed as often as specified in the ''iterations'' property. | ||
** '''strict=false, rollback=true/false:''' If one of the iterations cannot be executed, the next iteration is executed. | ** '''strict=false, rollback=true/false:''' If one of the iterations cannot be executed, the next iteration is executed. | ||
Line 101: | Line 92: | ||
* '''Available Flags/Properties:''' ''none'' | * '''Available Flags/Properties:''' ''none'' | ||
* '''Execution successful if:''' ''if'' unit and ''then'' unit are successful or ''if'' unit is unsuccessful while ''then'' unit is successful or not present. | * '''Execution successful if:''' ''if'' unit and ''then'' unit are successful or ''if'' unit is unsuccessful while ''then'' unit is successful or not present. | ||
− | |||
* '''Control flow:''' If a match for the ''if'' unit can be found, the ''then'' unit is executed. Otherwise, if present, the ''else'' unit is executed. | * '''Control flow:''' If a match for the ''if'' unit can be found, the ''then'' unit is executed. Otherwise, if present, the ''else'' unit is executed. |
Revision as of 04:10, 6 March 2018
In Henshin, control flow is specified using units. Units have a fixed number of sub-units, allowing for arbitrary nesting. This article describes the available units.
Contents
Usage
Unit creation in graphical editor
To add a unit to a Henshin project in the graphical editor, first open the *.henshin_diagram file. Then select Unit from the Palette on the right of the window. Afterwards left-click any empty space of the Henshin diagram and choose the desired unit from the appearing menu.
If the selected unit is a Multi-Unit, some sub-units have to be added manually. Therefore select Invocation from the Palette and click on the according Multi-Unit. Then type the name of the desired rule or unit.
Unit creation in tree-based editor
To add a unit to a Henshin project in the tree-based editor, first open the *.henshin file. Then right-click on the parent Module. Select New Child and afterwards the desired unit from the context menu. After creation the units can be edited in their Properties view.
Multi-Units
Sequential Unit
- Number of sub-units: arbitrary (0..*)
- Available Flags/Properties: strict, rollback (both of type boolean)
- Execution successful if:
- strict=true: all sub-units successful
- strict=false: at least one sub-unit successful or no sub-units existing
- Control flow: The sub-units are executed in the given order.
- strict=false, rollback=true/false: If one of the sub-units cannot be executed, the next sub-unit is executed.
- strict=true, rollback=false: If one of the sub-units cannot be executed, the execution stops.
- strict=true, rollback=true: If one of the sub-units cannot be executed, the execution stops and previous executions are reverted.
Priority Unit
- Number of sub-units: arbitrary (0..*)
- Available Flags/Properties: none
- Execution successful if: one sub-unit successful
- Control flow: The sub-units are checked in the given order for executability. The first sub-unit found to be executable is executed.
Independent Unit
- Number of sub-units: arbitrary (0..*)
- Available Flags/Properties: none
- Execution successful: one sub-unit succesful
- Control flow: The sub-units are checked in nondeterministic order for executability. The first sub-unit found to be executable is executed.
Unary Units
Loop Unit
- Number of sub-units: 1
- Available Flags/Properties: none
- Execution successful: always
- Control flow: The sub-unit is executed as often as it is executable.
Iterated Unit
- Number of sub-units: 1
- Available Flags/Properties: iterations (integer), strict, rollback (both of type boolean)
- Execution successful if:
- strict=true: all iterations successful
- strict=false: at least one iteration successful
- Control flow: The sub-unit is executed as often as specified in the iterations property.
- strict=false, rollback=true/false: If one of the iterations cannot be executed, the next iteration is executed.
- strict=true, rollback=false: If one of the iterations cannot be executed, the execution stops.
- strict=true, rollback=true: If one of the iterations cannot be executed, the execution stops and previous executions are reverted.
Conditional Unit
- Number of sub-units: 2 or 3
- Available Flags/Properties: none
- Execution successful if: if unit and then unit are successful or if unit is unsuccessful while then unit is successful or not present.
- Control flow: If a match for the if unit can be found, the then unit is executed. Otherwise, if present, the else unit is executed.