No there is no limit on size of package or model other than
a practical memory limit. By that I mean at some point the model can get
so large, that it starts using virtual memory, and things can become
slow.
As a quick size example here is a script that creates 3 packages, each with
a 1000 classes in it.
Sub Main
Dim cat As category
Dim cls As class
For x = 1 To 3
Set cat = roseapp.currentmodel.rootcategory.addcategory("cat" & x)
For y = 1 to 1000
Set cls = cat.addclass ("class_" & x & "_" & y)
Next y
Next x
MsgBox "DONE"
End Sub
More than likely what you are actually running up against is
a limit within the scripting language. You are probably doing some
recursive call that is using up all of the stack space.
If this is the problem you are encountering (and it usually happens
in the 200-400 range of some repeated operation, so it sure sounds
like it), here are some additional notes on the subject that hopefully
will help:
------------------------------------------------------------------
Script returns an error, 'Out of Stack space'
------------------------------------------------------------------
Most likely caused by recursion in the code.
Rose Script has a maximum stack of 8k (which we have it set to).
This is the maximum you can have with Summit Basic (the language
we license in Rose). One of Rational's developers wrote to Summit
Basic regarding this problem with another script, here is their
reply.
--------------------- start of mail message ---------------
Yes, you have exceeded stack space. When you Dim a userdialog, the
entire dialog definition is allocated on the execution stack, of
which there is 2K by default (but you can increase to a miximum of
8K).
To work around the stack limitation, you need to place the dialog
declarations into subroutines.
--------------------- end of mail message ---------------------
Scripts invoked using the RoseScript option on a menu or started
by RoseApp.ExecuteScript appear to have very limited stack. The
same scripts run in the script debugger have considerably more.
Why is this?
Running compiled scripts from the menu eats up more stack space then
running source in scripting environment, which has a larger amount of
stack space, hence it will often work when run directly but not from
the menu. If you run the script in the debug window the bounds are not
as tight as when running the compiled version. Much the same as when
running a debug version of C++ code and a release version of C++ code.
The debug environment is not as strict at times.
------------------------------------------------------------------
POSSIBLE WORKAROUNDs:
------------------------------------------------------------------
1) Some Code needs to be rewritten to avoid the deep recursion in
the program.
2) Not a fix but a way to get further along is to increase stack
space by running the file as a .ebs as oppossed to .ebx from
menu. This will get you 2 or 3 times further before hitting stack
limit as oppossed to if you run the ebx file directly. There maybe
some other speed issues since you are now running .ebs, but that's
the trade off.
3) Put parts of the script in a VB component and use it from the script.
You may want to rearchitect the integration by extracting some
of the logic and placing it in a COM client to Rose since this is
the most scalable solution.
4)
Fully port to visual Basic
You have the option of creating an Addin or script with VB and porting
the Rose Script code to VB.
------------------------------------------------------------------
PROBLEM EXAMPLES:
------------------------------------------------------------------
1)
Sub recurse (ByVal depth As Integer)
Print depth
recurse depth+1
End Sub
Sub Main
viewport.open
recurse 1
End Sub
runs for 359 iterations in the debugger before stopping with an out of
stack space error.
If started from the menu it recurses 80 times before stopping (with no
error message). Whilst the example is trivial some of my more complex
scripts now won't run from the menu
------------------------------------------------------------------
2)
The following script compiles and runs if executed directly (.ebs).
Script fails to execute if compiled ebx is run.
If ANY two lines are removed from dialog, then compiled script runs.
Fails in both Rose 98 and Rose 98i.
'------------------------------------------------------------------
Sub Main
Dim theCategories () As String
Dim anyList () As String
Begin Dialog ViewWizardDialog ,,292,225,"View Wizard"
GroupBox 4,4,284,52,"Domain",.GroupBox1
Text 8,16,32,8,"Package:",.ClassPackage
DropListBox 8,24,136,80,theCategories$,.ClassPackageListBox
Text 148,16,32,8,"Class:",.Text1
DropListBox 148,24,136,80,anyList$,.ClassListBox
Text 120,44,24,8,"Owner:",.Text7
TextBox 148,40,124,12,.OwnerName
PushButton 272,40,12,12,"<-",.CopyOwnerButton
CheckBox 56,60,60,8,"Show inherited",.InheritedCeckBox
Text 8,60,32,8,"Attributes:",.Text2
ListBox 8,72,108,64,anyList$,.AttributeList
PushButton 124,72,12,12,">>",.AllRightButton
PushButton 124,88,12,12,">",.OneRightButton
PushButton 124,104,12,12,"X",.OneDeleteButton
PushButton 124,120,12,12,"XX",.AllDeleteButton
Text 144,60,36,8,"Inclusions:",.Text3
ListBox 144,72,108,64,anyList$,.InclusionList
PushButton 260,72,24,14,"Up",.UpButton
PushButton 260,88,24,14,"Down",.DownButton
PushButton 260,104,24,14,"Edit",.EditButton
PushButton 260,120,24,14,"New",.NewButton
Text 8,136,20,8,"Path:",.Text8
TextBox 28,136,224,12,.Path
GroupBox 4,152,284,52,"View",.GroupBox2
Text 8,164,32,8,"Package:",.Text4
DropListBox 8,172,136,84,theCategories$,.ViewPackageListBox
Text 148,164,32,8,"Diagram:",.Text6
DropListBox 148,172,136,80,anyList$,.ViewDiagramListBox
Text 8,192,24,8,"Name:",.Text5
TextBox 32,188,112,12,.ViewName
CheckBox 196,192,47,8,"Top view",.TopCheckBox
OKButton 4,208,48,14,.CreateButton
PushButton 124,208,48,14,"About",.AboutButton
CancelButton 240,208,48,14,.CancelButton
End Dialog
Begin Dialog AboutDialog ,,255,264,"About View Wizard"
CancelButton 112,248,40,14
Text 92,4,80,16,"View Wizard",.Text1,,14,ebBold
Text 84,20,104,8,"Rado1 Cervenka, Aitecon s.r.o.",.Text2
Text 108,28,52,8,"[EMAIL PROTECTED]",.Text3
Text 16,40,228,24,"The View Wizard dialog is aimed to help
with
automatic creation of View Classes from the Domain Classes and placing them
into model diagrams. For more detailed description see the HML language
specification.",.Text4
Text 8,80,72,8,"Domain / Package",.Text5,,,ebBold
Text 8,88,72,8,"Domain / Class",.Text6,,,ebBold
Text 8,184,72,8,"View / Package",.Text7,,,ebBold
Text 8,192,72,8,"View / Diagram",.Text8,,,ebBold
Text 8,200,72,8,"View / Name",.Text9,,,ebBold
GroupBox 4,68,248,176,"Dialog Item Descriptions",.GroupBox1
Text 8,112,72,8,"Attributes",.Text10,,,ebBold
Text 8,144,72,8,"Inclusions",.Text11,,,ebBold
Text 88,80,160,8,"a package containing the source domain
class",.Text12
Text 88,88,160,8,"the source domain class",.Text13
Text 88,112,160,8,"attributes of the source domain
class",.Text14
Text 88,144,160,8,"inclusions being created in the target
view
class",.Text15
Text 88,184,160,8,"a package which will contain the target
view
class",.Text16
Text 88,192,160,8,"a diagram which will display the target
view
class",.Text17
Text 88,200,160,8,"a name of the target view class being
created",.Text18
Text 8,128,72,8,"> >>",.Text19,,,ebBold
Text 88,128,160,8,"move item(s) from attribute to inclusion
list",.Text20
Text 8,152,72,8,"Up, Down",.Text21,,,ebBold
Text 8,216,72,8,"OK",.Text22,,,ebBold
Text 8,232,72,8,"Cancel",.Text24,,,ebBold
Text 8,224,72,8,"About",.Text25,,,ebBold
Text 88,152,160,8,"change an order of inclusions",.Text26
Text 88,216,160,8,"create the new target view class",.Text27
Text 88,232,160,8,"cancel the View Wizard (all actions
remains
valid)",.Text29
Text 88,224,160,8,"this window",.Text30
Text 8,136,72,8,"X XX",.Text31,,,ebBold
Text 88,136,160,8,"delete inclusion(s)",.Text32
Text 8,208,72,8,"View / Top view",.Text33,,,ebBold
Text 88,208,160,8,"top view indicator",.Text34
Text 8,120,72,8,"Show inherited",.Text23,,,ebBold
Text 88,120,160,8,"dispaly also inherited attributes",.Text28
Text 8,160,72,8,"Edit",.Text35,,,ebBold
Text 8,168,72,8,"New",.Text36,,,ebBold
Text 8,176,72,8,"Path",.Text37,,,ebBold
Text 88,160,160,8,"edit an existing inclusion",.Text38
Text 88,168,160,8,"add new inclusion",.Text39
Text 88,176,160,8,"navig. path of inclusions created from
attributes",.Text40
Text 8,104,72,8,"<-",.Text41,,,ebBold
Text 8,96,72,8,"Owner",.Text42,,,ebBold
Text 88,96,160,8,"an owner of target view class",.Text43
Text 88,104,160,8,"copy owner from domain class list",.Text44
End Dialog
' create dialog variables
Dim MyDialog As ViewWizardDialog
Dim MyAboutDialog As AboutDialog
Dialog MyDialog
Dialog MyAboutDialog
End Sub
'------------------------------------------------------------------
3)
The only fix that is available is to reorganize the above script.
To work around the stack limitation, you need to place the dialog
declarations into subroutines. Modified the above script to
demonstrate:
'------------------------------------------------------------------
Sub Dialog1()
Dim theCategories () As String
Dim anyList () As String
Begin Dialog ViewWizardDialog ,,292,225,"View Wizard"
GroupBox 4,4,284,52,"Domain",.GroupBox1
Text 8,16,32,8,"Package:",.ClassPackage
DropListBox 8,24,136,80,theCategories$,.ClassPackageListBox
Text 148,16,32,8,"Class:",.Text1
DropListBox 148,24,136,80,anyList$,.ClassListBox
Text 120,44,24,8,"Owner:",.Text7
TextBox 148,40,124,12,.OwnerName
PushButton 272,40,12,12,"<-",.CopyOwnerButton
CheckBox 56,60,60,8,"Show inherited",.InheritedCeckBox
Text 8,60,32,8,"Attributes:",.Text2
ListBox 8,72,108,64,anyList$,.AttributeList
PushButton 124,72,12,12,">>",.AllRightButton
PushButton 124,88,12,12,">",.OneRightButton
PushButton 124,104,12,12,"X",.OneDeleteButton
PushButton 124,120,12,12,"XX",.AllDeleteButton
Text 144,60,36,8,"Inclusions:",.Text3
ListBox 144,72,108,64,anyList$,.InclusionList
PushButton 260,72,24,14,"Up",.UpButton
PushButton 260,88,24,14,"Down",.DownButton
PushButton 260,104,24,14,"Edit",.EditButton
PushButton 260,120,24,14,"New",.NewButton
Text 8,136,20,8,"Path:",.Text8
TextBox 28,136,224,12,.Path
GroupBox 4,152,284,52,"View",.GroupBox2
Text 8,164,32,8,"Package:",.Text4
DropListBox 8,172,136,84,theCategories$,.ViewPackageListBox
Text 148,164,32,8,"Diagram:",.Text6
DropListBox 148,172,136,80,anyList$,.ViewDiagramListBox
Text 8,192,24,8,"Name:",.Text5
TextBox 32,188,112,12,.ViewName
CheckBox 196,192,47,8,"Top view",.TopCheckBox
OKButton 4,208,48,14,.CreateButton
PushButton 124,208,48,14,"About",.AboutButton
CancelButton 240,208,48,14,.CancelButton
End Dialog
Dim MyDialog As ViewWizardDialog
Dialog MyDialog
End Sub
Sub Dialog2()
Begin Dialog AboutDialog ,,255,264,"About View Wizard"
CancelButton 112,248,40,14
Text 92,4,80,16,"View Wizard",.Text1,,14,ebBold
Text 84,20,104,8,"Rado1 Cervenka, Aitecons.r.o.",.Text2
Text 108,28,52,8,"[EMAIL PROTECTED]",.Text3
Text 16,40,228,24,"The View Wizard dialog is aimed to help
with
automatic creation of View Classes from the Domain Classes And placing them
into model diagrams. For more detailed description see the HML language
specification.",.Text4
Text 8,80,72,8,"Domain / Package",.Text5,,,ebBold
Text 8,88,72,8,"Domain / Class",.Text6,,,ebBold
Text 8,184,72,8,"View / Package",.Text7,,,ebBold
Text 8,192,72,8,"View / Diagram",.Text8,,,ebBold
Text 8,200,72,8,"View / Name",.Text9,,,ebBold
GroupBox 4,68,248,176,"Dialog Item Descriptions",.GroupBox1
Text 8,112,72,8,"Attributes",.Text10,,,ebBold
Text 8,144,72,8,"Inclusions",.Text11,,,ebBold
Text 88,80,160,8,"a package containing the source domain
class",.Text12
Text 88,88,160,8,"the source domain class",.Text13
Text 88,112,160,8,"attributes of the source domain
class",.Text14
Text 88,144,160,8,"inclusions being created in the target
view
class",.Text15
Text 88,184,160,8,"a package which will contain the target
view
class",.Text16
Text 88,192,160,8,"a diagram which will display the target
view
class",.Text17
Text 88,200,160,8,"a name of the target view class being
created",.Text18
Text 8,128,72,8,"> >>",.Text19,,,ebBold
Text 88,128,160,8,"move item(s) from attribute to inclusion
list",.Text20
Text 8,152,72,8,"Up, Down",.Text21,,,ebBold
Text 8,216,72,8,"OK",.Text22,,,ebBold
Text 8,232,72,8,"Cancel",.Text24,,,ebBold
Text 8,224,72,8,"About",.Text25,,,ebBold
Text 88,152,160,8,"change an order of inclusions",.Text26
Text 88,216,160,8,"create the new target view class",.Text27
Text 88,232,160,8,"cancel the View Wizard (all actions
remains
valid)",.Text29
Text 88,224,160,8,"this window",.Text30
Text 8,136,72,8,"X XX",.Text31,,,ebBold
Text 88,136,160,8,"delete inclusion(s)",.Text32
Text 8,208,72,8,"View / Top view",.Text33,,,ebBold
Text 88,208,160,8,"top view indicator",.Text34
Text 8,120,72,8,"Show inherited",.Text23,,,ebBold
Text 88,120,160,8,"dispaly also inherited attributes",.Text28
Text 8,160,72,8,"Edit",.Text35,,,ebBold
Text 8,168,72,8,"New",.Text36,,,ebBold
Text 8,176,72,8,"Path",.Text37,,,ebBold
Text 88,160,160,8,"edit an existing inclusion",.Text38
Text 88,168,160,8,"add new inclusion",.Text39
Text 88,176,160,8,"navig. path of inclusions created from
attributes",.Text40
Text 8,104,72,8,"<-",.Text41,,,ebBold
Text 8,96,72,8,"Owner",.Text42,,,ebBold
Text 88,96,160,8,"an owner of target view class",.Text43
Text 88,104,160,8,"copy owner from domain class list",.Text44
End Dialog
Dim MyAboutDialog As AboutDialog
Dialog MyAboutDialog
End Sub
Sub Main
Dialog1
Dialog2
End Sub
'------------------------------------------------------------------
Patrick Kennedy
Rational Support
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 24, 2002 9:38 AM
To: [EMAIL PROTECTED]
Subject: (ROSE) How many classes can you load into a package ?
Hi,
for a dictionary of terms I tried to load all my terms as classes in a
package
called "terms a-z". When my script reached number 230, the load broke. Does
anybody know a solution? Or is the capacity of a package restricted to 230
classes?
Thanks in forward,
Sincerely
Heinz
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
* http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
* To: [EMAIL PROTECTED]
* Subject: <BLANK>
* Body: unsubscribe rose_forum
*************************************************************************
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Post or Reply to: [EMAIL PROTECTED]
* Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
* http://www.rational.com/support/usergroups/rose/rose_forum.jsp
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
* To: [EMAIL PROTECTED]
* Subject: <BLANK>
* Body: unsubscribe rose_forum
*************************************************************************