Chapter 7 Scripting PowerDesigner


Extracting a Repository Document

There are two ways to extract a repository document using scripting:

To extract any document:

Use the following Description
ExtractToFile(ByVal FileName As String, ByVal MergeMode As Long = 2, ByVal OpenMode As Boolean = -1, ByRef Actions As String = NULL, ByRef Conflicts As String = NULL) As BaseObject Method on RepositoryModel that allows you to extract any kind of document

To extract a PowerDesigner document:

Use the following Description
UpdateFromRepository(ByVal MergeMode As Integer = 2, ByRef actions As String = NULL, ByRef conflicts As String = NULL) As Boolean Method on BaseModel that allows you to extract PowerDesigner documents

Generic way

To extract a repository document you must:

Example

set C = RepositoryConnection
C.Open
Dim D, P
set P = Nothing
for each D in C.ChildObjects
if D.IsKindOf (cls_RepositoryModel) then
D.ExtractToFile ("C:\temp\OO.OOM")
end if
next

Specific way

To extract a RepositoryModel document or a RepositoryReport document you must:

Example

set MyModel = OpenModel ("C:\temp\OO3.OOM")
MyModel.UpdateFromRepository 

 


Copyright (C) 2008. Sybase Inc. All rights reserved.