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/Units"

(Conditional Unit: Fill in missing information.)
(Change style of uniform unit description.)
Line 30: Line 30:
 
[[Image:Henshin_Sequential_Unit.png|right]]
 
[[Image:Henshin_Sequential_Unit.png|right]]
  
; Number of sub-units
+
* '''Number of sub-units:''' arbitrary (0..*)
: arbitrary (0..*)
+
* '''Available Flags/Properties:''' strict, rollback (both of type boolean)
; Available Flags/Properties
+
* '''Execution successful if:'''
: of type boolean
+
** '''strict=true:''' all sub-units successful
:* strict
+
** '''strict=false:''' at least one sub-unit successful or no sub-units existing
:* rollback
+
* '''Execution unsuccessful if:'''
; Execution successful
+
** '''strict=true:''' one sub-unit unsuccessful
: if
+
** '''strict=false:''' none of a non-zero number of sub-units successful
:; strict=true
+
* '''Control flow: ''' The sub-units are executed in the given order.
:: all sub-units successful
+
** '''strict=false, rollback=true/false:''' If one of the sub-units cannot be executed, the next sub-unit is executed.
:; strict=false
+
** '''strict=true, rollback=false:''' If one of the sub-units cannot be executed, the execution stops.
:: at least one sub-unit successful or no sub-units
+
** '''strict=true, rollback=true:''' If one of the sub-units cannot be executed, the execution stops and previous executions are reverted.
; Execution unsuccessful
+
: if
+
:; strict=true  
+
:: one sub-unit unsuccessful
+
:; strict=false
+
:: none of a non-zero number of sub-units successful
+
; 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 ===
 
=== Priority Unit ===
Line 61: Line 47:
 
[[Image:Henshin_Priority_Unit.png|right]]
 
[[Image:Henshin_Priority_Unit.png|right]]
  
; Number of sub-units
+
* '''Number of sub-units:''' arbitrary (0..*)
: arbitrary (0..*)
+
* '''Available Flags/Properties:''' ''none''
; Available Flags/Properties
+
* '''Execution successful if:''' one sub-unit successful
: ''none''
+
* '''Execution unsuccessful if:''' no sub-unit successful
; Execution successful
+
* '''Control flow:''' The sub-units are checked in the given order for executability. The first sub-unit found to be executable is executed.
: one sub-unit successful
+
; Execution unsuccessful
+
: no 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 ===
 
=== Independent Unit ===
Line 76: Line 57:
 
[[Image:Henshin_Independent_Unit.png|right]]
 
[[Image:Henshin_Independent_Unit.png|right]]
  
; Number of sub-units
+
* '''Number of sub-units:''' arbitrary (0..*)
: arbitrary (0..*)
+
* '''Available Flags/Properties:''' ''none''
; Available Flags/Properties
+
* '''Execution successful:''' one sub-unit succesful
: ''none''
+
* '''Execution unsuccessful:''' no sub-unit successful
; Execution successful
+
* '''Control flow:''' The sub-units are checked in nondeterministic order for executability. The first sub-unit found to be executable is executed.
: one sub-unit succesful
+
; Execution unsuccessful
+
: no sub-unit successful
+
; Control flow
+
: The sub-units are checked in nondeterministic order for executability. The first sub-unit found to be executable is executed.
+
  
 
== Unary Units ==
 
== Unary Units ==
Line 93: Line 69:
 
[[Image:Henshin_Loop_Unit.png|right]]
 
[[Image:Henshin_Loop_Unit.png|right]]
  
; Number of sub-units
+
* '''Number of sub-units:''' 1
: 1
+
* '''Available Flags/Properties:''' ''none''
; Available Flags/Properties
+
* '''Execution successful:''' always
: ''none''
+
* '''Execution unsuccessful:''' never
; Execution successful
+
* '''Control flow:''' The sub-unit is executed as often as it is executable.
: always
+
; Execution unsuccessful
+
: never
+
; Control flow
+
: The sub-unit is executed as often as it is executable.
+
  
 
=== Iterated Unit ===
 
=== Iterated Unit ===
Line 108: Line 79:
 
[[Image:Henshin_Iterated_Unit.png|right]]
 
[[Image:Henshin_Iterated_Unit.png|right]]
  
; Number of sub-units
+
* '''Number of sub-units:''' 1
: 1
+
* '''Available Flags/Properties:''' iterations (integer), strict, rollback (both of type boolean)
; Available Flags/Properties
+
* '''Execution successful if:'''
: of type positive integer
+
** '''strict=true:''' all iterations successful
:* iterations
+
** '''strict=false:''' at least one iteration successful
: of type boolean
+
* '''Execution unsuccessful if:'''
:* strict
+
** '''strict=true:''' one iteration unsuccessful
:* rollback
+
** '''strict=false:''' no iteration successful
; Execution successful
+
* '''Control flow:''' The sub-unit is executed as often as specified in the ''iterations'' property.
: if
+
** '''strict=false, rollback=true/false:''' If one of the iterations cannot be executed, the next iteration is executed.
:; strict=true
+
** '''strict=true, rollback=false:''' If one of the iterations cannot be executed, the execution stops.
:: all iterations successful
+
** '''strict=true, rollback=true:''' If one of the iterations cannot be executed, the execution stops and previous executions are reverted.
:; strict=false
+
:: at least one iteration successful
+
; Execution unsuccessful
+
: if
+
:; strict=true  
+
:: one iteration unsuccessful
+
:; strict=false
+
:: no 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 ===
 
=== Conditional Unit ===
Line 141: Line 96:
 
[[Image:Henshin_Conditional_Unit.png|right]]
 
[[Image:Henshin_Conditional_Unit.png|right]]
  
; Number of sub-units
+
* '''Number of sub-units:''' 2 or 3
: 2 or 3
+
* '''Available Flags/Properties:''' ''none''
; Available Flags/Properties
+
* '''Execution successful if:''' ''if'' unit and ''then'' unit are successful or ''if'' unit is unsuccessful while ''then'' unit is successful or not present.
: ''none''
+
* '''Execution unsuccessful if:''' ''if'' unit is successful while ''then'' unit is unsuccessful or ''if'' unit and ''then'' unit are unsuccessful.
; Execution successful
+
* '''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.
: ''if'' unit and ''then'' unit are successful or ''if'' unit is unsuccessful while ''then'' unit is successful or not present.
+
; Execution unsuccessful
+
: ''if'' unit is successful while ''then'' unit is unsuccessful or ''if'' unit and ''then'' unit are unsuccessful.
+
; 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 14:39, 3 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.

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.

Henshin Units Creation GraphicalEditor.pngHenshin Units Add Invocation.png

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.

Henshin Units Creation TreeEditor.png

Multi-Units

Sequential Unit

Henshin Sequential Unit.png
  • 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
  • Execution unsuccessful if:
    • strict=true: one sub-unit unsuccessful
    • strict=false: none of a non-zero number of sub-units successful
  • 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

Henshin Priority Unit.png
  • Number of sub-units: arbitrary (0..*)
  • Available Flags/Properties: none
  • Execution successful if: one sub-unit successful
  • Execution unsuccessful if: no 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

Henshin Independent Unit.png
  • Number of sub-units: arbitrary (0..*)
  • Available Flags/Properties: none
  • Execution successful: one sub-unit succesful
  • Execution unsuccessful: no sub-unit successful
  • 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

Henshin Loop Unit.png
  • Number of sub-units: 1
  • Available Flags/Properties: none
  • Execution successful: always
  • Execution unsuccessful: never
  • Control flow: The sub-unit is executed as often as it is executable.

Iterated Unit

Henshin Iterated Unit.png
  • 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
  • Execution unsuccessful if:
    • strict=true: one iteration unsuccessful
    • strict=false: no 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

Henshin Conditional Unit.png
  • 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.
  • Execution unsuccessful if: if unit is successful while then unit is unsuccessful or if unit and then unit are unsuccessful.
  • 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.

Back to the top