SubmitJobsOnLifecycleTransition

This event script is intended to be used in combination with the powerJobs Settings Dialog to configure automatic queueing of jobs based on certain lifecycle transitions and filter conditions.

Requires powerJobs Processor

The SubmitJobsOnLifecycleTransition event script relies on the configuration from the Job Triggers section of the powerJobs Settings Dialog to work properly.
This requires minimum version of powerJobs Processor 23.0.1

The user performing the action must have the Vault Get Options permission to retrieve the trigger settings configured with the powerJobs Settings Dialog.

This script makes use of the following events:

The script registers Post Event handlers for every above mentioned event and queues the configured job if an entity matches all of the following conditions:

  • The ‘update status’ operation was successful

  • One or more of the affected entities transitioned to a configured lifecycle state

  • All of the configured filters match for an entity

  • If the powerJobs Processor Sample.CreateDXF&STEPfromSheetmetal job is configured to be queued, additional checks are performed. The Vault environment must be configured correctly for the event script be able to determine the document type.

Testing

The script can be tested by performing the following steps:

  1. Open the Vault Client, open the powerJobs Settings Dialog and navigate to the Job Triggers section of the dialog. Configure a job to be queued on a lifecycle transition.

  2. Navigate to an entity of the selected type (e.g. file)

  3. Change the Lifecycle State to the configured state

  4. Open the Job Queue

  5. The Job Queue contains a configured job for the changed file with the set description and priority

Out of the box the event registrations for this script are enabled, when the script is not used the event registrations can by disabled by commenting the respective lines:

Register-VaultEvent -EventName UpdateFileStates_Post -Action 'SubmitJobsForFileStateTransitions'
Register-VaultEvent -EventName UpdateItemStates_Post -Action 'SubmitJobsForUpdateItemStateTransitions'
Register-VaultEvent -EventName UpdateCustomEntityStates_Post -Action 'SubmitJobsForUpdateCustomEntityStateTransitions'
Register-VaultEvent -EventName UpdateChangeOrderState_Post -Action 'SubmitJobsForUpdateChangeOrderStateTransition'