In our example we make use of the Restrictions event:
In the Restrictions event we check if the state is about to be changed to Released or in case of a ChangeOrder to Closed.
We also check if the user who is changing the state is the same who last modified the entity. If one of these rules is violated a restriction will be set.
The script can be tested by doing the following steps:
Open the Vault Client
Navigate to an Item, File or Change Order which can be released and was last modified by another Vault user.
Change the Lifecycle State to “Released” (or “Closed” for Change Orders).
A restriction dialog appears informing the user that the Lifecycle State of the entity can’t be released (or closed) as it was most recently edited by another user.
In the default delivery the event registration for this script is disabled, therefore you will have to enable it by uncommenting following lines:
#Register-VaultEvent -EventName UpdateFileStates_Restrictions ... #Register-VaultEvent -EventName UpdateItemStates_Restrictions ... #Register-VaultEvent -EventName UpdateChangeOrderState_Restrictions ...