Mermaid: SequenceDiagram: 3+ Alternative Paths

Created on 4 May 2016  路  3Comments  路  Source: mermaid-js/mermaid

Overview

Is it possible to have multiple alternate paths in a sequence diagram?

e.g. If A then X, else if B then Y, else if C then Z.

If not (and my tests to do so failed), is this functionality that it makes sense to add?
Example below.

Example

sequenceDiagram
Participant alpha
Participant bravo
alpha->>bravo: request resource
alt has resource
    bravo->>alpha: return resource
else does not have resource
    bravo->>charlie: request resource
else resource blacklisted
    bravo->>alpha: return error message
end

Edit: Initially posted the wrong example.

Most helpful comment

Sorry that is currently not possible

You can do single else statements though as in the example:
http://knsv.github.io/mermaid/#alt

And... Yes it would make sense to add it. I would welcome a pull request with this. 馃憤

All 3 comments

Sorry that is currently not possible

You can do single else statements though as in the example:
http://knsv.github.io/mermaid/#alt

And... Yes it would make sense to add it. I would welcome a pull request with this. 馃憤

I've got the javascript skills of a toddler, but I will look into this in the future, time permitting.

@sechel sent a PR to add this feature!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tokyo786 picture tokyo786  路  3Comments

chen4221 picture chen4221  路  3Comments

lth946965333 picture lth946965333  路  3Comments

vikram-rawat picture vikram-rawat  路  5Comments

erelling picture erelling  路  3Comments