Book a Demo

Author Topic: Language for Code Generation  (Read 6106 times)

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Language for Code Generation
« 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?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Language for Code Generation
« Reply #1 on: November 26, 2013, 09:02:22 pm »
A package has a corresponding element. Try changing it there.

q.

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Language for Code Generation
« Reply #2 on: November 26, 2013, 09:53:18 pm »
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  :-[

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Language for Code Generation
« Reply #3 on: November 26, 2013, 11:12:12 pm »
Have you called Update for the changed object? Maybe you post a code snippet.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Language for Code Generation
« Reply #4 on: November 27, 2013, 09:00:07 am »
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.)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Language for Code Generation
« Reply #5 on: November 27, 2013, 11:09:25 am »
Maybe you could use "English" as language for an Actor  ;D

q.

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Language for Code Generation
« Reply #6 on: December 08, 2013, 09:13:06 pm »
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.  :(

Code: [Select]
XmlDocument result = new XmlDocument();
string sqlQuery = @"UPDATE t_object SET GenType='C#' WHERE GenType='Java'";
result = connectToDB.SelectStatement(sqlQuery);

Thank you!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Language for Code Generation
« Reply #7 on: December 09, 2013, 07:26:26 am »
I had no problem changing it with the following Perl code snippet:
Code: [Select]
$pk->Element->{GenType} = "Java";
$pk->Element->Update();
q.

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Language for Code Generation
« Reply #8 on: December 09, 2013, 07:07:48 pm »
It solved my problem completely!
Thank you q!