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

Pages: [1] 2 3 ... 5
1
Thanks Geert and qwerty. 

2
Hi Geert. I ran the scripts with the diagram closed and it makes no difference. When I run the script the 1st time, it finds element A with 2 links.  The links to element A are changed successfully to element A'. Changing the diagram object to use element A' does not appear to work.  When the script is run a second time, it finds element A again but there are no links that need to be updated; changing diagram object to element A' again does not work.

Hi qwerty.  I was trying to avoid removing the old element because of the positional information, associated links, etc.  I was hoping to simply change the element ID such that the original diagram would remain intact with the new element placed where the old one did.

3
Hi Geert.  After the script runs, the old element still exists on the diagram instead of the new one.  Manipulating the diagram links to point to the new element works but changing the diagram element itself to use the new element ID does not result in the new element appearing on the diagram; the old element still exists and I must manually remove the old element and add the new one.  The script is intended to replace all occurrences of element A on diagrams with element A'

4
At the end of the script, I also have logic to update, save and reload the diagram but still the problem exists.
   diagram.Update()
   Repository.SaveDiagram(diagram.DiagramID)
   Repository.ReloadDiagram(diagram.DiagramID)

Prior to running the script, the old element has two diagram links on the diagram.  After execution, the old element has no links but still exists on the diagram.  When I manually add the element to the diagram, it shows up with the two links; these links did not exist prior to execution of the script.

5
I want to replace an element A on an interaction diagram with another element A' via scripting.  I am able to identify element A on the diagram through DiagramObjects. With the identified element A, I have its element ID.  I also have identified element A' and have its element ID.  Through the scripting, I am able to change the diagram links to now connect to element A'. 

If I change the element ID referenced by the diagram object to use the ID for A', the diagram still shows the old element A but the links are removed.  If I drop A' on the diagram, it appears with the links. 
   var diagramObjPtr = diagram.DiagramObjects;
   var diagramObj as EA.DiagramObject
   diagramObj = diagramObjPtr.GetAt(obj_index)
   diagramObj.ElementID = newObj.ElementID
   diagramObj.Update()

I do not want to remove the object and add it; I would like to just change the associated object on the diagram.

Any  idea what I am doing wrong such that the old element is still visible on the diagram and the new element is not.

Thanks

6
Automation Interface, Add-Ins and Tools / Re: Scripting to get all diagrams
« on: December 25, 2017, 08:48:52 am »
Sure.
   var sql = "select * from t_diagram"
   var xml = SQLQuery(sql)

The xml can then be parsed for diagram IDs, names, etc.

7
Automation Interface, Add-Ins and Tools / Re: Scripting to get all diagrams
« on: December 23, 2017, 09:46:57 am »
NvM.  Wouldn't you know it.  Right after I submit the question, I figure out the issue/method.  Sorry.

8
Automation Interface, Add-Ins and Tools / Scripting to get all diagrams
« on: December 23, 2017, 09:28:55 am »
To this point, I have been working on a selected or active diagram.  I would like to find all diagrams within my model and operate on them.  How would I get a collection of all diagrams within the model?

9
Hi Simon,

Tried this path.  Addition of the Documentation exporter information does result in the UUIDs being brought in to EA but the stereotypes and tagged values are not. The Documentation exporter information is not enough; the EA add-ins must also be included within the xmi file.  Currently, I am generating and using XMI 2.1 / UML 2.3 files without EA extensions.  Importing this type of xmi file works with the exception of the UUID is not imported.

It has been indicated by Sparx that the formats in the publish xmi diaglog are not intended for round trip EA to EA and will lose information.  This means that the full xmi 1.1 or xmi 2.1 (with EA extensions) would need to be used.  This is where the problem lies since these are not documented (as far as I know).

Consider the following example xmi 2.1 file. With the Documentation exporter information, the tagged values and stereotypes will not be imported properly.  Without the Documentation exporter information, the UUID will not be imported.

<?xml version="1.0" encoding="windows-1252"?>
<xmi:XMI
  xmlns:uml="http://schema.omg.org/spec/UML/2.3"
  xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
  xmlns:CompView="http://www.sparxsystems.com/profiles/CompView/1.5"
  xmlns:PackageView="http://www.sparxsystems.com/profiles/PackageView/1.1"
  xmlns:BsmdView="http://www.sparxsystems.com/profiles/BsmdView/1.0"
  xmlns:thecustomprofile="http://www.sparxsystems.com/profiles/thecustomprofile/1.0" xmi:version="2.1">
  <xmi:Documentation exporter="Enterprise Architect" exporterVersion="6.5"/>
  <uml:Model xmi:type="uml:Model" name="EA_Model">
    <packagedElement xmi:type="uml:Package" xmi:id="EAPK_98135048_54de_98e3_41e1_66ccb1ecadc2" name="ARRoot">
      <packagedElement xmi:type="uml:Package" xmi:id="EAPK_6c39594c_de42_94ce_5590_ddb1fc9c5cfa" name="ABC">
        <packagedElement xmi:type="uml:Package" xmi:id="EAPK_7f79ac5f_0270_8793_c3a6_87ccac55ace4" name="Modules">
          <packagedElement xmi:type="uml:Package" xmi:id="EAPK_4746d95a_9e91_b0c0_545b_95c024876e9c" name="Example">
            <packagedElement xmi:type="uml:Package" xmi:id="EAPK_5aa610fa_e7e8_9c18_091a_e7a6a01f7036" name="BswModuleEntrys">
              <nestedClassifier xmi:type="uml:Class" xmi:id="EAID_3ff4807c_be4f_9354_3544_d21ef997a6cf" name="Example_MainFunction"/>
            </packagedElement>
          </packagedElement>
        </packagedElement>
        <packagedElement xmi:type="uml:Package" xmi:id="EAPK_d0b31f64_3f9a_8366_277f_08225279a048" name="Interfaces">
          <packagedElement xmi:type="uml:Package" xmi:id="EAPK_c312de93_13af_92c9_27ec_53e2c6548df7" name="Example">
            <packagedElement xmi:type="uml:Interface" xmi:id="EAID_103d96e0_9bff_9e23_1133_b091323bd824" name="DrStatDrv_B_Actl"/></packagedElement>
        </packagedElement>
      </packagedElement>
    </packagedElement>
    <profileApplication xmi:type="uml:ProfileApplication" xmi:id="profileap_E27C4BAF-C">
      <appliedProfile xmi:type="uml:Profile" href="http://www.sparxsystems.com/profiles/PackageView/1.0#E27C4BAF-C"/>
    </profileApplication>
    <profileApplication xmi:type="uml:ProfileApplication" xmi:id="profileap_81D8F36A-0">
      <appliedProfile xmi:type="uml:Profile" href="http://www.sparxsystems.com/profiles/CompView/1.3#81D8F36A-0"/>
    </profileApplication>
   <profileApplication xmi:type="uml:ProfileApplication" xmi:id="profileap_61765CEA-5">
      <appliedProfile xmi:type="uml:Profile" href="http://www.sparxsystems.com/profiles/BsmdView/1.0#61765CEA-5"/>
   </profileApplication>
  </uml:Model>
  <PackageView:arPkg base_Package="EAPK_6c39594c_de42_94ce_5590_ddb1fc9c5cfa"/>
  <PackageView:arPkg base_Package="EAPK_7f79ac5f_0270_8793_c3a6_87ccac55ace4"/>
  <PackageView:arPkg base_Package="EAPK_4746d95a_9e91_b0c0_545b_95c024876e9c"/>
  <PackageView:arPkg base_Package="EAPK_5aa610fa_e7e8_9c18_091a_e7a6a01f7036"/>
  <BsmdView:bswmEntry base_Class="EAID_3ff4807c_be4f_9354_3544_d21ef997a6cf" serviceId="1" isReentrant="false" isSyncronous="false" callType="SCHEDULED" execContext="TASK" swServImplPolicy="STANDARD"/>
  <PackageView:arPkg base_Package="EAPK_d0b31f64_3f9a_8366_277f_08225279a048"/>
  <PackageView:arPkg base_Package="EAPK_c312de93_13af_92c9_27ec_53e2c6548df7"/>
  <CompView:sndrRecIf base_Interface="EAID_103d96e0_9bff_9e23_1133_b091323bd824" isService="false"/>
</xmi:XMI>

Exporting as a full xmi 2.1 file will include an XMI:Extension node which is specific to EA and not documented. 

The creation of an EA compliant XMI file that includes EA extensions would be difficult without documentation.

10
Hi Simon,

The problem is a lack of documentation for the xmi 1.1 used by EA that would allow me to create EA compatible xmi files. Today, the best we could do was to create simple xmi (2.1) files without the EA extensions; xmi 2.1 is easier to work with from a tools side.

Does documentation exist at this time that would allow me to create EA compatible xmi files that support round-trip (can be imported as a baseline and compared)?

11
I am attempting to solve a round-trip problem. Sparx has indicated that the xmi file types under publish option (for export xmi) are not suitable for round-trip.

I am exporting XMI 2.1 (UML 2.3) from EA (with EA extensions turned off).  These files are transformed by an internally developed tool for use by an external  tool; the EA UUIDs are retained in these files.  The external tool may be used to modify, add, remove elements/attributes and save off the new files.

Using the internally developed tool, I can reverse this process and transform the files back into XMI 2.1 (UML 2.3) (without EA extensions). When this file is imported, the UUIDs are ignored and EA generates new ones.  If the UUIDs were stored as tagged values, I could import the xmi file into an empty EA project, run a script to manipulate the UUIDs in the model to match the tagged value.  I could then export the package as XMI 1.1 and compare as a baseline.  Differences could then be identified and merged as needed.

It would be a convoluted process but would work until something better could be developed; this would unfortunately require significant tool development.

12
Does anybody know if the EA UUIDs can be modified via scripting or API? I am aware that the table entries in the database could be manipulated or an XMI file could be exported, modified and re-imported but I would like to work directly on the model.

13
My Bad..

There is an option to control this behavior.

Notes (12.1)
•If the hyperlink appears as a Sub Activity, select the 'Tools | Options | Diagram | Behavior' menu option and deselect the 'Use Automatic SubActivities' checkbox

Notes (13.5)
•If the hyperlink appears as a Sub Activity, select the 'Start > Workspace > Preferences > Diagram > Behavior' option and deselect the 'Use Automatic SubActivities' checkbox

14
Attempting to drop an activity diagram (parent activity) onto an activity diagram to ease navigation between activity diagrams.  The diagram is displayed as an activity and not as a hyperlink which leads to confusion; looks like an out of place activity that should be removed or was not connected.

15
General Board / Re: How to visualize hyperlinks as hyperlinks?
« on: November 02, 2017, 01:30:47 am »
In 12.1, I get the same but if you choose Hyperlink, it is displayed as an activity when placed on an activity diagram.  As such, it appears as an out of place activity that is not connected to anything. 

Pages: [1] 2 3 ... 5