mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 07:35:53 +08:00
Fix if_else node compatibility with historical workflows. (#6186)
This commit is contained in:
parent
678ad6b7eb
commit
0e82072323
@ -60,6 +60,8 @@ class IfElseNode(BaseNode):
|
|||||||
|
|
||||||
final_result = all(group_result) if node_data.logical_operator == "and" else any(group_result)
|
final_result = all(group_result) if node_data.logical_operator == "and" else any(group_result)
|
||||||
|
|
||||||
|
selected_case_id = "true" if final_result else "false"
|
||||||
|
|
||||||
process_datas["condition_results"].append(
|
process_datas["condition_results"].append(
|
||||||
{
|
{
|
||||||
"group": "default",
|
"group": "default",
|
||||||
@ -78,11 +80,7 @@ class IfElseNode(BaseNode):
|
|||||||
error=str(e)
|
error=str(e)
|
||||||
)
|
)
|
||||||
|
|
||||||
outputs = {
|
outputs = {"result": final_result, "selected_case_id": selected_case_id}
|
||||||
"result": final_result
|
|
||||||
}
|
|
||||||
if node_data.cases:
|
|
||||||
outputs["selected_case_id"] = selected_case_id
|
|
||||||
|
|
||||||
data = NodeRunResult(
|
data = NodeRunResult(
|
||||||
status=WorkflowNodeExecutionStatus.SUCCEEDED,
|
status=WorkflowNodeExecutionStatus.SUCCEEDED,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user