Author Topic: Setting element as Composite Element/NType=8  (Read 11296 times)

Gabriella

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #15 on: September 01, 2009, 07:45:34 pm »
Yes, if the composite element's have a child diagram, MiscData(0) return with the child diagram's ID (PData1 field).
But MiscData is read only. How can I setting PData1 field?

Gabriella.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13325
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Setting element as Composite Element/NType=8
« Reply #16 on: September 01, 2009, 07:56:12 pm »
Oh, I didn't see the "read-only" part.
In that case you can either wait for Sparx to finish their setComposite() operation on Element, or get your hands dirty (really dirty!) and change the field in the database yourself.

Geert

Gabriella

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #17 on: September 01, 2009, 08:22:58 pm »
I haven't time wait for the setComposite() operation, I must make this at the moment.  ;)

Maybe you know that, how can I write the t_xref table with the Java?
Perhaps in this table I can setting a default diagram to the element.

Thank you: Gabriella.  :)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13325
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Setting element as Composite Element/NType=8
« Reply #18 on: September 01, 2009, 08:48:39 pm »
Just connect to the database and launch an update query.
You should find plenty of examples on the internet.

Geert

Gabriella

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #19 on: September 01, 2009, 09:29:20 pm »
Okay, thanks all! :)

Sascha Zinflou

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #20 on: June 22, 2010, 03:47:04 am »
Instead of accessing the database via jdbc and getting hurt asking your db admin, I would suggest to use the Repository.Execute-Method with the desired SQL-Statement.

And, of course, I would apreciate very much if there was an enhancement to the API. As one should not manipulate the database directly, it is not comfortable to be forced to do that.

André Olivera

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #21 on: April 29, 2011, 06:54:00 pm »
Hi!

What did you put in t_xref.XrefID??

How can I generate a new GUID and use it in this field?

Thanks!

André.

[edit] I used the C# function system.guid.NewGuid().ToString() and works.. but it is not dangerous?
Im afraid because the guid always must be unique.
« Last Edit: April 29, 2011, 07:35:55 pm by andrebrujah »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13325
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Setting element as Composite Element/NType=8
« Reply #22 on: April 29, 2011, 07:46:24 pm »
André,

With the function you are using you have about a 1/(3*10^38) chance to have a collision  :D

Geert