Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Tehila1 on November 26, 2013, 08:41:57 pm
-
Hello!
How can I change programmatically language of a package? (and its children)
-I know EA.Element has the GenType property, but what about packages?
-
A package has a corresponding element. Try changing it there.
q.
-
Thank you! It is working- changing the packages language.
Now, How do I save the changes I made? -when I debug everything is correct, but at the end of running- no change of language has occurred :-[
-
Have you called Update for the changed object? Maybe you post a code snippet.
q.
-
What are you expecting to happen when you change the language of a package?
All that's going to happen is that if you look at the properties of the language the language is different. Last I remember EA never uses the language of a package for anything. (Just the same as an Actor has the same property but it isn't used.)
-
Maybe you could use "English" as language for an Actor ;D
q.
-
I'm still stuck with that issue- no change was saved after changing elements language. I attach code: An error occures: problem with SELECT statement. :(
XmlDocument result = new XmlDocument();
string sqlQuery = @"UPDATE t_object SET GenType='C#' WHERE GenType='Java'";
result = connectToDB.SelectStatement(sqlQuery);
Thank you!
-
I had no problem changing it with the following Perl code snippet:
$pk->Element->{GenType} = "Java";
$pk->Element->Update();q.
-
It solved my problem completely!
Thank you q!