{ "schemaVersion": 1, "id": "test_appsystem_07", "name": "组件测试 07 · 命令行", "description": "查看运行日志中的用例结果;有失败时任务最终显示失败,其他用例仍继续。", "enabled": true, "trigger": { "type": "manual", "label": "手动运行" }, "variables": [], "nodes": [ { "id": "t07_1", "componentId": "Trigger.Manual", "label": "人工发起", "position": { "x": 220, "y": 80 }, "values": { "entryName": "开始组件测试" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false } }, { "id": "t07_2", "componentId": "Basic_SetVariable", "label": "初始化失败计数", "position": { "x": 220, "y": 222 }, "values": { "value": 0 }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "failures" } }, { "id": "t07_3", "componentId": "Basic_SetVariable", "label": "初始化待确认计数", "position": { "x": 220, "y": 364 }, "values": { "value": 0 }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "pending" } }, { "id": "t07_4", "componentId": "Basic_SetVariable", "label": "初始化阻塞计数", "position": { "x": 220, "y": 506 }, "values": { "value": 0 }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "blocked" } }, { "id": "t07_5", "componentId": "logic_control_try_catch", "label": "07-01 · System_ExecuteCommand", "position": { "x": 220, "y": 648 }, "values": {}, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false } }, { "id": "t07_6", "componentId": "System_ExecuteCommand", "label": "System_ExecuteCommand", "position": { "x": 220, "y": 980 }, "values": { "action": "Write-Output 'RPA-PS-中文-OK'" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "actual_1" }, "parentId": "t07_5", "slot": "try_fn" }, { "id": "t07_7", "componentId": "Basic_SetVariable", "label": "记录实际值与判定", "position": { "x": 220, "y": 980 }, "values": { "value": "${[\"07-01\", \"System_ExecuteCommand\", (actual_1 === \"RPA-PS-中文-OK\") ? \"PASS\" : \"FAIL\", \"{\\\"action\\\":\\\"Write-Output 'RPA-PS-中文-OK'\\\"}\", \"RPA-PS-中文-OK\", actual_1]}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "case_1" }, "parentId": "t07_5", "slot": "try_fn" }, { "id": "t07_8", "componentId": "Basic_SetVariable", "label": "累计失败数", "position": { "x": 220, "y": 980 }, "values": { "value": "${failures + (case_1[2] === \"FAIL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "failures" }, "parentId": "t07_5", "slot": "try_fn" }, { "id": "t07_9", "componentId": "Basic_SetVariable", "label": "累计待人工确认数", "position": { "x": 220, "y": 980 }, "values": { "value": "${pending + (case_1[2] === \"MANUAL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "pending" }, "parentId": "t07_5", "slot": "try_fn" }, { "id": "t07_10", "componentId": "Basic_SetVariable", "label": "记录异常结果", "position": { "x": 220, "y": 980 }, "values": { "value": "${[\"07-01\", \"System_ExecuteCommand\", \"FAIL\", \"{\\\"action\\\":\\\"Write-Output 'RPA-PS-中文-OK'\\\"}\", \"RPA-PS-中文-OK\", error.reason]}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "case_1" }, "parentId": "t07_5", "slot": "except_fn" }, { "id": "t07_11", "componentId": "Basic_SetVariable", "label": "异常累计失败数", "position": { "x": 220, "y": 980 }, "values": { "value": "${failures + (case_1[2] === \"FAIL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "failures" }, "parentId": "t07_5", "slot": "except_fn" }, { "id": "t07_12", "componentId": "Basic_SetVariable", "label": "异常累计待确认数", "position": { "x": 220, "y": 980 }, "values": { "value": "${pending + (case_1[2] === \"MANUAL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "pending" }, "parentId": "t07_5", "slot": "except_fn" }, { "id": "t07_13", "componentId": "Log_Info", "label": "输出测试结果", "position": { "x": 220, "y": 1290 }, "values": { "msg": "用例结果:${json(case_1)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false } }, { "id": "t07_14", "componentId": "logic_control_try_catch", "label": "07-02 · System_ExecuteCommandV1", "position": { "x": 220, "y": 1432 }, "values": {}, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false } }, { "id": "t07_15", "componentId": "System_ExecuteCommandV1", "label": "System_ExecuteCommandV1", "position": { "x": 220, "y": 1340 }, "values": { "command_type": "1", "dos_command": "echo RPA-DOS-OK", "get_ret": "1" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "actual_2" }, "parentId": "t07_14", "slot": "try_fn" }, { "id": "t07_16", "componentId": "Basic_SetVariable", "label": "记录实际值与判定", "position": { "x": 220, "y": 1340 }, "values": { "value": "${[\"07-02\", \"System_ExecuteCommandV1\", (actual_2 === \"RPA-DOS-OK\") ? \"PASS\" : \"FAIL\", \"{\\\"command_type\\\":\\\"1\\\",\\\"dos_command\\\":\\\"echo RPA-DOS-OK\\\",\\\"get_ret\\\":\\\"1\\\"}\", \"RPA-DOS-OK\", actual_2]}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "case_2" }, "parentId": "t07_14", "slot": "try_fn" }, { "id": "t07_17", "componentId": "Basic_SetVariable", "label": "累计失败数", "position": { "x": 220, "y": 1340 }, "values": { "value": "${failures + (case_2[2] === \"FAIL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "failures" }, "parentId": "t07_14", "slot": "try_fn" }, { "id": "t07_18", "componentId": "Basic_SetVariable", "label": "累计待人工确认数", "position": { "x": 220, "y": 1340 }, "values": { "value": "${pending + (case_2[2] === \"MANUAL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "pending" }, "parentId": "t07_14", "slot": "try_fn" }, { "id": "t07_19", "componentId": "Basic_SetVariable", "label": "记录异常结果", "position": { "x": 220, "y": 1340 }, "values": { "value": "${[\"07-02\", \"System_ExecuteCommandV1\", \"FAIL\", \"{\\\"command_type\\\":\\\"1\\\",\\\"dos_command\\\":\\\"echo RPA-DOS-OK\\\",\\\"get_ret\\\":\\\"1\\\"}\", \"RPA-DOS-OK\", error.reason]}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "case_2" }, "parentId": "t07_14", "slot": "except_fn" }, { "id": "t07_20", "componentId": "Basic_SetVariable", "label": "异常累计失败数", "position": { "x": 220, "y": 1340 }, "values": { "value": "${failures + (case_2[2] === \"FAIL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "failures" }, "parentId": "t07_14", "slot": "except_fn" }, { "id": "t07_21", "componentId": "Basic_SetVariable", "label": "异常累计待确认数", "position": { "x": 220, "y": 1340 }, "values": { "value": "${pending + (case_2[2] === \"MANUAL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "pending" }, "parentId": "t07_14", "slot": "except_fn" }, { "id": "t07_22", "componentId": "Log_Info", "label": "输出测试结果", "position": { "x": 220, "y": 2074 }, "values": { "msg": "用例结果:${json(case_2)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false } }, { "id": "t07_23", "componentId": "logic_control_try_catch", "label": "07-03 · System_ExecuteCommandV1", "position": { "x": 220, "y": 2216 }, "values": {}, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false } }, { "id": "t07_24", "componentId": "System_ExecuteCommandV1", "label": "System_ExecuteCommandV1", "position": { "x": 220, "y": 1700 }, "values": { "command_type": "3", "ps_command": "Write-Output 'RPA-PS-V1-OK'", "get_ret": "1" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "actual_3" }, "parentId": "t07_23", "slot": "try_fn" }, { "id": "t07_25", "componentId": "Basic_SetVariable", "label": "记录实际值与判定", "position": { "x": 220, "y": 1700 }, "values": { "value": "${[\"07-03\", \"System_ExecuteCommandV1\", (actual_3 === \"RPA-PS-V1-OK\") ? \"PASS\" : \"FAIL\", \"{\\\"command_type\\\":\\\"3\\\",\\\"ps_command\\\":\\\"Write-Output 'RPA-PS-V1-OK'\\\",\\\"get_ret\\\":\\\"1\\\"}\", \"RPA-PS-V1-OK\", actual_3]}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "case_3" }, "parentId": "t07_23", "slot": "try_fn" }, { "id": "t07_26", "componentId": "Basic_SetVariable", "label": "累计失败数", "position": { "x": 220, "y": 1700 }, "values": { "value": "${failures + (case_3[2] === \"FAIL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "failures" }, "parentId": "t07_23", "slot": "try_fn" }, { "id": "t07_27", "componentId": "Basic_SetVariable", "label": "累计待人工确认数", "position": { "x": 220, "y": 1700 }, "values": { "value": "${pending + (case_3[2] === \"MANUAL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "pending" }, "parentId": "t07_23", "slot": "try_fn" }, { "id": "t07_28", "componentId": "Basic_SetVariable", "label": "记录异常结果", "position": { "x": 220, "y": 1700 }, "values": { "value": "${[\"07-03\", \"System_ExecuteCommandV1\", \"FAIL\", \"{\\\"command_type\\\":\\\"3\\\",\\\"ps_command\\\":\\\"Write-Output 'RPA-PS-V1-OK'\\\",\\\"get_ret\\\":\\\"1\\\"}\", \"RPA-PS-V1-OK\", error.reason]}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "case_3" }, "parentId": "t07_23", "slot": "except_fn" }, { "id": "t07_29", "componentId": "Basic_SetVariable", "label": "异常累计失败数", "position": { "x": 220, "y": 1700 }, "values": { "value": "${failures + (case_3[2] === \"FAIL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "failures" }, "parentId": "t07_23", "slot": "except_fn" }, { "id": "t07_30", "componentId": "Basic_SetVariable", "label": "异常累计待确认数", "position": { "x": 220, "y": 1700 }, "values": { "value": "${pending + (case_3[2] === \"MANUAL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "pending" }, "parentId": "t07_23", "slot": "except_fn" }, { "id": "t07_31", "componentId": "Log_Info", "label": "输出测试结果", "position": { "x": 220, "y": 2858 }, "values": { "msg": "用例结果:${json(case_3)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false } }, { "id": "t07_32", "componentId": "System_ExecuteCommand", "label": "创建仅输出标记的 BAT 夹具", "position": { "x": 220, "y": 3000 }, "values": { "action": "$dir=Join-Path ([IO.Path]::GetTempPath()) ('RPA-AppSystem-Tests\\'+[Guid]::NewGuid().ToString('N')); [IO.Directory]::CreateDirectory($dir) | Out-Null; $bat=Join-Path $dir 'echo-test.bat'; [IO.File]::WriteAllText($bat, '@echo RPA-BAT-OK', [Text.Encoding]::ASCII); $bat" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "batPath" } }, { "id": "t07_33", "componentId": "logic_control_try_catch", "label": "07-04 · System_ExecuteCommandV1", "position": { "x": 220, "y": 3142 }, "values": {}, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false } }, { "id": "t07_34", "componentId": "System_ExecuteCommandV1", "label": "System_ExecuteCommandV1", "position": { "x": 220, "y": 2240 }, "values": { "command_type": "2", "bat_file": "${batPath}", "get_ret": "1" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "actual_4" }, "parentId": "t07_33", "slot": "try_fn" }, { "id": "t07_35", "componentId": "Basic_SetVariable", "label": "记录实际值与判定", "position": { "x": 220, "y": 2240 }, "values": { "value": "${[\"07-04\", \"System_ExecuteCommandV1\", (actual_4 === \"RPA-BAT-OK\") ? \"PASS\" : \"FAIL\", \"{\\\"command_type\\\":\\\"2\\\",\\\"bat_file\\\":\\\"${batPath}\\\",\\\"get_ret\\\":\\\"1\\\"}\", \"RPA-BAT-OK\", actual_4]}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "case_4" }, "parentId": "t07_33", "slot": "try_fn" }, { "id": "t07_36", "componentId": "Basic_SetVariable", "label": "累计失败数", "position": { "x": 220, "y": 2240 }, "values": { "value": "${failures + (case_4[2] === \"FAIL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "failures" }, "parentId": "t07_33", "slot": "try_fn" }, { "id": "t07_37", "componentId": "Basic_SetVariable", "label": "累计待人工确认数", "position": { "x": 220, "y": 2240 }, "values": { "value": "${pending + (case_4[2] === \"MANUAL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "pending" }, "parentId": "t07_33", "slot": "try_fn" }, { "id": "t07_38", "componentId": "Basic_SetVariable", "label": "记录异常结果", "position": { "x": 220, "y": 2240 }, "values": { "value": "${[\"07-04\", \"System_ExecuteCommandV1\", \"FAIL\", \"{\\\"command_type\\\":\\\"2\\\",\\\"bat_file\\\":\\\"${batPath}\\\",\\\"get_ret\\\":\\\"1\\\"}\", \"RPA-BAT-OK\", error.reason]}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "case_4" }, "parentId": "t07_33", "slot": "except_fn" }, { "id": "t07_39", "componentId": "Basic_SetVariable", "label": "异常累计失败数", "position": { "x": 220, "y": 2240 }, "values": { "value": "${failures + (case_4[2] === \"FAIL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "failures" }, "parentId": "t07_33", "slot": "except_fn" }, { "id": "t07_40", "componentId": "Basic_SetVariable", "label": "异常累计待确认数", "position": { "x": 220, "y": 2240 }, "values": { "value": "${pending + (case_4[2] === \"MANUAL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "pending" }, "parentId": "t07_33", "slot": "except_fn" }, { "id": "t07_41", "componentId": "Log_Info", "label": "输出测试结果", "position": { "x": 220, "y": 3784 }, "values": { "msg": "用例结果:${json(case_4)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false } }, { "id": "t07_42", "componentId": "logic_control_try_catch", "label": "07-05 · 非零返回码检查", "position": { "x": 220, "y": 3926 }, "values": {}, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false } }, { "id": "t07_43", "componentId": "System_ExecuteCommand", "label": "非零返回码检查", "position": { "x": 220, "y": 2600 }, "values": { "action": "Write-Output 'RPA-ERROR-PROBE'; exit 9" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "actual_5" }, "parentId": "t07_42", "slot": "try_fn" }, { "id": "t07_44", "componentId": "Basic_SetVariable", "label": "记录实际值与判定", "position": { "x": 220, "y": 2600 }, "values": { "value": "${[\"07-05\", \"System_ExecuteCommand\", (false) ? \"PASS\" : \"FAIL\", \"{\\\"action\\\":\\\"Write-Output 'RPA-ERROR-PROBE'; exit 9\\\"}\", \"非零退出码应抛出异常\", actual_5]}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "case_5" }, "parentId": "t07_42", "slot": "try_fn" }, { "id": "t07_45", "componentId": "Basic_SetVariable", "label": "累计失败数", "position": { "x": 220, "y": 2600 }, "values": { "value": "${failures + (case_5[2] === \"FAIL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "failures" }, "parentId": "t07_42", "slot": "try_fn" }, { "id": "t07_46", "componentId": "Basic_SetVariable", "label": "累计待人工确认数", "position": { "x": 220, "y": 2600 }, "values": { "value": "${pending + (case_5[2] === \"MANUAL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "pending" }, "parentId": "t07_42", "slot": "try_fn" }, { "id": "t07_47", "componentId": "Basic_SetVariable", "label": "记录异常结果", "position": { "x": 220, "y": 2600 }, "values": { "value": "${[\"07-05\", \"System_ExecuteCommand\", \"PASS\", \"{\\\"action\\\":\\\"Write-Output 'RPA-ERROR-PROBE'; exit 9\\\"}\", \"非零退出码应抛出异常\", error.reason]}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "case_5" }, "parentId": "t07_42", "slot": "except_fn" }, { "id": "t07_48", "componentId": "Basic_SetVariable", "label": "异常累计失败数", "position": { "x": 220, "y": 2600 }, "values": { "value": "${failures + (case_5[2] === \"FAIL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "failures" }, "parentId": "t07_42", "slot": "except_fn" }, { "id": "t07_49", "componentId": "Basic_SetVariable", "label": "异常累计待确认数", "position": { "x": 220, "y": 2600 }, "values": { "value": "${pending + (case_5[2] === \"MANUAL\" ? 1 : 0)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false, "outputVar": "pending" }, "parentId": "t07_42", "slot": "except_fn" }, { "id": "t07_50", "componentId": "Log_Info", "label": "输出测试结果", "position": { "x": 220, "y": 4568 }, "values": { "msg": "用例结果:${json(case_5)}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false } }, { "id": "t07_51", "componentId": "Log_Info", "label": "输出测试结果", "position": { "x": 220, "y": 4710 }, "values": { "msg": "本组汇总:失败 ${failures} 项,阻塞 ${blocked} 项,待人工确认 ${pending} 项。" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false } }, { "id": "t07_52", "componentId": "logic_control_if_else", "label": "汇总判定", "position": { "x": 220, "y": 4852 }, "values": { "condition": "${failures > 0 || pending > 0 || blocked > 0}" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false } }, { "id": "t07_53", "componentId": "ExceptionUtil_Throws", "label": "如实标记未通过", "position": { "x": 220, "y": 3140 }, "values": { "msg": "组件测试未全部通过:失败 ${failures} 项,阻塞 ${blocked} 项,待人工确认 ${pending} 项。请查看日志。" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false }, "parentId": "t07_52", "slot": "statement_if" }, { "id": "t07_54", "componentId": "Log_Info", "label": "输出测试结果", "position": { "x": 220, "y": 3140 }, "values": { "msg": "本组全部通过。" }, "options": { "timeoutMs": 15000, "retryCount": 0, "logException": false }, "parentId": "t07_52", "slot": "statement_else" } ], "edges": [ { "id": "e_t07_2", "source": "t07_1", "target": "t07_2" }, { "id": "e_t07_3", "source": "t07_2", "target": "t07_3" }, { "id": "e_t07_4", "source": "t07_3", "target": "t07_4" }, { "id": "e_t07_5", "source": "t07_4", "target": "t07_5" }, { "id": "e_t07_13", "source": "t07_5", "target": "t07_13" }, { "id": "e_t07_14", "source": "t07_13", "target": "t07_14" }, { "id": "e_t07_22", "source": "t07_14", "target": "t07_22" }, { "id": "e_t07_23", "source": "t07_22", "target": "t07_23" }, { "id": "e_t07_31", "source": "t07_23", "target": "t07_31" }, { "id": "e_t07_32", "source": "t07_31", "target": "t07_32" }, { "id": "e_t07_33", "source": "t07_32", "target": "t07_33" }, { "id": "e_t07_41", "source": "t07_33", "target": "t07_41" }, { "id": "e_t07_42", "source": "t07_41", "target": "t07_42" }, { "id": "e_t07_50", "source": "t07_42", "target": "t07_50" }, { "id": "e_t07_51", "source": "t07_50", "target": "t07_51" }, { "id": "e_t07_52", "source": "t07_51", "target": "t07_52" } ], "meta": { "createdAt": "2026-10-30T00:00:00.000Z", "updatedAt": "2026-10-30T00:00:00.000Z", "appVersion": "0.1.0" } }