Anurag
Anurag

Reputation: 25

In workitem's Job Status, "status" is displaying "success" even when the processing is failed due to an exception

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"
}```

Upvotes: 0

Views: 183

Answers (1)

Jeremy
Jeremy

Reputation: 367

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.

Upvotes: 0

Related Questions