VaultEvent

The Enum of type powerEvents.Cmdlets.VaultEvent provides a list of all the supported Vault events.

[powerEvents.Cmdlets.VaultEvent]::AddFile_Post 

Each Vault event has its own set of available arguments.

They can be used in a defined script block when registering to one of the Vault events below.
Note: The arguments must be named exactly the same as mentioned below!

You are not forced to use all the defined arguments, since they are all optional.
Therefore you can pass only the parameters you really need into your script blocks.

File

AddFile

EventNames:

  • AddFile_Restrictions
  • AddFile_Pre
  • AddFile_Post

Parameters

Type Name Description
FilefileThe file which is / was added.

Restrictions and Pre:
In Restrictions and Pre you have only very limited data set on this object like _NewName, _NewComment, _NewModDate, _NewClassification and _NewHidden, because the file does not exist jet.
Post:
In Post its a usualy powerVaultFile object, because here the file exists.
FolderparentFolderThe folder where the new file is located.
File[]dependenciesThe file dependencies what this new file has.
File[]attachmentsThe attached files what this new file has.
FileBomRow[]fileBomThe bill of materials to associate with the file.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

AddFile_Restrictions:

Register-VaultEvent -EventName AddFile_Restrictions -Action 'RestrictAddFile'

function RestrictAddFile($file, $parentFolder, $dependencies, $attachments, $fileBom) {
    #Write event code here
}
AddFile_Pre:
Register-VaultEvent -EventName AddFile_Pre -Action 'PreAddFile'

function PreAddFile($file, $parentFolder, $dependencies, $attachments, $fileBom) {
    #Write event code here
}
AddFile_Post:
Register-VaultEvent -EventName AddFile_Post -Action 'PostAddFile'

function PostAddFile($file, $parentFolder, $dependencies, $attachments, $fileBom, $successful) {
    #Write event code here
}

CheckinFile

EventNames:

  • CheckinFile_Restrictions
  • CheckinFile_Pre
  • CheckinFile_Post

Parameters

Type Name Description
FilefileThe file which is / was checked in.

Restrictions and Pre:
In Restrictions and Pre you have the future data set on this object like _NewName, _NewComment, _NewModDate, _NewClassification, _NewCheckedOut and _NewHidden.
Post:
In POST you can retrieve the information from previous events by using the properties _OldName, _OldComment, _OldModDate, _OldClassification, _OldCheckedOut and _OldHidden.
File[]dependenciesThe file dependencies what this new checked-in file has.
File[]attachmentsThe attachments what this new checked-in file has.
FileBomRow[]fileBomThe bill of materials to associate with the checked-in file.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

CheckinFile_Restrictions:

Register-VaultEvent -EventName CheckinFile_Restrictions -Action 'RestrictCheckinFile'

function RestrictCheckinFile($file, $dependencies, $attachments, $fileBom) {
    #Write event code here
}
CheckinFile_Pre:
Register-VaultEvent -EventName CheckinFile_Pre -Action 'PreCheckinFile'

function PreCheckinFile($file, $dependencies, $attachments, $fileBom) {
    #Write event code here
}
CheckinFile_Post:
Register-VaultEvent -EventName CheckinFile_Post -Action 'PostCheckinFile'

function PostCheckinFile($file, $dependencies, $attachments, $fileBom, $successful) {
    #Write event code here
}

CheckoutFile

EventNames:

  • CheckoutFile_Restrictions
  • CheckoutFile_Pre
  • CheckoutFile_Post

Parameters

Type Name Description
FilefileThe file which should get / is checked-out.

Restrictions and Pre:
In Restrictions and Pre you have the future data set on this object like _NewComment and _NewCheckoutMachine.
Post:
In POST you can retrieve the information from the previous events by using the properties _OldComment and _OldCheckoutMachine.
stringlocalPathThe local path where the file should / is checked-out
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

CheckoutFile_Restrictions:

Register-VaultEvent -EventName CheckoutFile_Restrictions -Action 'RestrictCheckoutFile'

function RestrictCheckoutFile($file, $localPath) {
    #Write event code here
}
CheckoutFile_Pre:
Register-VaultEvent -EventName CheckoutFile_Pre -Action 'PreCheckoutFile'

function PreCheckoutFile($file, $localPath) {
    #Write event code here
}
CheckoutFile_Post:
Register-VaultEvent -EventName CheckoutFile_Post -Action 'PostCheckoutFile'

function PostCheckoutFile($file, $localPath, $successful) {
    #Write event code here
}

DeleteFiles

EventNames:

  • DeleteFiles_Restrictions
  • DeleteFiles_Pre
  • DeleteFiles_Post

Parameters

Type Name Description
File[]files (deletedFiles in POST)The files which should be deleted or are already deleted.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

DeleteFiles_Restrictions:

Register-VaultEvent -EventName DeleteFiles_Restrictions -Action 'RestrictDeleteFiles'

function RestrictDeleteFiles($files) {
    #Write event code here
}
DeleteFiles_Pre:
Register-VaultEvent -EventName DeleteFiles_Pre -Action 'PreDeleteFiles'

function PreDeleteFiles($files) {
    #Write event code here
}
DeleteFiles_Post:
Register-VaultEvent -EventName DeleteFiles_Post -Action 'PostDeleteFiles'

function PostDeleteFiles($deletedFiles, $successful) {
    #Write event code here
}

DownloadFiles

EventNames:

  • DownloadFiles_Restrictions
  • DownloadFiles_Pre
  • DownloadFiles_Post

Parameters

Type Name Description
File[]filesThe files which should get / are downloaded.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

DownloadFiles_Restrictions:

Register-VaultEvent -EventName DownloadFiles_Restrictions -Action 'RestrictDownloadFiles'

function RestrictDownloadFiles($files) {
    #Write event code here
}
DownloadFiles_Pre:
Register-VaultEvent -EventName DownloadFiles_Pre -Action 'PreDownloadFiles'

function PreDownloadFiles($files) {
    #Write event code here
}
DownloadFiles_Post:
Register-VaultEvent -EventName DownloadFiles_Post -Action 'PostDownloadFiles'

function PostDownloadFiles($files, $successful) {
    #Write event code here
}

MoveFile

EventNames:

  • MoveFile_Restrictions
  • MoveFile_Pre
  • MoveFile_Post

Parameters

Type Name Description
FilefileThe file which should get / are moved.

Restrictions and Pre:
In Restrictions and Pre you could get the new path by the property _NewFullPath.
Post:
In POST you you could get the old path by the property _OldFullPath.
FolderparentFolderThe parent folder where the file should get / is moved.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

MoveFile_Restrictions:

Register-VaultEvent -EventName MoveFile_Restrictions -Action 'RestrictMoveFile'

function RestrictMoveFile($file, $parentFolder) {
    #Write event code here
}
MoveFile_Pre:
Register-VaultEvent -EventName MoveFile_Pre -Action 'PreMoveFile'

function PreMoveFile($file, $parentFolder) {
    #Write event code here
}
MoveFile_Post:
Register-VaultEvent -EventName MoveFile_Post -Action 'PostMoveFile'

function PostMoveFile($file, $parentFolder, $successful) {
    #Write event code here
}

UpdateFileStates

EventNames:

  • UpdateFileStates_Restrictions
  • UpdateFileStates_Pre
  • UpdateFileStates_Post

Parameters

Type Name Description
File[]filesThe updated / updating files for a LifeCycle.

Restrictions and Pre:
In Restrictions and Pre you have the future data set on this object like _NewComment, _NewLifeCycleDefinition and _NewState.
Post:
In POST you can retrieve the information from previous events by using the properties _OldComment, _OldState and _OldLifeCycleDefinition.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

UpdateFileStates_Restrictions:

Register-VaultEvent -EventName UpdateFileStates_Restrictions -Action 'RestrictUpdateFileStates'

function RestrictUpdateFileStates($files) {
    #Write event code here
}
UpdateFileStates_Pre:
Register-VaultEvent -EventName UpdateFileStates_Pre -Action 'PreUpdateFileStates'

function PreUpdateFileStates($files) {
    #Write event code here
}
UpdateFileStates_Post:
Register-VaultEvent -EventName UpdateFileStates_Post -Action 'PostUpdateFileStates'

function PostUpdateFileStates($files, $successful) {
    #Write event code here
}

Folder

AddFolder

EventNames:

  • AddFolder_Restrictions
  • AddFolder_Pre
  • AddFolder_Post

Parameters

Type Name Description
FolderfolderThe folder which should get / is added.

Restrictions and Pre:
In Restrictions and Pre you have the very limited data set on this object like _NewName and _NewLibrary.
Post:
In POST its an usual powerVaultFolder object, because at this point the folder exists.
FolderparentFolderThe parent folder where the new folder will be / is added.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

AddFolder_Restrictions:

Register-VaultEvent -EventName AddFolder_Restrictions -Action 'RestrictAddFolder'

function RestrictAddFolder($folder, $parentFolder) {
    #Write event code here
}
AddFolder_Pre:
Register-VaultEvent -EventName AddFolder_Pre -Action 'PreAddFolder'

function PreAddFolder($folder, $parentFolder) {
    #Write event code here
}
AddFolder_Post:
Register-VaultEvent -EventName AddFolder_Post -Action 'PostAddFolder'

function PostAddFolder($folder, $parentFolder, $successful) {
    #Write event code here
}

MoveFolder

EventNames:

  • MoveFolder_Restrictions
  • MoveFolder_Pre
  • MoveFolder_Post

Parameters

Type Name Description
FolderfolderThe folder which should get / is moved.

Restrictions and Pre:
In Restrictions and Pre you have the future data set on this object like _NewFullPath.
Post:
In POST you can retrieve the previous information by using the properties _OldFullPath.
FolderparentFolderThe new parent folder where the folder should / is moved
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

MoveFolder_Restrictions:

Register-VaultEvent -EventName MoveFolder_Restrictions -Action 'RestrictMoveFolder'

function RestrictMoveFolder($folder, $parentFolder) {
    #Write event code here
}
MoveFolder_Pre:
Register-VaultEvent -EventName MoveFolder_Pre -Action 'PreMoveFolder'

function PreMoveFolder($folder, $parentFolder) {
    #Write event code here
}
MoveFolder_Post:
Register-VaultEvent -EventName MoveFolder_Post -Action 'PostMoveFolder'

function PostMoveFolder($folder, $parentFolder, $successful) {
    #Write event code here
}

DeleteFolder

EventNames:

  • DeleteFolder_Restrictions
  • DeleteFolder_Pre
  • DeleteFolder_Post

Parameters

Type Name Description
Folderfolder (deletedFolder in POST)The folder which should get / is deleted.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

DeleteFolder_Restrictions:

Register-VaultEvent -EventName DeleteFolder_Restrictions -Action 'RestrictDeleteFolder'

function RestrictDeleteFolder($folder) {
    #Write event code here
}
DeleteFolder_Pre:
Register-VaultEvent -EventName DeleteFolder_Pre -Action 'PreDeleteFolder'

function PreDeleteFolder($folder) {
    #Write event code here
}
DeleteFolder_Post:
Register-VaultEvent -EventName DeleteFolder_Post -Action 'PostDeleteFolder'

function PostDeleteFolder($deletedFolder, $successful) {
    #Write event code here
}

Item

AddItem

EventNames:

  • AddItem_Restrictions
  • AddItem_Pre
  • AddItem_Post

Parameters

Type Name Description
ItemitemThe item which should get / is added.

Restrictions and Pre:
In Restrictions and Pre you have very limited data, because the item does not exist so far. Only the property _NewCategoryName is set as long as a valid category Id was passed.
Post:
In POST you have a full powerVaultItem object available, because at this point the item exists.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

AddItem_Restrictions:

Register-VaultEvent -EventName AddItem_Restrictions -Action 'RestrictAddItem'

function RestrictAddItem($item) {
    #Write event code here
}
AddItem_Pre:
Register-VaultEvent -EventName AddItem_Pre -Action 'PreAddItem'

function PreAddItem($item) {
    #Write event code here
}
AddItem_Post:
Register-VaultEvent -EventName AddItem_Post -Action 'PostAddItem'

function PostAddItem($item, $successful) {
    #Write event code here
}

CommitItems

EventNames:

  • CommitItems_Restrictions
  • CommitItems_Pre
  • CommitItems_Post

Parameters

Type Name Description
Item[]itemsThe items which should get / is comited.

Restrictions and Pre:
In Restrictions and Pre you have the future data set on this object like _NewNumber, _NewTitle(Item,CO), _NewDescription(Item,CO), _NewComment and _NewUnits.
Post:
In POST you can retrieve the previous information by using the properties _OldNumber, _OldTitle(Item,CO), _OldDescription(Item,CO), _OldComment and _OldUnits.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

CommitItems_Restrictions:

Register-VaultEvent -EventName CommitItems_Restrictions -Action 'RestrictCommitItems'

function RestrictCommitItems($items) {
    #Write event code here
}
CommitItems_Pre:
Register-VaultEvent -EventName CommitItems_Pre -Action 'PreCommitItems'

function PreCommitItems($items) {
    #Write event code here
}
CommitItems_Post:
Register-VaultEvent -EventName CommitItems_Post -Action 'PostCommitItems'

function PostCommitItems($items, $successful) {
    #Write event code here
}

DeleteItems

EventNames:

  • DeleteItems_Restrictions
  • DeleteItems_Pre
  • DeleteItems_Post

Parameters

Type Name Description
Item[]items (deletedItems in POST)The items which should get / are deleted.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

DeleteItems_Restrictions:

Register-VaultEvent -EventName DeleteItems_Restrictions -Action 'RestrictDeleteItems'

function RestrictDeleteItems($items) {
    #Write event code here
}
DeleteItems_Pre:
Register-VaultEvent -EventName DeleteItems_Pre -Action 'PreDeleteItems'

function PreDeleteItems($items) {
    #Write event code here
}
DeleteItems_Post:
Register-VaultEvent -EventName DeleteItems_Post -Action 'PostDeleteItems'

function PostDeleteItems($deletedItems, $successful) {
    #Write event code here
}

EditItems

EventNames:

  • EditItems_Restrictions
  • EditItems_Pre
  • EditItems_Post

Parameters

Type Name Description
Item[]itemsThe items which should get / are in edit mode.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

EditItems_Restrictions:

Register-VaultEvent -EventName EditItems_Restrictions -Action 'RestrictEditItems'

function RestrictEditItems($items) {
    #Write event code here
}
EditItems_Pre:
Register-VaultEvent -EventName EditItems_Pre -Action 'PreEditItems'

function PreEditItems($items) {
    #Write event code here
}
EditItems_Post:
Register-VaultEvent -EventName EditItems_Post -Action 'PostEditItems'

function PostEditItems($items, $successful) {
    #Write event code here
}

PromoteItems

EventNames:

  • PromoteItems_Restrictions
  • PromoteItems_Pre
  • PromoteItems_Post

Parameters

Type Name Description
File[]filesThe files which should get / are assigned to the items.
Item[]itemsThe items which should get / are assigned to the files.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

PromoteItems_Restrictions:

Register-VaultEvent -EventName PromoteItems_Restrictions -Action 'RestrictPromoteItems'

function RestrictPromoteItems($files, $items) {
    #Write event code here
}
PromoteItems_Pre:
Register-VaultEvent -EventName PromoteItems_Pre -Action 'PrePromoteItems'

function PrePromoteItems($files, $items) {
    #Write event code here
}
PromoteItems_Post:
Register-VaultEvent -EventName PromoteItems_Post -Action 'PostPromoteItems'

function PostPromoteItems($files, $items, $successful) {
    #Write event code here
}

UpdateItemStates

EventNames:

  • UpdateItemStates_Restrictions
  • UpdateItemStates_Pre
  • UpdateItemStates_Post

Parameters

Type Name Description
Item[]itemsThe updated / updating items for a LifeCycle.

Restrictions and Pre:
In Restrictions and Pre you have the future data set on this object like _NewComment, _NewLifeCycleDefinition and _NewState.
Post:
In POST you can retrieve the previous information by using the properties _OldComment, _OldLifeCycleDefinition and _OldState.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

UpdateItemStates_Restrictions:

Register-VaultEvent -EventName UpdateItemStates_Restrictions -Action 'RestrictUpdateItemStates'

function RestrictUpdateItemStates($items) {
    #Write event code here
}
UpdateItemStates_Pre:
Register-VaultEvent -EventName UpdateItemStates_Pre -Action 'PreUpdateItemStates'

function PreUpdateItemStates($items) {
    #Write event code here
}
UpdateItemStates_Post:
Register-VaultEvent -EventName UpdateItemStates_Post -Action 'PostUpdateItemStates'

function PostUpdateItemStates($items, $successful) {
    #Write event code here
}

RollbackItemState

EventNames:

  • RollbackItemState_Restrictions
  • RollbackItemState_Pre
  • RollbackItemState_Post

Parameters

Type Name Description
ItemitemThe item which should get / is reverted for a LifeCycle.

Restrictions and Pre:
In Restrictions and Pre you have the future data set on this object like _NewState and _NewLifeCycleDefinition.
Post:
In POST you can retrieve the old information by the properties _OldState and _OldLifeCycleDefinition.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

RollbackItemState_Restrictions:

Register-VaultEvent -EventName RollbackItemState_Restrictions -Action 'RestrictRollbackItemState'

function RestrictRollbackItemState($item) {
    #Write event code here
}
RollbackItemState_Pre:
Register-VaultEvent -EventName RollbackItemState_Pre -Action 'PreRollbackItemState'

function PreRollbackItemState($item) {
    #Write event code here
}
RollbackItemState_Post:
Register-VaultEvent -EventName RollbackItemState_Post -Action 'PostRollbackItemState'

function PostRollbackItemState($item, $successful) {
    #Write event code here
}

Unexpected behaviour

AddItem event is raised when clicking in Vault client on New Item… → Selecting Category → Ok Therefore you have only the data about the selected Category available and seriously not more.

CommitItems event

  • raised when clicking in the item dialog on Save or Save and Close
  • when changing Item number via Vault Client, the properties _Number, _NewNumber and _OldNumber have the same value. This happens because the API call ItemService.CommitItemNumbers already changes the number on the item that is still in edit-mode.
  • when committing an Item that has a Comment, the properties _Comment and _OldComment will be empty, because the comment will be automatically cleared by previous API call ItemService.EditItems

EditItems event:

  • raised when clicking on Open → Edit or directly “Update “for the item.
  • raised when clicking on Save (not save and close) in the dialog then first CommitItem is fired, and then EditItem
  • raised when activating in the item dialog, inside the BOM a new item

PromoteItems event is raised when clicking ”Assign / Update Item” on a file or “Update…” on a item and afterwards EditItem event is fired

  • When “Assign / Update Item” on a file is clicked wheter the item exists or not, you will only get data about the files
  • When “Update…” on an item is clicked, you will only get data about the items

Changing item category does not fire any event.

Custom Entity

UpdateCustomEntityStates

EventNames:

  • UpdateCustomEntityStates_Restrictions
  • UpdateCustomEntityStates_Pre
  • UpdateCustomEntityStates_Post

Parameters

Type Name Description
CustomObject[]customObjectsThe updated / updating customObjects for a LifeCycle.

Restrictions and Pre:
In Restrictions and Pre you could get the future changes by the special properties _NewState, _NewLifeCycleDefinition and _NewComment
Post:
In Post you could get the old information by the special properties _OldState, _OldLifeCycleDefinition and _OldComment
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

UpdateCustomEntityStates_Restrictions:

Register-VaultEvent -EventName UpdateCustomEntityStates_Restrictions -Action 'RestrictUpdateCustomEntityStates'

function RestrictUpdateCustomEntityStates($customObjects) {
    #Write event code here
}
UpdateCustomEntityStates_Pre:
Register-VaultEvent -EventName UpdateCustomEntityStates_Pre -Action 'PreUpdateCustomEntityStates'

function PreUpdateCustomEntityStates($customObjects) {
    #Write event code here
}
UpdateCustomEntityStates_Post:
Register-VaultEvent -EventName UpdateCustomEntityStates_Post -Action 'PostUpdateCustomEntityStates'

function PostUpdateCustomEntityStates($customObjects, $successful) {
    #Write event code here
}

Unexpected behaviour

UpdateCustomEntityStates event:

  • The property _OldComment on the CustomObject in the PostEvent will always be empty because the VaultAPI currently does not support Comments on CustomObjects. This is Reserved for future use.

Change Order

AddChangeOrder

EventNames:

  • AddChangeOrder_Restrictions
  • AddChangeOrder_Pre
  • AddChangeOrder_Post

Parameters

Type Name Description
ChangeOrderchangeOrderThe changeOrder which should get / is added.

Restrictions and Pre:
In Restrictions and Pre you have the all the properties available on the object like _NewNumber, _NewTitle(Item,CO), _NewDescription(Item,CO), _NewApproveDeadline and NewRouting. Custom properties are added and removed directly on the object.
Post:
In POST you have the full powerVaultChangeOrder object, because at this point the Change Order exists.
File[]filesThe Files to be tracked by the Change Order.
ChangeOrderItem[]itemsThe Items to be tracked by the Change Order.
File[]attachmentsFiles to be attached to the Change Order.
Comment[]commentsMultiple comments for the ChangeOrder including there attached files.
Email[]emailsMultiple emails to send out upon completion.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

AddChangeOrder_Restrictions:

Register-VaultEvent -EventName AddChangeOrder_Restrictions -Action 'RestrictAddChangeOrder'

function RestrictAddChangeOrder($changeOrder, $files, $items, $attachments, $comments, $emails) {
    #Write event code here
}
AddChangeOrder_Pre:
Register-VaultEvent -EventName AddChangeOrder_Pre -Action 'PreAddChangeOrder'

function PreAddChangeOrder($changeOrder, $files, $items, $attachments, $comments, $emails) {
    #Write event code here
}
AddChangeOrder_Post:
Register-VaultEvent -EventName AddChangeOrder_Post -Action 'PostAddChangeOrder'

function PostAddChangeOrder($changeOrder, $files, $items, $attachments, $comments, $emails, $successful) {
    #Write event code here
}

EditChangeOrder

EventNames:

  • EditChangeOrder_Restrictions
  • EditChangeOrder_Pre
  • EditChangeOrder_Post

Parameters

Type Name Description
ChangeOrderchangeOrderThe Change Order which should get / is in edit mode.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

EditChangeOrder_Restrictions:

Register-VaultEvent -EventName EditChangeOrder_Restrictions -Action 'RestrictEditChangeOrder'

function RestrictEditChangeOrder($changeOrder) {
    #Write event code here
}
EditChangeOrder_Pre:
Register-VaultEvent -EventName EditChangeOrder_Pre -Action 'PreEditChangeOrder'

function PreEditChangeOrder($changeOrder) {
    #Write event code here
}
EditChangeOrder_Post:
Register-VaultEvent -EventName EditChangeOrder_Post -Action 'PostEditChangeOrder'

function PostEditChangeOrder($changeOrder, $successful) {
    #Write event code here
}

CommitChangeOrder

EventNames:

  • CommitChangeOrder_Restrictions
  • CommitChangeOrder_Pre
  • CommitChangeOrder_Post

Parameters

Type Name Description
ChangeOrderchangeOrderThe changeOrder which should get / is commited.

Restrictions and Pre:
In Restrictions and Pre you have the future data set on this object like _NewNumber, _NewTitle(Item,CO), _NewDescription(Item,CO), _NewApproveDeadline and NewRouting.
Post:
In POST you have the previous properties available through _OldNumber, _OldTitle(Item,CO), _OldDescription(Item,CO), _OldApproveDeadline and OldRouting.
Custom properties are added and removed directly on the object.
File[]filesThe Files to be tracked by the Change Order.
ChangeOrderItem[]itemsThe Items to be tracked by the Change Order.
Custom link properties are added and removed directly on the changeOrderItems.
File[]attachmentsFiles to be attached to the Change Order.
Comment[]commentsMultiple comments for the ChangeOrder including there attached files.
User[]routingUsersAll the users with the associated routing roles for this Change Order.
Email[]emailsMultiple emails to send out upon completion.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

CommitChangeOrder_Restrictions:

Register-VaultEvent -EventName CommitChangeOrder_Restrictions -Action 'RestrictCommitChangeOrder'

function RestrictCommitChangeOrder($changeOrder, $files, $items, $attachments, $comments, $routingUsers, $emails) {
    #Write event code here
}
CommitChangeOrder_Pre:
Register-VaultEvent -EventName CommitChangeOrder_Pre -Action 'PreCommitChangeOrder'

function PreCommitChangeOrder($changeOrder, $files, $items, $attachments, $comments, $routingUsers, $emails) {
    #Write event code here
}
CommitChangeOrder_Post:
Register-VaultEvent -EventName CommitChangeOrder_Post -Action 'PostCommitChangeOrder'

function PostCommitChangeOrder($changeOrder, $files, $items, $attachments, $comments, $routingUsers, $emails, $successful) {
    #Write event code here
}

DeleteChangeOrders

EventNames:

  • DeleteChangeOrders_Restrictions
  • DeleteChangeOrders_Pre
  • DeleteChangeOrders_Post

Parameters

Type Name Description
ChangeOrder[]changeOrders (deletedChangeOrders in POST)The changeOrders which should get / are deleted.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

DeleteChangeOrders_Restrictions:

Register-VaultEvent -EventName DeleteChangeOrders_Restrictions -Action 'RestrictDeleteChangeOrders'

function RestrictDeleteChangeOrders($changeOrders) {
    #Write event code here
}
DeleteChangeOrders_Pre:
Register-VaultEvent -EventName DeleteChangeOrders_Pre -Action 'PreDeleteChangeOrders'

function PreDeleteChangeOrders($changeOrders) {
    #Write event code here
}
DeleteChangeOrders_Post:
Register-VaultEvent -EventName DeleteChangeOrders_Post -Action 'PostDeleteChangeOrders'

function PostDeleteChangeOrders($deletedChangeOrders, $successful) {
    #Write event code here
}

UpdateChangeOrderState

EventNames:

  • UpdateChangeOrderState_Restrictions
  • UpdateChangeOrderState_Pre
  • UpdateChangeOrderState_Post

Parameters

Type Name Description
ChangeOrderchangeOrderThe updated / updating Change Order for a LifeCycle.

Restrictions and Pre:
In Restrictions and Pre you have the future data set on this object like _NewState and _NewStateEntered.
Post:
In POST you can retrieve the previous information by using the properties _OldState and _OldStateEntered.
stringactivityThe activity being completed.
Comment[]commentsMultiple comments for the ChangeOrder including there attached files.
Email[]emailsMultiple emails to send out upon completion.
boolsuccessful Only available in Post: The information whether the Web Service call was successful or not

Examples:

UpdateChangeOrderState_Restrictions:

Register-VaultEvent -EventName UpdateChangeOrderState_Restrictions -Action 'RestrictUpdateChangeOrderState'

function RestrictUpdateChangeOrderState($changeOrder, $activity, $comments, $emails) {
    #Write event code here
}
UpdateChangeOrderState_Pre:
Register-VaultEvent -EventName UpdateChangeOrderState_Pre -Action 'PreUpdateChangeOrderState'

function PreUpdateChangeOrderState($changeOrder, $activity, $comments, $emails) {
    #Write event code here
}
UpdateChangeOrderState_Post:
Register-VaultEvent -EventName UpdateChangeOrderState_Post -Action 'PostUpdateChangeOrderState'

function PostUpdateChangeOrderState($changeOrder, $activity, $comments, $emails, $successful) {
    #Write event code here
}

Unexpected behaviour

AddChangeOrder event is raised when clicking in Vault client on New Change Order… → Save. Afterwards it fires EditChangeOrder. No CommitChangeOrder is called.
The argument files contains only the files that are directly linked to the ChangeOrder, and not the primary-links of the linked Items!
The argument comments contains the newly added comments. Because in Pre events they do not exist, there Id should be smaller than zero (like via Vault Cient) in order to get Text and Subject values. All other data is only available in Post event.

EditChangeOrder event is raised when clicking on a Change Order Edit.

CommitChangeOrder event is raised when clicking in the Change Order dialog on Save. Afterwards it fires EditChangeOrder.
The argument files contains only the files that are directly linked to the ChangeOrder, and not the primary-links of the linked Items!
The argument emails only contains the emails of the current commit, and not the once added before!
The argument comments contains the current comments and the newly added comments. Because new comments do not exist in Pre events jet, their Id should be smaller than zero (like via Vault Client) in order to get Text and Subject values. All other data is only available in Post event or for already existing comments.

UpdateChangeOrderState event is raised when clicking on Submit/Approve, in general when the State/Activity is changed.
When fired by Vault client, then the property _NewStateEntered from the argument changeOrder is the StateEntered of the current ChangeOrder!
Each comment in the argument comments has an Id smaller than zero and therefore only Subject and Message are set. All other data is unavailable, even in the POST event, because these comments are not written back to the changeOrder and therefore don't exist.