The attached script illustrates how relocation of classes in a script works.  Maybe you can use this as an example.

 

**********

 

Annamalai "Vishu" Viswanathan  --  [EMAIL PROTECTED]

Rose Technical Support Engineer

 

Rational Customer Service - Committed to Service Excellence

SCP Certified:  http://www.rational.com/support/scp.jsp

 

Rational User Conference 2002.....Freedom to Create!

Call for Papers Now Open at http://www.rational.com/ruc

August 18-22, 2002

Lake Buena Vista, Florida

 

**********

 

-----Original Message-----
From: Viswanathan, Annamalai
Sent: Wednesday, February 20, 2002 6:10 AM
To: '"Güntsch, Alexander"'
Cc: '[EMAIL PROTECTED]'
Subject: RE: (ROSE) RelocateClass (was: Deleting a RoseItem)

 

Alexander,

 

I don’t see that you have declared trashCategory as a Category anywhere in the code.  Could this be your problem?

 

Vishu 

 

**********

 

Annamalai "Vishu" Viswanathan  --  [EMAIL PROTECTED]

Rose Technical Support Engineer

 

Rational Customer Service - Committed to Service Excellence

SCP Certified:  http://www.rational.com/support/scp.jsp

 

Rational User Conference 2002.....Freedom to Create!

Call for Papers Now Open at http://www.rational.com/ruc

August 18-22, 2002

Lake Buena Vista, Florida

 

**********

 

-----Original Message-----
From: "Güntsch, Alexander" [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 6:09 AM
To: 'Rose Forum'
Subject: (ROSE) RelocateClass (was: Deleting a RoseItem)

 

Hello,

 

I'd like to forbid to create new classes in certain cases. I've tried to do this by deleting the class after a newModelElement event but rose crashes. That is somewhat comprehensible because I have to delete the RoseItem of which afterwards a pointer might still be used. Now I try a "softer" solution, i. e. I try to relocate the class in a sort of trashcan.

The trashcategory is properly initialized (global), as well as the delclass. But still the RelocateClass doesn't work. The class is afterwards just in the same category where it was created.

 

Anyone knowing a solution?

 

 

Public Sub OnNewModelElement(objRoseApp As RoseApplication, objItem As RoseItem)
    Dim retval As Boolean
    Dim modellname As String
       
    interneAenderung = True
   
    'MsgBox "NewModelElement"
    'MsgBox "Neuer Item " + objItem.Name
   
    If aktuelleAnsicht <> ANSICHT.MODELL Then
        Dim delclass As RoseClass
        Dim res As VbMsgBoxResult
        Dim res2 As Boolean
       
        res = MsgBox("Bitte wechseln Sie zum Anlegen neuer Klassen in die Modellansicht.", vbOKOnly, "Fehler")
       
        Set delclass = objRoseApp.CurrentModel.GetAllClasses.GetWithUniqueID(objItem.GetUniqueID)
        
        trashCategory.RelocateClass (delclass)
       
    Else
        ...

    End If
   
    interneAenderung = False
   
End Sub

 

Alexander

Attachment: RelocateClasses.ebs
Description: Binary data

Reply via email to