GetLatestFileByMasterId

GetLatestFileByMasterId

blokmech
Enthusiast Enthusiast
582 Views
2 Replies
Message 1 of 3

GetLatestFileByMasterId

blokmech
Enthusiast
Enthusiast

Hi,

 

I have used the JobProcessorApiSamle to create a job to create PDF and DWG files. This is working correctly if I used the command by selecting a file and click the right mouse button.

If I add the job with the lifecylce-event-editor, and I want to run the job when a file gets the released state, then i receive an error :"The given key was not present in the dictionary".

 

I think it has to do with a version conflict, because the properties of files are also updated by the standard jobs which are also running when i file gets the released state, and the file gets then a new id (i think).

 

In the jobhandler the following row gets the file:

"Dim file As Autodesk.Connectivity.WebServices.File = _

serviceManager.DocumentService.GetLatestFileByMasterId(fileMasterId)"

 

So I think it's received the latest version.

 

What could be wrong?

 

Regards,

Nico Blok.

 

0 Likes
583 Views
2 Replies
Replies (2)
Message 2 of 3

Daniel.Dulzo
Alumni
Alumni

Hi Nico,

 

I think the reason you're seeing the "key not present in dictionary" error when the job is queued up on a lifecycle event is because the lifecycle event only passes certain parameters to the job in the param collection, which do no match up with the parameters passed into the job when creating the job with the right click. More information about what parameters are set for lifecycle event jobs can be found here: http://justonesandzeros.typepad.com/blog/2012/04/lifecycle-event-job-parameters.html.



Daniel Dulzo
Software Engineer
Autodesk, Inc.
0 Likes
Message 3 of 3

blokmech
Enthusiast
Enthusiast

Daniel,

 

Thank you for your response.

 

So the FileMasterId is not parsed. I have to use the EntityId.

 

I will try as soon i can find the time.


0 Likes