Skip to content

Add a creation tool of State sub actions with referenced action inside State elements #1233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jerome-obeo opened this issue Apr 17, 2025 · 0 comments · Fixed by #1236
Closed

Comments

@jerome-obeo
Copy link
Contributor

jerome-obeo commented Apr 17, 2025

State subactions (entry, do, or exit) may reference existing actions.

Here is an example of such a reference:

part flashlight {

      perform ActionTree::produceDirectedLight;
      
      state on {
          // define the do action by referring to (actually subsetting)
          // the action above 'perfrom ActionTree::produceDirectedLight'
          do produceDirectedLight;
      }
}

Descision

We need to add new tools to create subactions of StateUsage and StateDefinition that allow to select existing ActionUsage to reference to.
New node tools should have a precondition that limits only one occurrence of each kind of subaction.

Semantic structure

Subactions should be linked to the State through a StateSubactionMembership which holds the kind to designate the actual subaction (Entry, Do, Exit).
This membership owns the PerformActionUsage of the subaction itself.
When the subaction is referencing another action, it owns a ReferenceSubsetting that holds the referenced action.

Impact on existing tools

Currently, there are tools New Entry Action, New Do Action, and New Exit Action on a StateUsage or StateDefinition that create ActionUsage elements instead of PerformActionUsage ones.
Therefore, these tools should be modified to be aligned with Pilot and syside implementations.

Nevertheless, the specification textual BNF says that when a sub action is an empty action, in this case it is an ActionUsage (empty):

StateActionUsage : ActionUsage =
      EmptyActionUsage ';'
      | StatePerformActionUsage
      | StateAcceptActionUsage
      | StateSendActionUsage
      | StateAssignmentActionUsage

EmptyActionUsage : ActionUsage =
      {}
      state on {
          // define an empty do action
          do ;
      }

To create such empty actions, we would need to add new tools to create empty ActionUsage

@AxelRICHARD AxelRICHARD added this to the 2025.6.0 milestone Apr 17, 2025
@jerome-obeo jerome-obeo changed the title Add support of referenced action inside State sub actions Add a creation tool of State sub actions with referenced action inside State elements Apr 18, 2025
jerome-obeo added a commit to jerome-obeo/syson that referenced this issue Apr 18, 2025
jerome-obeo added a commit to jerome-obeo/syson that referenced this issue Apr 18, 2025
jerome-obeo added a commit to jerome-obeo/syson that referenced this issue Apr 18, 2025
jerome-obeo added a commit to jerome-obeo/syson that referenced this issue Apr 18, 2025
jerome-obeo added a commit to jerome-obeo/syson that referenced this issue Apr 18, 2025
@AxelRICHARD AxelRICHARD linked a pull request Apr 22, 2025 that will close this issue
12 tasks
jerome-obeo added a commit to jerome-obeo/syson that referenced this issue Apr 28, 2025
AxelRICHARD pushed a commit that referenced this issue Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment