Book a Demo

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

pirate_code

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • Bunny bunny
    • View Profile
Setting element as Composite Element/NType=8
« on: August 06, 2008, 10:27:09 am »
Hey gang,

I am having some issues with creating an element that is a Composite Element (e.g. right click -> Advanced... -> Make Composite).  We are doing this on t_object/Object_Type='Component' and t_diagram/Diagram_type='CompositeStructure'

As far as I can tell, the only difference between elements (Components) that are composite or not is the field Ntype:
t_object/NType=0 --> Not Composite
t_object/NType=8 --> Composite

The child CompositeStructure diagram does exist with the Component's Object_ID set as the parent.  So this "should" work!

However, every now and then the interface forgets that an element is a composite, and we have to right click -> Advanced -> set to not composite; then re-set as composite and it works fine.  The same behavior exists when doing direct DB creation of these elements.

Any ideas?  Is there anything else in the DB or interface that specifies an element as a Composite element?

Thanks!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #1 on: August 06, 2008, 10:42:06 am »
Perhaps you need to reload a diagram, package or project. There are various methods to do so.
No, you can't have it!

pirate_code

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • Bunny bunny
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #2 on: August 06, 2008, 11:39:08 am »
Quote
Perhaps you need to reload a diagram, package or project. There are various methods to do so.

Sadly, reloading the package/diagram/etc. does not fix the behavior.

If you right click -> Advanced -> the "Composite" check mark is selected!  However, the component does not display the infinity symbol in the lower right corner, nor can you double-click on the component to drill down to its CompositeStructure diagram.

I have created two components on the same diagram using SQL inserts into the t_object, t_diagrams and t_diagramobjects tables.  I have "unset" and "reset" the composite element attribute using EA on 1540 and the infinity shows up properly.  However, on object_id = 1541, I have not.  It shows up as composite under Advanced... but not in the actual diagram.

t_object for 1540 & 1541:
1540      Component      0      1.2.1.2 Test Fn      NULL      NULL      1.0      NULL      73      NULL      8      1      0      NULL      -1      0      -1      0      -1      2008-08-05 18:28:26.093      2008-08-05 18:29:21.000      Proposed      0      0      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL      <none>      NULL      NULL      NULL      1.0      Public      NULL      NULL      0      {0B4F0E91-982A-457D-8E29-CD12C713C622}      565      NULL      NULL      0      0      0      0      0      NULL      NULL      NULL      NULL      NULL      NULL
1541      Component      0      1.2.1.3 Test Fn 2      NULL      NULL      1.0      NULL      73      NULL      8      1      0      NULL      -1      0      -1      0      -1      2008-08-05 18:30:07.217      2008-08-05 18:30:07.217      Proposed      0      0      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL      <none>      NULL      NULL      NULL      1.0      Public      NULL      NULL      0      {DC10FEF9-38F9-4778-ADA8-AE02F12E33B7}      565      NULL      NULL      0      0      0      0      0      NULL      NULL      NULL      NULL      NULL      NULL

t_diagramobjects for 1540 & 1541:
54      1540      -170      280      400      -240      2      DUID=3FEEAB74;      6448
54      1541      -170      60      180      -240      1      DUID=47AB4AFE;      6449

t_diagram:
54      73      565      CompositeStructure      1.2.1 FnParent      1.0      user      0      NULL      NULL      1      1      1      P      2500      2500      100      2007-01-18 20:51:10.000      2008-08-05 18:30:31.000      NULL      1      1      1      HideRel=0;ShowTags=0;ShowReqs=0;ShowCons=0;OpParams=1;ShowSN=0;ScalePI=0;PPgs.cx=1;PPgs.cy=1;PSize=161;ShowIcons=1;SuppCN=0;HideProps=0;HideParents=0;UseAlias=0;HideAtts=0;HideOps=0;HideStereo=0;HideEStereo=0;FormName=;      0      {29032DA5-12CE-4025-9955-19FEFC2C348E}      NULL      locked=false;orientation=0;width=0;inbar=false;names=false;color=0;bold=false;fcol=0;;cls=0;      ExcludeRTF=0;DocAll=0;HideQuals=0;AttPkg=1;ShowTests=0;ShowMaint=0;SuppressFOC=1;MatrixActive=0;SwimlanesActive=1;MatrixLineWidth=1;MatrixLocked=0;TConnectorNotation=UML 2.1;TExplicitNavigability=0;AdvancedElementProps=1;AdvancedFeatureProps=1;AdvancedConnectorProps=1;ProfileData=;MDGDgm=;STBLDgm=;ShowNotes=0;VisibleAttributeDetail=0;ShowOpRetType=1;SuppressBrackets=0;SuppConnectorLabels=0;PrintPageHeadFoot=0;ShowAsList=0;

Thanks for any assistance :-)

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #3 on: August 06, 2008, 12:33:57 pm »
Quote
As far as I can tell, the only difference between elements (Components) that are composite or not is the field Ntype:
t_object/NType=0 --> Not Composite
t_object/NType=8 --> Composite
There will also be a new record in the t_xref table (t_xref.Name='DefaultDiagram') which has the component's GUID in the t_xref.Client field and the diagram's GUID in the t_xref.Supplier field.
The Sparx Team
[email protected]

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #4 on: August 06, 2008, 09:50:10 pm »
So it seems like EA sees the indicator and starts the rendition process. If there is no 'inner' diagram to construct then EA stops the process and does not consider, or at least does not create a visual indication, that the element is 'really' composite.

Nothing unexpected here. I was going to ask whether you'd actually created the appropriate 'child' diagram and linked it up - from the child side. The cross reference is actually the key - though I'd forgotten, so would not have given you the best hint - to getting the whole thing working.

David
No, you can't have it!

pirate_code

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • Bunny bunny
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #5 on: August 07, 2008, 08:31:16 am »
Quote
So it seems like EA sees the indicator and starts the rendition process. If there is no 'inner' diagram to construct then EA stops the process and does not consider, or at least does not create a visual indication, that the element is 'really' composite.
Yes, the child diagram (CompositeStructure) is created and has its parent set to the newly created component.

KP was correct, the entry in the t_xref table did the trick.  So, in sum:

-> t_object/component
-> t_diagram/CompositeStructure diagram with ParentID set as @@Identity of the new component
-> t_diagramobjects/ParentDiagramID and ObjectID
-> t_xref/ComponentGUID and DiagramGUID

Bingo!  Works like a champ.  Thanks all.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #6 on: August 07, 2008, 09:11:23 am »
For the record, can I just add a warning: the above applies to Components. Other object types do different things (e.g. Activities set t_object.PDATA1 to the DiagramID of the linked diagram) and I suspect this will remain undocumented and we reserve the right to change the representation, etc etc...

:)
The Sparx Team
[email protected]

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #7 on: August 07, 2008, 09:52:23 am »
Ouch.

Sorry, please allow me to rephrase that.

OUCH!
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #8 on: August 07, 2008, 10:06:46 am »
Quote
OUCH!
Agreed, but it's the price we pay for not wanting to change the schema. I think the solution here is to provide an Element.MakeComposite() method in automation, then these particular innards would be hidden. I have no idea if/when this might happen.see below
« Last Edit: August 08, 2008, 09:03:10 am by KP »
The Sparx Team
[email protected]

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #9 on: August 07, 2008, 08:00:27 pm »
Well, I'm on record - enough that it's a broken record by this time - regarding the need to update the schema.

I'm also on record that the pain involved grows the longer we wait. We might soon - perhaps already - be beyond the point where a change is tenable. Talk about being in a vice...
No, you can't have it!

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #10 on: August 08, 2008, 08:57:34 am »
I am currently working on adding a read/write IsComposite property for the Element interface. No confirmation yet as to when it will appear in EA as it has to go through the usual review and testing process. It will however abstract all the steps highlighted in this post into one variable assignment.
Best Regards,

Michael

[email protected]
"It is more complicated than you think." - RFC 1925, Section 2.8

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #11 on: August 08, 2008, 09:18:23 pm »
Thank you Michael!

I will of course be appropriately overjoyed when this arrives. Just try to get it done before the year end. Here in the Frozen North it is a but cold to dance naked in the streets in mid-Winter.

David
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Happy Birthday... IsComposite
« Reply #12 on: August 05, 2009, 02:17:31 pm »
Quote
I am currently working on adding a read/write IsComposite property for the Element interface. No confirmation yet as to when it will appear in EA as it has to go through the usual review and testing process. It will however abstract all the steps highlighted in this post into one variable assignment.
Hi Michael,

I just thought I'd wish your effort a happy birthday... (since the functionality isn't there as of interop.ea.dll 2.10.238.1) and the 8th Aug 2009 is a Saturday!  :o

No offense meant - since I'm SURE you aren't the reason the functionality hasn't surfaced yet...

It's just we've been needing this for YEARS...  :'(

Not holding breath,
Paolo
« Last Edit: August 05, 2009, 02:18:29 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Gabriella

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Setting element as Composite Element/NType=8
« Reply #13 on: September 01, 2009, 07:16:45 pm »
Hello.

Sorry, my English isn't perfect yet.  :)

I create an Activity diagram with the Java API. It contain an Activity element, which is Composite (NType=8), and I want to set him a child diagram.
I think, I must setting the t_object.PDATA1 field with the child diagram's DiagramID.
My question is, how can I setting this with the Java API?

Thank you, Gabriella.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller