flowchart.js icon indicating copy to clipboard operation
flowchart.js copied to clipboard

Can a decision has 3 options

Open jaishin opened this issue 9 years ago • 6 comments

It seems just yes/no decision, is it possible a one/two/three decision?

jaishin avatar Sep 03 '15 16:09 jaishin

unfortunately no...

adrai avatar Sep 04 '15 05:09 adrai

how to support more than two decision? now it is only yes and no

ekoz avatar Dec 16 '15 08:12 ekoz

Enhancing flowchart.js to support N options from a conditional would make this useable in a much greater number of instances. As it is now, the limit to 2 branches per condition makes it unsuitable for any project I have ever worked on.

Is there an outline of a plan for adding more branches to a condition that someone could pick up and complete, then submit a pull request for?

dholcombe avatar May 11 '16 16:05 dholcombe

You are more than welcome to provide a pull request. An interesting challenge to solve is the visual. A decision is a diamond, one point is entry, so you might have 3 points for exit and you have the challenge of visualizing. Any switch statement at the end is a series of yes/no statements, so you can already render any workflow with it.

Stwissel avatar May 12 '16 10:05 Stwissel

@dholcombe I have cases for "more than yes / no" and I've simply used multiple decision to decide if this is option 1, option 2, option 3, etc it makes a bigger tree but there isn't anything I don't think can be shown... obviously if you have something really really complicated then you'd need something equally more complex

barry-bookinglive avatar Oct 30 '16 12:10 barry-bookinglive

Hello. Any implementation was added to the master? I need to add multiple decisions too. I haven't enough time to update it, however I would like to share a solution basically like following:

c2=>condition: Good idea|rejected
c2(true)->io->e
c2(false)->e
c2=>condition: Good idea|approved
c2(false)->st

Shortly, if we have a component defined same name before, the library can make same location of the copied second (if you like fourth) component and the oldest one. To use this structure, it can be allowed to define variables with same component type, if types will be changed, components except for firstly defined must be rejected.

Serif-NNR avatar Nov 16 '22 10:11 Serif-NNR