Sample.RestrictDisturbingSubmittedJobs

Autodesk Vault environments give users the possibility to submit Jobs while they work with their files, but they are not always processed immediately.
As a result, it often happens that they either fail or don’t produce the expected results if users continue to work with their files in Vault.

To prevent these problems, this client customization helps for example in the following situations:

  • When new file versions are created after jobs have been submitted for that file, many Autodesk jobs simply fail.
    A common error that you can then see is e.g. “Sync properties not allowed on non-tip versions”.
    Autodesk recommends “Administrators can ignore, delete, or filter out this type of error.”

    Solution:
    So that it doesn’t even come to the situation that all the jobs fail and fill up the Job Queue, Vault users can also be informed and restricted from creating new file versions, as long as there are still open jobs in the Job Queue.

  • If powerJobs Processor jobs have been queued at certain lifecycle transitions, such as releases, and in the meantime the status of the file has been reset or changed (e.g. to “Work in Progress”) then many Vault users forget about their still open jobs within the Job Queue.
    By default those jobs will be executed for the latest file version, and newly created visualization files may contain incorrect data (e.g. State) and are not attached to the released file version.

    Solution:
    To prevent this from happening, Vault users can also be prevented from changing the file status if jobs must be processed beforehand.

Therefore this sample script registers to the UpdateFileStates event and adds Restrictions when the lifecycle state of a file changes, while jobs were queued for it.
This way Lifecycle transitions are prevented for all files, for which jobs have been submitted and have not yet been processed successfully.

Testing

In the default delivery the script is disabled and located in the %PROGRAMDATA%\coolOrange\Client Customizations\Disabled folder.
The customization can be tested by following these steps:

  1. Enable the script by moving it to the directory %PROGRAMDATA%\coolOrange\Client Customizations.

  2. Pause all active Job Processors during the test to ensure that the queued Synchronize Properties job will not be processed upfront.

  3. Open the Vault Client.

  4. Make sure the action “Synchronize properties using Job Server is enabled for a desired Lifecycle transition to a “Released” state.

  5. Navigate to an Inventor- or AutoCAD file and change its Lifecycle State to the previously configured “Released” state

  6. Open the Job Queue and make sure that a “Autodesk.Vault.SyncProperties” job has been automatically submitted for the released file version.

  7. Change the Lifecycle State of the selected file again to any other state.

  8. A restriction dialog appears and informs about the still active Synchronize Properties job, which would fail if a new file version gets created.