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

History child of parallel state not rendering correctly #112

Closed
joeriexelmans opened this issue Mar 3, 2020 · 6 comments · Fixed by #113
Closed

History child of parallel state not rendering correctly #112

joeriexelmans opened this issue Mar 3, 2020 · 6 comments · Fixed by #113
Labels
Projects

Comments

@joeriexelmans
Copy link

Expected Behavior

In the following state machine:

initial,
outer,
parallel {
  s1 {
    s11 -> s12;
  },
  s2 {
    s21 -> s22;
  },
  history;
};

initial -> parallel;
parallel -> outer;
outer -> history;

The history state is expected to show up as a child of the parallel state...

Current Behavior

Instead, the history state is rendered incorrectly and shows up next to the parallel state:
image

If the history state is not mentioned in any transition, it is not rendered at all.

Steps to Reproduce (for bugs)

Whenever a parallel state has a history child, the problem occurs.

Context

For my purposes, history states should be allowed to be children of parallel states.

Your Environment

Ubuntu 19.10.
state-machine-cat 6.0.1 from NPM.
Node 10.15.2 (from Ubuntu repository)

Exact same problem with the online version: https://state-machine-cat.js.org/

@sverweij sverweij added the bug label Mar 3, 2020
@sverweij sverweij added this to Backlog in Roadmap via automation Mar 3, 2020
@sverweij
Copy link
Owner

sverweij commented Mar 3, 2020

hi @joeriexelmans thanks for raising this issue - it seems you've bumped into a bug. I've reproduced it and have found a likely root cause. I hope to fix it over the coming days - I'll keep you posted in this thread.

@sverweij
Copy link
Owner

sverweij commented Mar 3, 2020

@joeriexelmans Found a fix quicker than anticipated - I've put it up on https://sverweij.gitlab.io/state-machine-cat/ and published it on npm with the beta tag (state-machine-cat@v6.0.4-beta-2).

=> Could you verify if it works for your original use case as well?

I'll publish to the regular npm/ state-machine-cat.js.org and the atom package later this week.

B.t.w. Thanks for your excellent bug description - it helped a lot in narrowing down the fix. Your example now renders like this:

state-machine-2020-03-03T19_34_13 507Z

@sverweij sverweij moved this from Backlog to doing in Roadmap Mar 3, 2020
@joeriexelmans
Copy link
Author

Hi @sverweij ! Thank you very much for the quick response.
I can confirm your fix is working for my original use case.

Roadmap automation moved this from doing to released Mar 5, 2020
@sverweij
Copy link
Owner

sverweij commented Mar 5, 2020

hi @joeriexelmans thanks for testing & getting back! I've published version 6.0.4 to npm and state-machine-cat.js.org (the atom package will follow later)

@joeriexelmans
Copy link
Author

joeriexelmans commented Mar 26, 2020

@sverweij By the way, if you are interested in a bunch of statecharts that I rendered, you can have a look at this directory of this branch of this repository:
https://msdl.uantwerpen.be/git/simon/SCCD/src/joeri/test/test_files
Most images look pretty OK. They will look better when Graphviz' dot starts natively supporting true edges between clusters :)

The project I'm working on is my master thesis: A statechart interpreter with configurable semantic variability (see http://msdl.cs.mcgill.ca/people/joeri/10_Thesis). The input format uses XML and based on SCXML, but differs in some ways. To render statecharts, the input format is loaded to an internal state tree representation (which serves as input to the interpreter), and this tree is then converted to your 'smcat' format in a dirty script.

Statecharts written in XML are difficult to read, especially since I'm dealing with many different XML files that serve as tests to the interpreter. It's a huge help being able to render my statecharts.

@sverweij
Copy link
Owner

@joeriexelmans o wow that looks like cool master thesis. Thanks for sharing this!

render.py is the conversion script?

I'm still looking for an alternative to GraphViz that has the capabilities needed for state machines, but that look better (so pretty OK gets to wow that's nice!) and have better native web support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Roadmap
  
released
Development

Successfully merging a pull request may close this issue.

2 participants