Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: tweber on December 18, 2023, 11:28:01 pm

Title: Script Automation - add asynchronous signal to sequence diagram
Post by: tweber on December 18, 2023, 11:28:01 pm
Does anyone know how to configure a connector on a sequence diagram so it shows as an asynchronous signal, rather than as a synchronous call?
Title: Re: Script Automation - add asynchronous signal to sequence diagram
Post by: Geert Bellekens on December 19, 2023, 12:43:55 am
Make two connectors, one synchronous, and one asynchronous, and then compare both records in t_connector to figure out the difference.

Geert
Title: Re: Script Automation - add asynchronous signal to sequence diagram
Post by: tweber on December 19, 2023, 07:13:45 am
Thanks for the quick reply.  I've done that.  The async info is stored in PDATA (1 and 3).  That said, MiscData(0) and MiscData(2) are read only and I can't update them to 'Asynchronous' and 'Signal' respectively.  I'm searching for a way to create a signal via script.

Thanks.
Title: Re: Script Automation - add asynchronous signal to sequence diagram
Post by: qwerty on December 19, 2023, 10:09:54 am
You need to place an according UPDATE SQL in repository.execute("..."). It's undocumented but the only circumvention we have in such cases.

q.
Title: Re: Script Automation - add asynchronous signal to sequence diagram
Post by: Takeshi K on December 19, 2023, 01:05:29 pm
Hello tweber,

You can use Connector.Properties collection. In this collection, when Property.Name = "Kind", set Property.Value = "Signal" and similart to "IsAsync".

HTH,
Title: Re: Script Automation - add asynchronous signal to sequence diagram
Post by: tweber on December 20, 2023, 12:34:26 am
Takeshi K,

I added this to my script:
  evConn.Properties("Kind").Value   = "Signal";
  evConn.Properties("IsAsync").Value   = true;

That worked. 

For connectors,
Properties contains five (key, value) pairs:
Title: Re: Script Automation - add asynchronous signal to sequence diagram
Post by: tweber on December 20, 2023, 12:55:19 am
Looks like my reply got truncated.

The five Key, Value pairs are:
Name    Value = the name of the message/signal
Type      Value = "Sequence"   (apparently, for both message and signal)
Kind      Value =  <blank> for Message, "Signal" for signals
IsReturn Value = boolean
IsAsync  Value = boolean (true for signals)

Appreciate your help.