|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Event Scripts > Revision > OnCheckoutCheckinApproveTree.LST script file |
It is invoked before a multiple life-cycle operation is about to be executed.
Options→Revisions
@DOCUMENT_UNIQUE_ID |
uid of the doc |
|---|---|
@ACTION |
0:checkout |
@OKACTION |
0:stop deletion |
.VBSCRIPT
Sub Main()
DBWInit(TRUE)
rootUid = DBWInput("@DOCUMENT_UNIQUE_ID")
action = DBWInput("@ACTION")
DBWMsgBox "rootUid=" & rootUid & " action=" & action
DBWOutput "@OKACTION","1",ForWriting
End Sub
Example for updating the whole db structure when doing a recursive checkin.
.VBSCRIPT
Sub Main
DBWInit(TRUE)
rootUid = DBWInput("@DOCUMENT_UNIQUE_ID")
action = DBWInput("@ACTION")
uid = DBWInput("@DOCUMENT_UNIQUE_ID")
alwaysUpdOnCheckInDoc = DBWGetOption("ALWAYS_UPDATE_DATABASE_STRUCTURE_ON_CHECKIN")
if action = "1" then 'if recursive checkin
if alwaysUpdOnCheckInDoc = "1" then 'if it is needed to update DB structure on CHECKIN
call DBWShell("OpenDocument " & uid)
DBWShell("UpdateDatabaseActiveDoc 0 0 1 0") 'traverse all top most level document assembly
end if
end if
DBWOutput "@OKACTION","1",ForWriting
End Sub