【问题标题】:In workitem's Job Status, "status" is displaying "success" even when the processing is failed due to an exception在工作项的作业状态中,“状态”显示“成功”,即使处理因异常而失败
【发布时间】:2023-03-05 04:26:01
【问题描述】:

我在工作项的工作状态中遇到了一个小问题,即使设计过程由于异常而失败,“状态”值也会显示为“成功”。 是因为我已经在代码中处理了那个异常吗? 如果是,那么我如何将该状态值操作为“failedInstructions”或其他任何值。 请帮助/解释我能做什么...

作为参考,我在下面添加了partReport的一些文本,这可能有助于理解我的问题。

[08/20/2020 09:23:52]     InventorCoreConsole.exe Information: 0 : Ending HeartBeat
[08/20/2020 09:23:52]     InventorCoreConsole.exe Error: 0 : Inventor message: This file was saved in a newer version of the product. Inventor can’t open newer versions of drawing (.idw, .dwg) and presentation (.ipn) files.
[08/20/2020 09:23:52]     To open a part (.ipt) or an assembly (.iam) file one year newer than your current version, install the latest updates.
[08/20/2020 09:23:52]     T:\Aces\Jobs\xxxxxx\AutoDrawingGenerator1\Asia\A1.dwg (Inventor Server x64 SDK 2019 (Build 230136000, 136))
[08/20/2020 09:23:52]     Search in the Inventor help for 'Troubleshooting Opening Newer Files' for information on how to open a newer file.
[08/20/2020 09:23:52]     InventorCoreConsole.exe Error: 0 : Inventor inner xml: 
[08/20/2020 09:23:52]     InventorCoreConsole.exe Information: 0 : Performing iLogic diagnostics...
[08/20/2020 09:23:52]     InventorCoreConsole.exe Information: 0 : End of iLogic diagnostics...
[08/20/2020 09:23:52]     InventorCoreConsole.exe Information: 0 : Deactivating plug-in: adg plugin
[08/20/2020 09:23:52]     InventorCoreConsole.exe Information: 0 : : samplePlugin: deactivating... 
[08/20/2020 09:23:53]     End Inventor Core Engine standard output dump.
[08/20/2020 09:23:53]     End script phase.
[08/20/2020 09:23:53]     Start upload phase.
[08/20/2020 09:23:53]     Uploading 'T:\Aces\Jobs\xxxxxx\Result.zip': verb - 'PUT', url - 'https://developer.api.autodesk.com/oss/v2/buckets/xxxxxx/objects/Result.zip'
[08/20/2020 09:23:54]     End upload phase successfully.
[08/20/2020 09:23:54]     Job finished with result Succeeded
[08/20/2020 09:23:54]     Job Status:
{
  "status": "success",
  "reportUrl": "xxxxxx",
  "stats": {
    "timeQueued": "2020-08-20T09:23:38.7490949Z",
    "timeDownloadStarted": "2020-08-20T09:23:39.0168046Z",
    "timeInstructionsStarted": "2020-08-20T09:23:40.9380466Z",
    "timeInstructionsEnded": "2020-08-20T09:23:53.9753113Z",
    "timeUploadEnded": "2020-08-20T09:23:54.6653268Z",
    "bytesDownloaded": 21313829,
    "bytesUploaded": 329117
  },
  "id": "xxxxxx"
}```

【问题讨论】:

    标签: autodesk-forge autodesk-designautomation


    【解决方案1】:

    我对 Inventor 不太熟悉。话虽如此,设计自动化 API 并不真正知道它启动的过程中发生了什么(在您的情况下是发明者)。要确定一个工作项是否成功执行,它所做的只是验证它启动的进程的退出代码,并验证是否存在预期的结果以供上传。 我假设在您的情况下,即使 Inventor 中发生了一些问题,Inventor 进程仍然可以优雅地处理它并以退出代码 0 退出。最重要的是,您的输出似乎是一个 zip。 Design Automation 将压缩所需的文件夹,但无法验证您期望的内容是否确实存在。

    您可以做的是找出这种情况何时发生,并使用不同的退出代码让 Inventor 退出(我自己不知道该怎么做,也不知道是否可行)。

    或者,您也可以编写一个脚本来验证您的预期输出是否存在,并在您的活动中的发明者命令之后将其作为第二个命令行运行,如果输出存在,​​则以代码 0 退出,否则以 -1 退出例子。

    【讨论】:

    • 嗨@Jeremy,我尝试使用 ExitCode = -1 退出,它工作正常并显示状态为“faileinstructions”,但现在,我无法将 zip 文件作为工作项的上传阶段被完全跳过,其中包含一些输出文件(不是进程应该设计的所有输出文件)。错误报告文本如下所示:
    • [08/21/2020 08:08:23] End Inventor Core Engine standard output dump. [08/21/2020 08:08:23] Error: InventorCoreConsole.exe exits with code -1 which indicates an error. [08/21/2020 08:08:23] End script phase. [08/21/2020 08:08:23] Error: An unexpected error happened during phase CoreEngineExecution of job. [08/21/2020 08:08:23] Job finished with result FailedExecution [08/21/2020 08:08:23] Job Status: { "status": "failedInstructions",}
    • 另外,检查预期输出对我来说太复杂了,因为这取决于设置和其他选择...
    • 当 Design Automation 检测到错误(任何失败/取消的工作项)时,它不会尝试上传任何结果。如果您想知道错误何时发生但错误实际上并没有阻止您的工作项产生您想要收集的正确结果,而不是退出代码 = -1,您可能希望产生另一个指示失败的输出.但是,您必须自己管理和检查这个新输出。
    • 我通过添加 1 个输出作为日志文件来做到这一点,据此,我能够在最后获得所需的状态,而不是故意将伪造作业状态作为失败的指令。谢谢顺便说一句!
    猜你喜欢
    • 2023-02-21
    • 2019-03-03
    • 1970-01-01
    • 2020-01-14
    • 2018-09-19
    • 2014-02-06
    • 2022-08-13
    • 2020-01-23
    • 2018-01-31
    相关资源
    最近更新 更多