Skip to content
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

Cannot add behaviors to parent composite states #5522

Open
emmby opened this issue May 15, 2024 · 4 comments
Open

Cannot add behaviors to parent composite states #5522

emmby opened this issue May 15, 2024 · 4 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@emmby
Copy link

emmby commented May 15, 2024

Description

You can add a UML-style behavior ("trigger [guard] / action()") to state nodes in diagrams, but you cannot add a behavior to a parent node.

stateDiagram
    Parent: Parent
    Parent: enter [guard] / action()
    [*] --> Parent
    state Parent {
        Child: Child
        Child: trigger [guard] / action()
        [*] --> Child
        Child --> [*]
    }
Loading

Steps to reproduce

See description

Screenshots

Screenshot 2024-05-14 at 6 53 05 PM

Code Sample

No response

Setup

  • Mermaid version:
  • Browser and Version: [Chrome, Edge, Firefox]

Suggested Solutions

No response

Additional Context

Proposed documentation about adding behaviors to state machines: #5512

@emmby emmby added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels May 15, 2024
@emmby emmby changed the title Cannot add behaviors to parent states Cannot add behaviors to parent composite states May 15, 2024
@igorwessel
Copy link
Contributor

@sidharthv96 I would like to try working on this issue if support is desired, but first I want to understand if it makes sense to have a new shape or modify the current cluster shape to support multiple descriptions.

const roundedWithTitle = (parent, node) => {

I noticed that there is this specific shape for the state with description, could we possibly reuse some of the code from there?

export const drawDescrState = (g, stateDef) => {

@sidharthv96
Copy link
Member

Help is always welcome 😇

State diagram is currently undergoing major rework on the rendering part, by @knsv and @ashishjain0512. So it might be a good idea to wait till that's done, or check with them if their refactoring will interfere with the work you're planning.

@igorwessel
Copy link
Contributor

igorwessel commented May 25, 2024

State diagram is currently undergoing major rework on the rendering part, by @knsv and @ashishjain0512. So it might be a > good idea to wait till that's done, or check with them if their refactoring will interfere with the work you're planning.

Ohh thanks! I'll take a look and understand, but I believe it's also better to wait :)

@adamfk
Copy link

adamfk commented Oct 15, 2024

@igorwessel @knsv @ashishjain0512 I think I have a good workaround for this issue here: #5966

Hopefully it is an easy layout fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

4 participants