pyflowchart
pyflowchart copied to clipboard
How can a ConditionNode deal with 3 conditions
Here's my demo:
1,StartNode connect OperationNode("step1") 2,OperationNode("step1") connect ConditionNode 3.1,ConditionNode connect_yes OperationNode("step2") 3.2,ConditionNode connect_no OperationNode("step1") 3.3 ConditionNode (how to)connect EndNode
I am sorry but a multi-branch condition node is not yet supported by the depended flowchart.js. See https://github.com/adrai/flowchart.js/issues/60 and https://github.com/adrai/flowchart.js/issues/101 . So pyflowchart will be unable to deal with your case now.
As a quick fix, you can use two (or more) nested condition nodes :
if exp1 {
// branch 1
} else {
if exp2 {
// branch2
}
else {
// branch3
}
}