OnCheckoutCheckinApproveTree.LST script file

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Event Scripts > Revision >

OnCheckoutCheckinApproveTree.LST script file

Description

It is invoked before a multiple life-cycle operation is about to be executed.

Activation

Options→Revisions

Input

@DOCUMENT_UNIQUE_ID

uid of the doc

@ACTION

0:checkout
1:checkin
2:approve

Output

@OKACTION

0:stop deletion
1:proceed with the action

Example

.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