Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: asseco on July 29, 2011, 10:01:47 pm

Title: EA Scripting problem with auto name counter.
Post by: asseco on July 29, 2011, 10:01:47 pm
Hi.
I tried to update auto name counter for diagram from within JScript script. I have configured EA > Settings > Auto name counter .. > Type: Dgm-Logical. It store data inside t_trxtypes table;  

I get counter data ( number ) from this xml variable:

xml = Repository.SQLQuery('select notes from t_trxtypes where description = \'Autocount\' and trx = \'Dgm-Logical\';');      


Repository.SQLQuery method can only select data. I tried update data like below but it not work.

counter = Repository.SQLQuery('update t_trxtypes set notes =\''+data+'\' where description = \'Autocount\' and trx = \'Dgm-Logical\'; commit;');

Is any other way to get/change or update actual counter value within JScript?
Title: Re: EA Scripting problem with auto name counter.
Post by: Geert Bellekens on July 29, 2011, 10:57:05 pm
Use Repository.Execute(SQLUpdateString)

Geert
Title: Re: EA Scripting problem with auto name counter.
Post by: asseco on July 30, 2011, 12:15:03 am
Thx. Its working.