Run PDM Task Addin before or after auto transition

Hi All,

I would like to know if it is possible to run PDM task addin before or after auto transition state.

For example,
CAD files are in WIP state. Next state is “Update Custom Properties” and the final state is “Design Review”. When user moves the files to update custom property state, addin checks out parts and assembly files, updates some custom properties and checks them back in. Files then automatically transition to design review state so that someone can review the design. The use does not have permission to check out files when files are in design review state and I would like to run the addin on user machine so would like to use existing logged in user during the task addin. Hope I have explained it well enough.

Nilesh Patel

You need to add a superuser setting to your add-in since you do not want to mess up the workflow.

This is really funny but I have just finished implementing this on an add-in.

After the PostStateChange, you spin up a new thread where you log into the vault with the superuser credentials, do what you need to do and then abort the thread.

Do not pass any API objects from the main thread to the work thread. You can pass the file ID, the folder ID and the probably the object value you are trying to set.

Hope this makes sense!

1 Like


If I understood you correctly, this is what I can do:

  1. Do not create intermediate state called “Updated Custom Properties”.
  2. User moves the files to “Design Review” state manually from WIP state.
  3. Use PostStateChange hook in the addin to check out files, update custom properties and check them back in using superuser credential after files are moved to design review state.

Yup. Let me know if that works.

1 Like

I will give it a try over the weekend and let you know.

Did this work for you?

Sorry mate, I didn’t get change to test it yet. I will update the post as soon as I get some testing done.