Item Events

EventNames:

  • AddItem_Restrictions

  • AddItem_Pre

  • AddItem_Post

Parameters

Type

Name

Description

Item

item

The 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.

bool

successful

Post:
The information whether the Web Service call was successful or not is only available in Post events.

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.

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
}

EventNames:

  • CommitItems_Restrictions

  • CommitItems_Pre

  • CommitItems_Post

Parameters

Type

Name

Description

Item[]

items

The 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.

bool

successful

Post:
The information whether the Web Service call was successful or not is only available in Post events.

Unexpected Behaviour

CommitItems: is raised when clicking in the item dialog on Save or Save and Close.

When changing Item number via the 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 which has a Comment, the properties _Comment and _OldComment will be empty because the comment will be automatically cleared from the previous API call ItemService.EditItems.

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
}

EventNames:

  • DeleteItems_Restrictions

  • DeleteItems_Pre

  • DeleteItems_Post

Parameters

Type

Name

Description

Item[]

items (deletedItems in POST)

The items which should get / are deleted.

bool

successful

Post:
The information whether the Web Service call was successful or not is only available in Post events.

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
}

EventNames:

  • EditItems_Restrictions

  • EditItems_Pre

  • EditItems_Post

Parameters

Type

Name

Description

Item[]

items

The items which should get / are in edit mode.

bool

successful

Post:
The information whether the Web Service call was successful or not is only available in Post events.

Unexpected Behaviour

The EditItems event is raised when:

  • clicking on Open -> Edit or directly “Update “for the item.

  • clicking on Save (not save and close) in the dialog then first CommitItem is fired, and then EditItem

  • activating in the the Bill of Materials Tab of the Item dialog a new item

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
}

EventNames:

  • PromoteItems_Restrictions

  • PromoteItems_Pre

  • PromoteItems_Post

Parameters

Type

Name

Description

File[]

files

The files which should get / are assigned to the items.

Item[]

items

The items which should get / are assigned to the files.

bool

successful

Post:
The information whether the Web Service call was successful or not is only available in Post events.

Unexpected Behaviour

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.

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
}

EventNames:

  • UpdateItemStates_Restrictions

  • UpdateItemStates_Pre

  • UpdateItemStates_Post

Parameters

Type

Name

Description

Item[]

items

The Items in Vault for which the lifefycle status changes/was changed.

Restrictions and Pre:
In these events you can get the future changes through the special properties _NewState, _NewLifeCycleDefinition and _NewComment.

Post:
In this event you can retrieve the information from previous events by using the properties _OldState, _OldLifeCycleDefinition and _OldComment.

bool

successful

Post:
The information whether the Web Service call was successful or not is only available in the _Post event.

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
}

EventNames:

  • RollbackItemState_Restrictions

  • RollbackItemState_Pre

  • RollbackItemState_Post

Parameters

Type

Name

Description

Item

item

The 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.

bool

successful

Post:
The information whether the Web Service call was successful or not is only available in Post events.

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
}