0

I am facing a minor issue in workitem's job status, where "status" value is coming as "success" even when the design process get failed due to an exception. Is it happening because I've handled that exception in the code? If yes, then how can i manipulate that status value to "failedInstructions" or whatsoever. Please help/explain what i can do...

For the reference, i am adding some text of the partReport below, which might be helpful to understand my problem.

[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"
}```
Anurag
  • 25
  • 3

1 Answers1

0

I am not too familiar with Inventor. That being said, the Design Automation API doesn't really know what is happening inside the process it launch (In your case inventor). To determine if a work item is executed successfully all it does is verify the exit code of the process it launched and validate that the expected result are present for upload. I assume in your case, even though some issue happen in Inventor, the Inventor process still handle it gracefully and exit with exit code 0. On top of that your output seems to be a zip. Design Automation will zip the desired folder but can't validate that what you expect to be in there is indeed present.

What you could do is figure out when this situation happen and make Inventor exit with a different exit code (I don't know how to do this myself or if it is possible).

Alternatively, you could also write a script to validate that your expected outputs are present and run this as a second command line after the inventor command in your activity, if the output are present exit with code 0 otherwise exit with -1 for example.

Jeremy
  • 357
  • 1
  • 6
  • Hi @Jeremy , I have tried to exit with ExitCode = -1, it worked fine and showing status as "failedinstructions" but now, I am unable to get the zip file as the uploading phase of workitem gets totally skipped, which contains some output files (not all the output files that the process should design). Errorreport text is shown below: – Anurag Aug 21 '20 at 11:07
  • `[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",}` – Anurag Aug 21 '20 at 11:09
  • Also, it would be too complex for me to check the expected output, as it depends on the settings and other choices... – Anurag Aug 21 '20 at 11:11
  • When Design Automation detects an error (any failed/cancelled workitem) it will not attempt to upload any results. If you wish to know when the error happen but the error actually doesn't prevent your workitem from producing the correct result that you want to collect, instead of having exit code = -1, you might want to produce another output that would indicate failure.However, you will have to manage and check this new output yourself. – Jeremy Aug 24 '20 at 16:30
  • I did it with adding 1 more output as a log file and according to it, I am able to get the status as required at my end, instead of intentionally making forge job status as failedinstructions. THANKS BTW! – Anurag Aug 26 '20 at 08:49
  • glad I could help :) – Jeremy Aug 26 '20 at 12:23