![]() |
Telelogic System Architect (steve huntington) | ![]() |
Topic Title: Linking child diagram to a symbol Topic Summary: Yay for flaky methods. Created On: 19-Sep-2006 04:36 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Okay. I'm creating a diagram, putting a symbol on it and then using a VBA method to attach a diagram as a child to the symbol. First the obvious:
- No documentation on how to do this or use the method. - No examples on how the method is to be used. - Method doesn't work as expected. What happens is it creates a link but the Child Diagram isn't linked. Code attached... >:-/ |
|
![]() |
|
![]() |
|
Don't worry, I did it via SQL INSERT commands.
![]() Haven't got time to muck around with the object model's problems. |
|
![]() |
|
![]() |
|
How did you do that via SQL Duane? We are having a similar issue in another thread trying to duplicate a diagram. We have three options to duplicate diagram: XML, SQL, Programmatically. Each of the three has a problem.
XML requires a bunch of parsing and replacement to make sure all the unique fields are replaced with valid new information, etc. This the only method I have yet to try for this problem and I will be trying it next. SQL doesn't update the DGX file properly. I inserted the entries for the diagrams and the symbols in the Entity table and then I inserted the necessary relationships in the Relationship table but the darn DGX file won't display the symbols. If I create the diagram via SQL, it doesn't have a valid DGX so the only way I know to create the diagram is programmatically or via XML. Even if the symbols and the diagrams are created via the application or programmatically, when I make the changes in the Relationship table via SQL, it doesn't seem to actually do anything. The only two tables in the DB that I could find that have anything to do with model information are the Relationship and the Entity table and I have duplicated another diagram's and it's symbols entries in both tables verbatim (save for their IDs) and no dice. When I try and do this programmatically, a) I'm not 100% sure what methods have to be used (for things like hierarchical arrangement such as on the OV-5 NT) b) even though I think I have the right methods I'm not sure about their order c) even when I think I get something that is the right order, the calls to create some of the relationships fail and I'm not sure why. I'm going to try doing it via XML now, but the first two methods have been a bust. Programmatic seems to work fine for anything except doing hierarchies and SQL seems to leave me short a proper DGX. If you have any insight into doing it via pure SQL, I would love to hear it. Thanks! |
|
![]() |
|
![]() |
|
I think Duane writes his email with SQL ;-) ------------------------- Thanks, MattS |
|
![]() |
|
![]() |
|
The DGX is definitely the key for the hierarchical node diagrams like the OV-05 Node Tree. The DB keeps track of the relationships but as you said, the lines are only created in the DGX. I tried killing the DGX and if I do that when I try and open the diagram, SA complains that the file is missing. If I try and create everything via SQL and define the DGX file, it says it's an invalid file and ignores it. If I copy a valid DGX and duplicate it to create a new DGX for the diagram I want to create it works, but it ends up blank. It doesn't "build" itself from the DB. I've been told that when you do Verify or Verify & Repair Encyclopedia, that when there is an inconsistency, the DGX is taken as the proper on. This would tell me that you can't just create the objects and relationships in the DB and expect the DGX to be created. This is why I don't see how to do this entirely through SQL.
|
|
![]() |
|
![]() |
|
Bascially it is this:
You get the entity.id number for the symbol and the diagram. So: select id from entity where name = 'symbol name' and type = 999 --whatever the symbol type is. I actually have the symbol object in code so I get the .ddid from that after saving the symbol and diagram, which creates the record to get the ID from. :-) Then set the diagram id: select id from entity where name = 'diagram name' and type = 147 -- or the diagram type, or use class = 1 etc. To create the connection you do the following: insert into relationship (id1, id2,relation) values(child_diagram_id, symbol_id, 5) Then the other side of the coin must be inserted: insert into relationship (id1, id2,relation) values(symbol_id, child_diagram_id, 4) And that's it. Of course, if you already have the diagram open, you have to open the diagram again to see the results. I created a symbol class to build the relations etc I've included the code for the symbol class in this mail. |
|
![]() |
|
![]() |
|
Thanks Duane!
The key to your answer was that you are creating the symbols and diagrams programmatically first so internally the SA application is handling the creation of the DGX files. |
|
![]() |
|
![]() |
|
Si, por supuesto mi amigo.
![]() Creating the diagrams on the fly is fun, I just reduced 6 months hard labour to two days of script creation and 45 minutes of diagram creation. Pity it isn't all more Java based or something more consonant with graphics creation. |
|
![]() |
|
![]() |
|
I wasn't belittling your work :-) I was just saying that it also supports my asseration that the DGX files must be created programmatically (whether it be via the GUI, the COM/VBA interface, or through importing XML which makes the necessary API calls). It's a shame it isn't truly database driven.
On another note, scripting for SA is definitely >>>>>>> than doing it manually via the (sometimes crashing, always cumbersome) GUI. |
|
![]() |
|
![]() |
|
I didn't think you were belittling my work
![]() ![]() You find the GUI crashes all the time and is cumbersome too. The users I support get totally p****d off with it. They lose untold amounts of work when things go wrong. Did I ever tell you that on some occasions upon opening SA I got a MsgBox with the error "Array Index out of bounds". What the hell is that doing there? Never in my life has an application mentioned an array issue. Wonder what sort of testing, or lack thereof, went on behind the scenes. |
|
![]() |
|
![]() |
|
It certainly could use a ground-up rebuild using sound and modern software engineering practices. I can kinda understand how it happened since it was built by a small company that grew over time with the application and features and such were just added on as driven by customer demand (and $$$). It's hard to maintain a clean design and implementation when you are working under those conditions. However, given the many blemishes that the application has in terms of performance and stability and such, it's hard to push the application to be used in large scale projects. Hopefully Telelogic will address some of these issues in a major revision in the future.
|
|
![]() |
|
![]() |
|
Johathan, 1) Better documentation that is publicly available. Sure they will expose all the warts, but at least we will be able to work around them. Lets have a public bug list. 5) Build our own app from Visio, Access/SQL server, Word, Excel, XML etc. ;-) After working with SA at such a detailed level, this would not be so much of a challenge for a single user. ffice:smarttags" />
------------------------- Thanks, MattS |
|
![]() |
|
![]() |
|
Plus: Command line access to run Web Publishes and updates without the need for GUI interaction. Edited: 25-Sep-2006 at 00:52 by Duane Hennessy |
|
![]() |
|
![]() |
|
When you create a child diagram in the SA client, you are prompted to save the parent diagram.
Maybe your original vba code has omitted this step...
IMHO, the SA Object Model and the ISAImf library is designed to immitate the user interaction with the SA client.
|
|
![]() |
|
![]() |
|
Matt
Having just rediscovered this forum ![]() Good to see everyone is helping each other, I hope my assistance will be beneficial to you all. Thanks Ian ------------------------- Senior Software Developer Telelogic UK Ltd. Edited: 5-Oct-2006 at 17:13 by SA Team |
|
![]() |
|
![]() |
|
Changed my ID to be SA Development - makes it look a bit more obvious!
------------------------- Senior Software Developer Telelogic UK Ltd. |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.