I agree with everything said in the following reply, except that in my
experience, when you disassociate the class from the component, the language
does NOT revert back. I just tried it and it seemed to work fine.

Here is a script that will do what is suggested (create a module, assign the
language, assign a class to it, and then delete the module), so that you can
do it in one quick step via a script, rather than doing it by hand.

No error checking, niceties, etc.... but it is start if this is the kind of
thing you need to do.

        James.

' Simple script to assign a language to a class, without having
' to create a module by hand

Sub Main
        ' Get the selected class
        ' This assumes only one selected - also no error checking
        ' to see if the item selected is really a class
        Dim class As Class
        Set class = RoseApp.CurrentModel.GetSelectedClasses().GetAt(1)

        ' Ask the user what language
        ' Could provide a list, etc., but quick and dirty for now
        Dim lang As String
        lang = AskBox("Enter language")

        ' Get the component view
        Dim subs As Subsystem
        Set subs = RoseApp.CurrentModel.RootSubsystem

        ' Create a temp module
        Dim module As Module
        Set module = subs.AddModule("temp")

        ' Assign the user specified language to the module
        module.AssignedLanguage = lang

        ' Assign the module to the class, so its language gets changed
        class.AddAssignedModule module

        ' and now delete the temporary module
        Dim result As Boolean
        result = subs.DeleteModule(module)
End Sub

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Couball, James
> Sent: Thursday, November 16, 2000 12:37 PM
> To: 'Ron Alderson'; [EMAIL PROTECTED]
> Subject: RE: (ROSE) Model Properties
>
>
>
> You are correct in saying the language is selected for the
> class, it can not
> be changed directly from the class.  However, you can control
> the language
> assignment by creating a component, selecting the language for the
> component, and then assigning the class to the component.
> This effectively
> changes the language of the class.  However, if you
> disassociate the class
> from the component, it reverts back to the previously
> selected language.
>
> Pretty screwy in my humble opinion, but that is the way it works.
>
> Sincerely,
> James Couball
> Cotelligent.
>
> -----Original Message-----
> From: Ron Alderson [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 14, 2000 9:08 AM
> To: [EMAIL PROTECTED]
> Subject: (ROSE) Model Properties
>
>
>
> Ok, let me answer my own question then:
>
> As I see it, it works like this: when I turn on a language in
> Notation tab
> of Model Properties, any new class I create gets 'tied' to
> this language for
>
> all time. So, for example, if I turn on C++, and create a new
> class, my
> choices for attribute types and method return types are all
> C++ types. If I
> switch language to Java, that class will still be a C++ class
> -- there is no
>
> automatic mapping of C++ types to Java types, etc.
>
> When I generate code, I'm assuming it's 'modeler beware' --
> there will be no
>
> automatic mapping on output. I suppose I could run some sort
> of report to
> tell me where I've violated Java rules...
>
> If I'm not correct on the above, someone please let me know...
>
>
>
> -------------
> The Question:
> If I start off with Java selected, and draw a class, and set
> one of its
> attribute types to say Int, what happens when I then go into model
> properties and change my default Notation to, say, VB? Rose
> does not seem to
>
> translate my Java property to a VB equivalent. I only seem to
> get VB types
> on any new classes I draw. Is this the way it is intended to work?
>
> I haven't tried this yet, but what would I expect to happen
> if I generate
> the above to a VB module, or a Java file?
>
> Is there any way that I can push a button and translate my
> Java properties
> to VB or C++ or Oracle equivalents?
>
> ______________________________________________________________
> ___________
> Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* 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
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages:
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* 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
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages: 
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************

Reply via email to