Oops, I pasted an old version of the script - it has a bug. The corrected script is below:
CheckModels ActiveWorkspace
Private Sub CheckModels(oWorkspaceFolder)
Dim oWorkspaceElement, oModel
For Each oWorkspaceElement in oWorkspaceFolder.Children
If oWorkspaceElement.IsKindOf(PdWSP.cls_WorkspaceFolder) Then
CheckModels(oWorkspaceElement)
Else
If oWorkspaceElement.IsKindOf(PdWSP.cls_WorkspaceModel) Then
Output "Opening " & oWorkspaceElement.Name & "..."
Set oModel = oWorkspaceElement.Open
If Not oModel Is Nothing Then
Output "Checking " & oModel.Name & "..."
oModel.CheckModel
End If
End If
End If
Next
End Sub
Post by Sean SHi, André. Here's a simple VB script to run a model check on all models in your workspace. It will even recursively scan through folders, if you're using them, to look for all models. YOu can run it using Tools -> Execute Commands -> Edit/run Script, or you can put the code in the Extension.
--------------------------------------------------
CheckModels ActiveWorkspace
Private Sub CheckModels(oWorkspaceFolder)
Dim oWorkspaceElement, oModel
For Each oWorkspaceElement in oWorkspaceFolder
If oWorkspaceElement.IsKindOf(PdWSP.cls_WorkspaceFolder) Then
CheckModels(oWorkspaceElement)
Else
If oWorkspaceElement.IsKindOf(PdWSP.cls_WorkspaceModel) Then
Output "Opening " & oWorkspaceElement.Name & "..."
Set oModel = oWorkspaceElement.Open
If Not oModel Is Nothing Then
Output "Checking " & oModel.Name & "..."
oModel.CheckModel
End If
End If
End If
Next
End Sub
----------------------------------------------------------------
I don't understand your second question. I've never used stereotypes. Also, I wasn't aware that external tables could have foreign keys. Perhaps this is a DBMS difference? I'm using Oracle.
Good luck. I hope the script helps.
Sean
Post by a***@gmail.comHi, Sean,
Thanks for your response. I'm looking for a method to execute the same (F4)modelcheck for all models in workspace. I'll try to use a CheckModelItem to do a set-list for one default F4. F4 Check dialog box don't have a feature like "selections" to assemble the default.
I have other problem in PD customizing. Instead shortcuts, i'm using a stereotype for external tables, checking "generate" table option to false, but when I'll generate DDL file don't appear foreing key linked to parent table. Do you have any idea about this?
tks
Post by Sean SHi, André.
You need to spend some time reading about Extensions. Here's a link to the documentation in version 16.1 about writing Custom Checks in Extensions.
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc38628.1610/doc/html/rad1232022323759.html
Cheers,
Sean
Post by a***@gmail.comGood night,
Somebody know how i can customizing checkmodel options for several models?
thanks,
André Nagy