在workitem的“作业状态”中,即使由于异常而导致处理失败,“状态”也将显示“成功”

问题描述

我在工作项的工作状态中遇到了一个小问题,即使设计过程由于异常而失败,“状态”值也会变为“成功”。 发生这种情况是因为我已经在代码中处理了该异常? 如果是,那么我该如何将该状态值操纵为“ 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"
}```

解决方法

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

您所能做的就是弄清楚何时发生这种情况,并使用不同的退出代码使Inventor退出(我不知道自己怎么做,或者是否可能)。

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