Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Customize checkmodel

56 views
Skip to first unread message

ana...@gmail.com

unread,
Jan 30, 2013, 2:11:51 PM1/30/13
to
Good night,
Somebody know how i can customizing checkmodel options for several models?

thanks,

André Nagy

Sean S

unread,
Jan 30, 2013, 4:01:42 PM1/30/13
to
Hi, 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

ana...@gmail.com

unread,
Jan 31, 2013, 7:04:21 PM1/31/13
to
Hi, 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

Sean S

unread,
Feb 1, 2013, 1:48:25 PM2/1/13
to
Hi, 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

Sean S

unread,
Feb 1, 2013, 1:51:26 PM2/1/13
to
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

ana...@gmail.com

unread,
Feb 19, 2013, 8:12:33 AM2/19/13
to
Thank you a lot, Sean.
In the second question, I did a stereotype named "external table" and did a extented attribute to verify if one table is external. It have a get method like this:
Function %Get%(obj)

%Get% = false
if obj.stereotype = "External Table" Then
%Get% = true
end if
End Function

At GTL language, for the DDL generation, i did an "if" statement for PD not write this creations and alterations for the external tables. For example, in the path ORA11GR1::Script->Objects->Table->BeforeCreate, I put this code:

[%IsTableExternal%?:PROMPT Creating Table '%OWNER%.%TABLE%']

This works ok, but PD keeps the title of the table.

/*==============================================================*/
/* Table: AVALIACAO */
/*==============================================================*/
0 new messages