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 - JiangangWang

Pages: [1]
1
General Board / Re: connectors stored in t_diagramlinks
« on: February 17, 2024, 02:38:08 pm »
Hello Mr. Geert,
I asked EA support, and they told me that the connector can only be shown in t_diagramlink when the diagram is modified and saved (for the case the connector is created in another diagram between two elements firstly). The original answer is as following "For example, if you have diagrams X, Y and Elements A and B are on both of those diagrams. On Diagram X you add a connector between A and B. You then open diagram Y and the connector will be displayed on the diagram but the t_diagramlink entry will not be added unless you modify the diagram and save".

So I made a script to add an extra unique-named element on the browser firstly, and then add element onto each diagram, and then delete the element from diagram, delete the element from browser, and saved the diagram, but it doesn't make the t_diagramlink fresh.
However it works with the manual operation following the exactly same steps as the scripts.

Do you know if diagram.update() function save the diagram or not?

Thanks a lot.

2
General Board / Re: connectors stored in t_diagramlinks
« on: January 11, 2024, 09:58:35 pm »
so do you know what might be the issue that the inconsistency occurs between diagram links and record in t_diagramlink?

3
General Board / Re: connectors stored in t_diagramlinks
« on: January 11, 2024, 07:42:27 pm »
Thanks Geert.
When you say saving the diagram, do you mean manually save command from EA?
But if there is any change on the diagram (i.e. adding a new connector), it has to be saved by people manually or from the reminder of EA when you close the diagram.
So in this case, it should be always consistent between a diagram and t_diagramlinks.

Isn't it?

4
General Board / connectors stored in t_diagramlinks
« on: January 11, 2024, 11:39:12 am »
Dears,
Does anyone meet the issue that not all the connectors on a diagram are stored in t_diagramlink table?

I have met an issue that on a UseCase diagram, there are 5 self-defined connectors (based on association) between actor and usecases, 5 "include" connectors between usecases, but only 5 "include" connectors can be found in t_diagramlink table, another 5 self-defined connectors are all lost.
But with the same Actor and Usecases elements on another use case diagram, all self-defined connectors and "include" connectors are all found in t_diagramlink table.

Does anyone know the rule to decide under which condition the connectors are stored or not in t_diagramlink table?

Thank you

Wang

5
General Board / Re: question of embedded elements information on diagram
« on: September 12, 2023, 10:19:01 am »
Thanks for the information.

Do you mean if the position (top, bottom, right, left) of one element is inside the position of another one, then EA recognizes they are bundled?

But the experience I have is that only when a dash-dot-matrix inside the outer element appears when I drop one element onto another, then they are bundled.
If only position is inside, but no such dash-dot-matrix appears, they should not be bundled?

Thanks.
Wang

6
General Board / question of embedded elements information on diagram
« on: September 11, 2023, 10:54:41 pm »
Dear Master,

I have two elements which are separated in project browser, under different packages. But on a diagram, I drag and drop them together, meaning they are bundled.
When I move the outer element, both are moved.

does anyone know how this bundle information store in database? since there is no parent/child relationship in browser, which field of which table store such information?

Thanks a lot
Wang

7
Thanks Geert.

It seems sequence/message is not stored in t_diagramlinks table, but t_connector.
so I have to use Repository.GetConnectorByID or Repository.GetConnectorByGuid with SQL search shown as below.
dim messageConnector as EA.Connector
set messageConnector = Repository.GetConnectorByGuid("select o.ea_guid from t_connector o where o.Start_Object_ID = " & currentdiagramObject.ElementID)

but when I tried to session.output to see the result, it reports the error "lack of object 'messageConnector' ".
Do you know if something wrong here?

Thanks
Wang

8
Thanks a lot, Geert, it works well.

Actually I am writing the script to change the element used in sequence diagram, the reason is that SE currently uses Property defined in Architecture element directly in sequence diagram, not lifeline/sequence element.

The current script just changes the property element to the sequence element with the same classifier, but when I run it, I found the elements are changed but all the messages in between is lost.
It seems it doesn't work by purely changing the element type on the diagram.

Do you know how to get the message remained when changing element type?
Thanks

9
I am writing the script which needs to get all the instance elements of a classifier element, but it seems there is no such attribute of an element class in the object model.
i.e. this is the script to get the classifier element ( currentElement is the Property element which is typed by classifierObject)
dim classifierObject as EA.Element
set classifierObject = Repository.GetElementByID(currentElement.PropertyType)

then this one is trying to find the instance element (i.e. a sequence element with classifierObject as its classifier)
dim sequenceObject as EA.Element
set sequenceObject = XXX

does anyone know how to achieve it?
Thanks.

10
General Board / t_xref
« on: August 21, 2023, 10:13:42 pm »
Does anyone know what t_xref table is used for?
I searched on EA website, but no useful information found. It is very strange that as the table includes name such as Stereotypes, CustomProperties, MOFProps, and type such as element property, diagram properties, user setting.

It seems it is something about the cross reference of elemement in diffrent diagrams?

11
I have to define a customized diagram, to extend from UML Sequence diagram.
Through Diagram Profile, I defined the customized diagram stereotype, and extended a metaclass named "Diagram_Sequence".

However since it is extended from a UML diagram, and by default there is no Diagram Frame defined.
Does anyone know how to set the disgram stereotype, in order to define the Diagram Frame?
Thanks.

12
Automation Interface, Add-Ins and Tools / Change diagram MDGTechnology
« on: September 06, 2022, 10:36:50 am »
I have to change the SysML diagram (mainly sequence and bdd diagram) to UML diagram due to some issues, and it can be done through UI from menu change type by deleting the MDGTechnology tag value.

However there are lots of diagrams which need to be changed, so I turned into scripts to change it.
here is the core part of VB script, but when I run it, it doesn't take affect.

dim j
dim diagrams as EA.Collection
set diagrams = currentElement.Diagrams
               
for j = 0 to diagrams.Count - 1
   dim currentDiagram as EA.Diagram
   set currentDiagram = diagrams.GetAt ( j )
                  
   if currentDiagram.MetaType = "SysML1.4::Sequence" then
   Session.Output( "Diagram: " & currentDiagram.Name & " - Type: " & currentDiagram.Type & " - SysML Type: " & currentDiagram.MetaType)
            
   currentDiagram.MetaType = " "
        currentDiagram.StyleEx = replace(currentDiagram.StyleEx, "MDGDgm=SysML1.4::Sequence;", " ")
        currentDiagram.Update()
   diagrams.Refresh()
       end if
next

Could any master take a look at it?
Thx.            

Pages: [1]