Skip to content

Add support for execution specifications #156

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

Open
Andrew-Dunn opened this issue Jul 18, 2016 · 5 comments
Open

Add support for execution specifications #156

Andrew-Dunn opened this issue Jul 18, 2016 · 5 comments

Comments

@Andrew-Dunn
Copy link

It would be great if support would be added for execution specifications, which are the thin grey rectangles which identify the beginning and end of an action being executed. Ideally we could support overlapping execution specifications too.

In websequencediagrams.com, the syntax used to denote execution specifications is by prepending the target actor with a + or -, so the following sequence:

Bob->+Alice: Say Hello
note right of Alice: Process salutation.
Alice->-Bob: Say Goodbye.

Would be rendered like this:

Image

I personally don't think this is a great syntax as when ending an execution you are using the - character on the other actor, which doesn't make a whole lot of sense. This also makes it impossible to do things like ending an execution on one lifeline and immediately beginning a new execution specification on the target actor, which is common with asynchronous communications.

So I'm proposing we instead prepend the + or - modifier to the lifeline/actor which is actually being modified, always, so the above example would actually be written as:

Bob->+Alice: Say Hello
note right of Alice: Process salutation.
-Alice->Bob: Say Goodbye.

Cheers!

@Andrew-Dunn
Copy link
Author

Andrew-Dunn commented Jul 18, 2016

I'm currently working on an implementation of this using my proposed syntax. I may do a simpler enhancement to learn the codebase before attempting it though. (probably won't)

@bramp
Copy link
Owner

bramp commented Jul 18, 2016 via email

@Andrew-Dunn
Copy link
Author

Andrew-Dunn commented Jul 18, 2016

Progress so far, the following code generates the given sequence diagram:

Bob->+Alice: Say "Hello".
+Alice->-Alice: Process salutation.
-Alice->+Bob: Say "Goodbye".
note right of Bob: Reflect on life

TODO

  • Offset signal start and end x co-ords based on execution specification depth
  • Offset self signal based on execution spec depth
  • Defer signal drawing to after execution specifications (at the moment my implementation uses the y positions calculated during signal drawing).
  • Write unit tests
  • Refactor

@bramp Do you have any preferences when it comes to code style, esp with regard to line length?

@Andrew-Dunn
Copy link
Author

Andrew-Dunn commented Jul 19, 2016

Unit/regression tests written. All that's left is to fix this rendering bug related to self signals that both end and begin an ExecutionSpecification, as well as bringing the code up to scratch for a PR.

screen shot 2016-07-20 at 8 09 55 am

@bramp
Copy link
Owner

bramp commented Jul 19, 2016

"@bramp Do you have any preferences when it comes to code style, esp with regard to line length?" no real preference, but keep it reasonable <80-120 ish.

However, please run make lint as that should catch most of the things I care about.

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

No branches or pull requests

2 participants