Discussion:
Customize checkmodel
(too old to reply)
a***@gmail.com
2013-01-30 19:11:51 UTC
Permalink
Good night,
Somebody know how i can customizing checkmodel options for several models?

thanks,

André Nagy
Sean S
2013-01-30 21:01:42 UTC
Permalink
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
Post by a***@gmail.com
Good night,
Somebody know how i can customizing checkmodel options for several models?
thanks,
André Nagy
a***@gmail.com
2013-02-01 00:04:21 UTC
Permalink
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
Post by Sean S
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
Post by a***@gmail.com
Good night,
Somebody know how i can customizing checkmodel options for several models?
thanks,
André Nagy
Sean S
2013-02-01 18:48:25 UTC
Permalink
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
Post by a***@gmail.com
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
Post by Sean S
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
Post by a***@gmail.com
Good night,
Somebody know how i can customizing checkmodel options for several models?
thanks,
André Nagy
Sean S
2013-02-01 18:51:26 UTC
Permalink
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 S
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
Post by a***@gmail.com
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
Post by Sean S
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
Post by a***@gmail.com
Good night,
Somebody know how i can customizing checkmodel options for several models?
thanks,
André Nagy
a***@gmail.com
2013-02-19 13:12:33 UTC
Permalink
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 */
/*==============================================================*/
Post by Sean S
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 S
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
Post by a***@gmail.com
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
Post by Sean S
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
Post by a***@gmail.com
Good night,
Somebody know how i can customizing checkmodel options for several models?
thanks,
André Nagy
Loading...