Professional Documents
Culture Documents
Step-By-Step Tutorial
PREAMBLE
Administrator of AVEVA PDMS/Marine systems should maintain project performing some tasks which usually done
on periodical basis. Some of them are databases integrity check, sessions merging, creation of Review file (RVM),
Inter-DB macro run, piping consistency check, clashes check etc. Many of these procedures could be done in auto
mode running with the scheduler for example at nights. In next several examples, we will review some of the
procedures
The result of some following actions is a log-file where administrator can check if there are any problems found. It
is also possible automatically send any logs to email – some PML code should be added (not done here).
Although it is possible to try to fix the problems in automode, we highly recommend to do it manually under
control of Administrator after reading the log visually.
All the following procedures written on PML and checked on SAM project supplied with AVEVA PDMS. For any
other projects it should modified by Administrator of this project therefore prerequisites for those who wants to
use it and modify are PML and Admin knowledge.
BEFORE DO ANY ACTION YOU MUST BE SURE THAT YOUR PROJECT IS BACKUPED
PART 1. Initial setup – preparing folders to store log-files and users expunge
do !x from 1 to !DBS.Size()
--skip if Foreign
skip if (!DBS[!x].DbRef().Fore EQ 'FOREIGN')
!dbName = !DBS[!x].DbRef().Name
--replacing not allowable symbols in file name
!nfile = '$!folders[1]' & !DBS[!x].DbRef().Name.After('/*').Replace('/','!') & '.txt'
!outputLOGFILE.WriteFile('OVERWRITE',!outputLOG)
--End of Block 5
EXPORT ALL PIPE WITH (MATCHWILD(NAME,'*A*') AND NAME OF ZONE EQ '/PIPES') FOR CE COLOUR 2
EXPORT ALL PIPE WITH (MATCHWILD(NAME,'*B*') AND NAME OF ZONE EQ '/PIPES') FOR CE COLOUR 3
EXPORT ALL PIPE WITH (MATCHWILD(NAME,'*C*') AND NAME OF ZONE EQ '/PIPES') FOR CE COLOUR 6
AVEVA PDMS/MARINE
Step-By-Step Tutorial
EXPORT FINISH
--End of Block 6
--PART1
!folders[1] = 'C:\temp\NIGHT-WORK\DatabaseCheck\'
!folders[2] = 'C:\temp\NIGHT-WORK\PipingCheck\'
!folders[3] = 'C:\temp\NIGHT-WORK\Review\'
do !x from 1 to !folders.Size()
ADMIN
EXPUNGE
VAR !DBS COLLECT ALL DB
do!x from 1 to !DBS.Size()
!DBNA = !DBS[!X].Dbref().Name.After('/*')
EXPUNGE DB $!DBNA
HANDLE (1,271)(1,273)
ENDHANDLE
ENDDO
--PART2
VAR !DBS COLL ALL DB
!outputLOG = object array()
!outputLOGFILE = object file('$!folders[1]' + '!TotalLOG-DB.log')
VAR !mdbn MDB
CHECKOPTION EXT CHECK PREF $!mdbn
do !x from 1 to !DBS.Size()
skip if (!DBS[!x].DbRef().Fore EQ 'FOREIGN')
!dbName = !DBS[!x].DbRef().Name
!nfile = '$!folders[1]' & !DBS[!x].DbRef().Name.After('/*').Replace('/','!') & '.txt'
--PART 3
VAR !PROJCODE PROJ CODE
!TOEVAL = |VAR !MACFOLDER EVAR '$!PROJCODE| & |MAC'|
$!TOEVAL
!MacroFolder = object file(!MACFOLDER)
DESIGN
!files = !MacroFolder.Files()
if (!files.Size() NEQ 0) then
do !x from 1 to !files.Size()
!path = !files[!x].String()
$M/$!path
enddo
AVEVA PDMS/MARINE
Step-By-Step Tutorial
MONITOR
do !x from 1 to !files.Size()
DELETE MAC $!x
enddo
endif
--PART 4
DESIGN
MAP BUILD MDB
HANDLE (69,97)
ENDHANDLE
--PART 5
ZONE /PIPES
!pipes = !!CollectAllFor('PIPE',||,CE)
!outputLOG = object array()
!outputLOGFILE = object file('$!folders[2]' + '!TotalLOG-PIPES.log')
do !x from 1 to !pipes.Size()
!nfile = '$!folders[2]' & !pipes[!x].Name.Replace('/','!') & '.txt'
ALPHA LOG/$!nfile OVER
$!pipes[$!x]
VAR !userm USERM
VAR !lastm LASTM
!user = 'Modified by user: $!userm , $!lastm'
$P $!user
CHECK CE
ALPHA LOG END
!logfile = object file(!nfile)
!logfileRead = !logfile.ReadFile()
if (!logfileRead[!logfileRead.Size()].Matchwild('*NO DATA INCONSISTENCIES*').Not()) then
!outputLOG.Append('PIPE $!!CE.Name : inconsistencies found... Manual check needed…')
endif
enddo
!outputLOGFILE.WriteFile('OVERWRITE',!outputLOG)
--PART 6
SITE /STABILIZER
!CEName = !!CE.Name
VAR !projcode PROJ CODE
!revFile = object file('$!folders[3]' + '$!projcode' + '_model.rvm')
EXPORT FINISH
--PART 7
ADMIN
VAR !DBS COLL ALL DB
do !x from 1 to !DBS.Size()
skip if (!DBS[!x].DbRef().Fore EQ 'FOREIGN')
!mergewhere = !DBS[!x].DbRef().Name.After('/*')
MERGE CHAN $!mergewhere
HANDLE (1,18)(1,293)
ENDHANDLE
enddo