# coding=utf-8 """验证 Main.seq 并展示流程""" import json data = json.load(open(r'd:\RPA\AutoRpa\Main.seq', 'r', encoding='utf-8')) nodes = data['NodeList'] lines = data['LineList'] print(f"节点总数: {len(nodes)}") print(f"连线总数: {len(lines)}") print() print("=" * 70) print(" 合同建单 (CONTRACT_CREATE) 流程图") print("=" * 70) print() for i, n in enumerate(nodes): ui = n['NodeUI'] subtype = ui['NodeSubType'].replace('EnumWidget_Begin', 'START').replace('EnumWidget_Code_Custom', 'CODE') title = ui['NodeTitle'] print(f" [{subtype:6s}] {title}") print() print("=" * 70) print(" 连线关系 (按序执行)") print("=" * 70) for i, l in enumerate(lines): fr = l['LineStart']['Pidx'].split('/')[0][-6:] to = l['LineEnd']['Pidx'].split('/')[0][-6:] fr_node = next((n for n in nodes if n['NodeUI']['NodeTag'].endswith(fr)), None) to_node = next((n for n in nodes if n['NodeUI']['NodeTag'].endswith(to)), None) fr_title = fr_node['NodeUI']['NodeTitle'] if fr_node else fr to_title = to_node['NodeUI']['NodeTitle'] if to_node else to print(f" [{fr_title}] --> [{to_title}]") print() print("=" * 70) print(" 运行说明") print("=" * 70) print(" 1. 在 APA Studio 中按 Ctrl+R 运行流程") print(" 2. S01 节点会初始化所有模块和上下文") print(" 3. S02-S15 节点依次执行合同建单各步骤") print(" 4. 输出面板显示每步执行状态")