Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: chrvi on June 28, 2007, 12:29:37 pm

Title: How to access method's Behaviour/InitialCode?
Post by: chrvi on June 28, 2007, 12:29:37 pm
Hi,

I need to access a method's Initial Code (to write down my check constraint code there). Does anybody have an idea how to do that via Automation?

I tried to fill Behaviour / Initial Code of a method manually in EA with "xxx" and then tried to print out various method values but the "xxx" value never appeared.
For example myMethod.getBehaviour() returns just an empty string "".

Isn't there another way of setting check constraint code?
Title: Re: How to access method's Behaviour/InitialCode?
Post by: «Midnight» on June 28, 2007, 04:25:35 pm
I have not tried this, but see what you get from the Default() property.
Title: Re: How to access method's Behaviour/InitialCode?
Post by: Eve on June 28, 2007, 06:08:42 pm
Try myMethod.getCode().
Title: Re: How to access method's Behaviour/InitialCode?
Post by: chrvi on June 29, 2007, 04:14:09 am
Oh yeah, that's it :-)
Thanks a lot.

However, I'm rather confused that the solution is to access an attribute (i.e. Code) which shouldn't have been used so far (according to EA help file), nevertheless it works. :-)

By the way, wouldn't it be easier for users and more comfortable for you, the EA administrators, if Sparx released a kind of more detailed documentation to Automation Interface? We wouldn't bother you with thousands of quite simple problems (simple for you)...
Title: Re: How to access method's Behaviour/InitialCode?
Post by: thomaskilian on June 29, 2007, 05:47:24 am
 ;D Join us in waiting for that. It has improved a bit. However, navigating in the help for needed information is still a nightmare. There is an EA model of EA somewhere on the EA Users Group site...
Title: Re: How to access method's Behaviour/InitialCode?
Post by: chrvi on July 13, 2007, 11:21:26 am
I don't mind navigating in the help file but I'm missing a lot of stuff there.
The most I'm disappointed with partial info such as Package.Flags: "Extended information about package"
Then you can only try to find out what useful info can be stored in such object...