Skip to content

Commit f27b22c

Browse files
committed
fix: The execution details of the tool workflow cannot be displayed
1 parent f93d7e3 commit f27b22c

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

apps/application/flow/i_step_node.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ def __init__(self, node, workflow_params, workflow_manage, up_node_id_list=None,
298298
node.id]))),
299299
"utf-8")).hexdigest() + (
300300
"__" + str(salt) if salt is not None else '')
301+
self.extra = {}
301302

302303
def valid_args(self, node_params, flow_params):
303304
flow_params_serializer_class = self.get_flow_params_serializer_class()

apps/application/flow/step_node/tool_workflow_lib_node/impl/base_tool_workflow_lib_node.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,14 @@ def write_context_stream(node_variable: Dict, workflow_variable: Dict, node: INo
115115
child_answer_data = get_answer_list(instance, child_node_node_dict, node.runtime_node_id)
116116
node.context['usage'] = {'usage': usage}
117117
node.context['child_node'] = node_child_node
118-
node.context['child_node_data'] = instance.get_runtime_details()
118+
node.context['details'] = instance.get_runtime_details()
119119
node.context['is_interrupt_exec'] = is_interrupt_exec
120-
node.context['child_node_data'] = instance.get_runtime_details()
121120
node.context['child_answer_data'] = child_answer_data
122121
node.context['run_time'] = time.time() - node.context.get("start_time")
122+
node.extra['input_field_list'] = instance.get_input_field_list()
123+
node.extra['output_field_list'] = instance.get_output_field_list()
124+
node.extra['input'] = instance.get_input()
125+
node.extra['output'] = instance.out_context
123126
for key, value in instance.out_context.items():
124127
node.context[key] = value
125128

@@ -144,9 +147,15 @@ def get_parameters(self, input_field_list):
144147

145148
def save_context(self, details, workflow_manage):
146149
self.context['child_answer_data'] = details.get('child_answer_data')
147-
self.context['child_node_data'] = details.get('child_node_data')
150+
self.context['details'] = details.get('details')
151+
self.extra['input_field_list'] = details.get('input_field_list')
152+
self.extra['output_field_list'] = details.get('input_field_list')
153+
self.extra['input'] = details.get('input')
154+
self.extra['output'] = details.get('output')
148155
self.context['result'] = details.get('result')
149156
self.context['exception_message'] = details.get('err_message')
157+
for key, value in (details.get('output') or {}).items():
158+
self.context[key] = value
150159
if self.node_params.get('is_result'):
151160
self.answer_text = str(details.get('result'))
152161

@@ -210,7 +219,11 @@ def get_details(self, index: int, **kwargs):
210219
'run_time': self.context.get('run_time'),
211220
'type': self.node.type,
212221
'status': self.status,
213-
'child_node_data': self.context.get("child_node_data"),
222+
'input': self.extra.get('input'),
223+
'output': self.extra.get('output'),
224+
'input_field_list': self.extra.get('input_field_list'),
225+
'output_field_list': self.extra.get('output_field_list'),
226+
'details': self.context.get("details"),
214227
'child_answer_data': self.context.get("child_answer_data"),
215228
'err_message': self.err_message,
216229
'enableException': self.node.properties.get('enableException'),

0 commit comments

Comments
 (0)