Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: tb on July 31, 2008, 12:30:36 am

Title: Sequence diagram, return message
Post by: tb on July 31, 2008, 12:30:36 am
Hello,
i got problem. I cannot solve how to create connector to be a return message in sequence diagram.

I can create something like this:
(http://terabyte.home.pl/ea/ea1.jpg)

but i need something like this:
(http://terabyte.home.pl/ea/ea2.jpg)

I have solved that i can do this in ea by setting isReturn in
properties of message:
(http://terabyte.home.pl/ea/eareturn.jpg)

Do You know how to do this by interface ?
Title: Re: Sequence diagram, return message
Post by: Frank Horn on July 31, 2008, 03:16:50 am
Can't try it out now cause I'm sitting at home on the sofa with an EEE PC, but if I got it right you'e adding a connector of type "sequence" to a package via automation interface, set its source and target to your respective lifelines, and then want to make it a return call.

The online manual lists no such property for EA.Connector, so maybe it's hidden in one of those indefinite collections. To find out I would try to iterate through the .Properties and .CustomProperties collections of the connector and print their names and values to the console (or debug window or whatever) to see if something looks like it.
Title: Re: Sequence diagram, return message
Post by: KP on July 31, 2008, 09:05:34 am
The database field is t_connector->PDATA4 which changes from 0 to 1. In automation, that will be Connector.Miscdata(3). Is that field still read-only? If so, worth a feature request through the normal channels (http://www.sparxsystems.com/feature_request.htm).
Title: Re: Sequence diagram, return message
Post by: tb on July 31, 2008, 04:13:40 pm
Ok i have solved it out with suggestion of Frank Horn. I'am using Java API:

Code: [Select]
Connector conn = // get your connector here
Property prop = conn.GetProperties().Item("IsReturn");
prop.SetValue(new Boolean(true));

But this value is write only, becouse in Java API when you want to invoke Property.getValue() its throwing an exception, but only when the name of the item is "IsReturn"
Should I send a bug report ?
Title: Re: Sequence diagram, return message
Post by: «Midnight» on July 31, 2008, 08:38:02 pm
Yes, I think you should.

Regardless of what this is supposed to be doing, throwing an exception does not seem to be the correct way to indicate a problem here.

That is, unless the property has never been set up. Even then, I'd expect you would not be able to access the property at all (i.e. the property name does not exist), or you should get a null value returned (i.e. the property has no value yet). You might want to do a little work - perhaps check an XMI export of the owning package - to see if the property is there at all when you first access it. If the property is defined - even without a value - then get send a bug report to Sparx.

David