Custom Job on lifecycle state change

Custom Job on lifecycle state change

Anonymous
Not applicable
634 Views
1 Reply
Message 1 of 2

Custom Job on lifecycle state change

Anonymous
Not applicable

Hi All,

 

I've downloaded coolOrange powerJob's for Vault and have begun experimenting with some of the sample codes (creating STEP, DXF etc).

 

I began by adding the Sample.CreateSTEP custom job type to the Review > Released lifecycle state change. During testing I could see the job getting added to the job server queue but it would fail to create a STEP file. I discovered that it would work perfectly if our lifecycle was assigned to files, but we use lifecycles on items instead!

 

Can anyone point me in the right direction to get this working for lifecycle state changes on items? I want the job processor to create STEP files for all .ipt's that get released.

 

Thanks,

0 Likes
Accepted solutions (1)
635 Views
1 Reply
Reply (1)
Message 2 of 2

Markus.Koechl
Autodesk
Autodesk
Accepted solution

Assuming that your target file is the primary linked component of your item you could get the file id in a single line if you got the item object instead of the file object within your job context:

$primaryFile = $vault.ItemService.GetItemFileAssociationsByItemIds(@($item.Id), "Primary")

The $primaryFile[0].CldFileId allows continuing in the given context of your job sample.

Hope this helps.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes