Skip to content

Commit

Permalink
[doc] Contribute a shape for precondition support for tools.
Browse files Browse the repository at this point in the history
Signed-off-by: Florian ROUËNÉ <florian.rouene@obeosoft.com>
  • Loading branch information
frouene authored and pcdavid committed Sep 1, 2023
1 parent 2148626 commit cfccbf4
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
=== Shapes

- Add tool sections in the View DSL
- Add support for Precondition Expressions in Tools

=== Architectural decision records

Expand Down
41 changes: 41 additions & 0 deletions doc/iterations/2023.10/shapes/add_precondition_on_tool.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
= (S) Add precondition on tool

== Problem

Today a specifier can add tools to the palette of a diagram description, but it's not possible to determine when the tool should be available or not.

== Key Result

Offers a specifier the ability to declare precondition on tools.
Tools are only accessible if their preconditions are interpreted as true.

== Solution

Add in the view DSL, a precondition expression to the tool EClass.
Before retrieve the list of tools in `GetToolSectionsEventHandler`, interpret this expression to determine if the tool must be added to the palette.
If there is no precondition set, the tool is always added to the palette.
The only variables given for the precondition interpretation are:

* _self_: the target object
* _selectedNode_: the diagram element if it's a node
* _selectedEdge_: the diagram element if it's an edge

=== Scenario

* The specifier adds a new tool to a palette and sets a precondition expression.
* When users open the diagram representation, they only have access to the tool if its precondition is evaluated to true.

=== Breadboarding

Example of the `Precondition Expression` for a Tool

image::images/add_precondition_on_tool_01.png[precondition_expression_properties]

=== Cutting backs

== Rabbit holes

* This feature only impacts backend, thus it will be available for both diagram representations (legacy and react_flow).

== No-gos

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cfccbf4

Please sign in to comment.