Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Alexander.Golyshkin

Pages: [1] 2
1
General Board / Re: SQL object update
« on: April 08, 2025, 12:57:17 am »
Thnx. I did exactly as you wishes...

Could you also check this question? https://sparxsystems.com/forums/smf/index.php/topic,48954.msg283260.html#msg283260

2
General Board / SQL object update
« on: April 04, 2025, 03:49:18 am »
How is possible update a note value or other EA object using SQL query. I have tried below query, but looks like it makes  nothing

Code: [Select]
UPDATE t_object SET t_object.Note = 'TEST_NEW' WHERE t_object.Object_ID = 17574

3
General Board / Copy/Past a sequence call
« on: March 21, 2025, 01:28:37 am »
How is possible to copy a selected sequence call with all properties (Message, arguments, etc) and past to other sequence lifeline? It's very useful functionality for typical calls inside one diagram!

4
Hello Alexander

The behaviour about showing Notes is NOT a bug.
To show the Notes, press the second button from right in the toolbar to open the menu, then select View Notes > Notes Preview or Full Notes.

Another workaround, using 'AS' like 'SELECT Note AS NT FROM t_object' shows the Notes as the same manner as other properties.

HTH,

Thnx, this approach from Sparx Architect team is not obviously for user experience...

5
About the query, the description of a component (or any other element) is stored in t_object.Note

I have tried to execute following SQL query under Sparx Architect v15.2
Code: [Select]
select Object_ID, Note from t_object where t_object.Object_ID=834
and it's displayed just one object_id field

Code: [Select]
SELECT * from t_object
also don't show any Note field in output result... Is it a bug of Sparx Architect, what do you think?

Also in additional, do you know the table & field name which contains FQName value for components?

6
Hi Support team,

Could say how can I get a component description (Properties->General the field below component name) using SQL query?




7
General Board / Export diagram to Plant UML format
« on: May 07, 2024, 01:35:17 am »
Is there possible to save EA created diagrams to plant UML format *.puml?

8
General Board / Re: DELETE an elemenent using script API
« on: March 26, 2024, 08:24:53 pm »
two remarks:

This code won't work if your element doesn't have an element as owner, but a package, so you'll have to check parentID first, and package second.
If you are using a non-strong types language, you can use the same code for both package or parentElement as they both have the same Elements collection.

also, parentElem.Update() is not needed at all, so you can delete the whole isFound logic.

Geert

Yes, thnx, I have fixed comment above about EA exception with following

Code: [Select]
   def _deleteElement( self, aElement: CDispatch ):
      try:
         parentElem = self._engine.getRepo().GetElementByID( aElement.ParentID )
      except Exception as e:
         LOGGER.error( e )
         parentElem = self._engine.getRepo().getPackageByID( aElement.packageID )

      for index, element in enumerate( parentElem.Elements ):
         if aElement.ElementID == element.ElementID:
            LOGGER.info( f"Removed Unused EA Element {element.ElementGUID}." )
            parentElem.Elements.Delete( index )
            break

9
General Board / Re: DELETE an elemenent using script API
« on: March 26, 2024, 08:05:21 pm »
Yes, thnx for suggestion above, the following code also is workable, but nay cause EA internal App Error due missing parentID for some DELETING elements...

Code: [Select]
   def _deleteElement( self, aElement: CDispatch ):
      parentElem = self._engine.getRepo().GetElementByID( aElement.ParentID )
      isFound: bool = False

      for index, element in enumerate( parentElem.Elements ):
         if aElement.ElementID == element.ElementID:
            LOGGER.info( f"Removed Unused EA Element {element.ElementGUID}." )
            parentElem.Elements.Delete( index )
            isFound = True
            break

      if isFound:
         parentElem.Update()

10
General Board / Re: DELETE an elemenent using script API
« on: March 26, 2024, 02:36:04 am »
Workable Py code below

Code: [Select]
   def _deleteElement( self, aElement: CDispatch ):
      pkg = self._engine.getRepo().getPackageByID( aElement.packageID )

      for index, element in enumerate( pkg.Elements ):
         if aElement.ElementGUID == element.ElementGUID:
            pkg.Elements.Delete( index )
            LOGGER.info( f"Removed Unused EA Element {element.ElementGUID}." )
            break

      pkg.Update()

11
General Board / DELETE an elemenent using script API
« on: March 25, 2024, 10:29:21 pm »
Is there possible to DELETE an element from REPO having an Id or GUID? I didn't find any API related to it, could you help?

Also I just tried to use SQL query like below

Code: [Select]
DELETE from t_object WHERE ea_guid='{3D986D35-80C0-4ebb-91A9-43A728357B38}' OR object_id=12138
but looks like it doesn't work at all. The expected result is deleted element by pressing Ctrl+DEL.

12
General Board / Re: Sparx scripting API Diagram Notes & Notes text
« on: March 25, 2024, 06:23:14 pm »
Since, there were no help from Sparx team, I have found the solution for adding diagram info note & diagram not with GUID and paperclip style to the diagram canvas:

Code: [Select]
def _addDiagramNotes( self, aDiagramNode: CDispatch ):
      pck = self._engine.getRepo().getPackageByID( aDiagramNode.packageID )
      text = pck.elements.addNew( "", "Text" )
      text.Subtype = 18
      text.Update()
      # coord. on diagram
      obj = aDiagramNode.diagramObjects.addNew( "l=10;r=110;t=-20;b=-80", "" )
      obj.elementID = text.elementId
      obj.Update()
      self._engine.getRepo().reloadDiagram( aDiagramNode.diagramID )
      LOGGER.info( "Added TextInfo to Diagram" )

   def _addDiagramGUIDNote( self, aDiagramNode: CDispatch ):
      pck = self._engine.getRepo().getPackageByID( aDiagramNode.packageID )
      note = pck.elements.addNew( "", "Note" )
      note.Notes = aDiagramNode.DiagramGUID
      note.StyleEx = "NS=5"
      note.Update()
      # coord. on diagram
      obj = aDiagramNode.diagramObjects.addNew( "l=10;r=250;t=-100;b=-155;DUID=A15050D3", "" )
      obj.elementID = note.elementId
      obj.Update()
      self._engine.getRepo().reloadDiagram( aDiagramNode.diagramID )
      LOGGER.info( "Added Notes GUID to Diagram" )

13
General Board / Sparx scripting API Diagram Notes & Notes text
« on: March 23, 2024, 12:33:17 am »
Hi,

1. How possible to add a diagram notes to diagram using an scripting API having an extracted pointer to Diagram Class?
2. How possible to change a text in Note element in existed Note using scripting API having an extracted pointer to diagram element by
Code: [Select]
getRepo().GetElementByID( diagramObject.ElementID )

14
General Board / Re: EA Object API for "find in all diagrams" by GUID
« on: December 26, 2023, 08:12:37 pm »
I just did a couple experiments and found that EA supports a nested SQL queries, so

Code: [Select]
// Getting count usages in diagrams for object_guid = {453E455C-AD5D-49a4-8EF5-851ADA1BAD37}
SELECT COUNT(*) from t_diagramobjects where object_id= (SELECT object_id from t_object WHERE ea_guid='{453E455C-AD5D-49a4-8EF5-851ADA1BAD37}')

15
General Board / Re: EA Object API for "find in all diagrams" by GUID
« on: December 26, 2023, 06:25:59 pm »
OK, I understood that there is no specific object API for that. So, could you help me to make a SQL query which will find any diagrams GUIDs in model where contain a specific GUID element?

Pages: [1] 2