docs(samples): add config example for If-Else node
- Provide a sample configuration for the If-Else workflow node. - Helps users understand how to define conditional branches.
This commit is contained in:
@@ -73,49 +73,43 @@ class IfElseNodeConfig(BaseNodeConfig):
|
|||||||
"examples": [
|
"examples": [
|
||||||
{
|
{
|
||||||
"cases": [
|
"cases": [
|
||||||
# if/CASE1
|
# CASE1 / IF Branch
|
||||||
{
|
{
|
||||||
"logical_operator": "and",
|
"logical_operator": "and",
|
||||||
"conditions": [
|
"conditions": [
|
||||||
{
|
{
|
||||||
"left": "sys.message",
|
{
|
||||||
"comparison_operator": "eq",
|
"left": "node.userinput.message",
|
||||||
"right": "'test'"
|
"comparison_operator": "eq",
|
||||||
|
"right": "'123'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"left": "node.userinput.test",
|
||||||
|
"comparison_operator": "eq",
|
||||||
|
"right": "True"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
]
|
# CASE1 / ELIF Branch
|
||||||
},
|
|
||||||
{
|
|
||||||
"case_number": 3,
|
|
||||||
"cases": [
|
|
||||||
# if/CASE1
|
|
||||||
{
|
{
|
||||||
"logic": "or",
|
"logical_operator": "or",
|
||||||
"conditions": [
|
"conditions": [
|
||||||
{
|
{
|
||||||
"left": "sys.message",
|
{
|
||||||
"comparison_operator": "eq",
|
"left": "node.userinput.test",
|
||||||
"right": "'test'"
|
"comparison_operator": "eq",
|
||||||
|
"right": "False"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"left": "node.userinput.message",
|
||||||
|
"comparison_operator": "contains",
|
||||||
|
"right": "'123'"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
# elif/CASE2
|
# CASE3 / ELSE Branch
|
||||||
{
|
|
||||||
"logic": "and",
|
|
||||||
"conditions": [
|
|
||||||
{
|
|
||||||
"left": "sys.message",
|
|
||||||
"comparison_operator": "eq",
|
|
||||||
"right": "'test'"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"left": "sys.message",
|
|
||||||
"comparison_operator": "contains",
|
|
||||||
"right": "'test'"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user