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

Pages: 1 [2] 3 4 5
16
Bugs and Issues / Re: EA stability
« on: July 11, 2024, 05:00:15 pm »
Sorry if this is a silly question, but... how do you get that error log?
Need to define some settings? Available in a specific log file somewhere on disk?

17
Sorry Geert to have misinterpreted your code.
The hint I got from it turns out to work now.
I dreate a new worksheet (using .Add), Save it using the default filename and path and use the file system to move it to the filename desired.

Summary of the code:

Code: [Select]
objExcelWorkBook = objExcelApplication.Workbooks.Add();
objExcelWorkBook.Save( true );
strExcelWorkBookFullName = objExcelWorkBook.FullName;
objExcelWorkBook.Close();
objExcelFile = fileSystemObject.GetFile( strExcelWorkBookFullName );
objExcelFile.Move( strExcelFileName );

Please beware of the order of the statements.
And I use Save(true) to prevent the system to ask for confirmation to save.

18
General Board / Re: Deleting a package
« on: June 21, 2024, 03:31:09 pm »
It looks like this may be too late or might not be appropriate at all, yet I would like to make the remark. Sorry for that.

In situations like this, I try to add these kind of large chunks to a copy of the repository to do some testing first.
It is especially easy when working with file based repositories.
That way the original file is still available for normal operations.

19
Hai Geert,
Thanks for looking and sharing your code.
It may not be directly translatable but it did give me a hint to a workaround.
As I see, when the excel file does not exist, you are using the filesystem object to create a new file and open that as excel file.
Think this might be worth trying.

20
For a project, I'm trying to export some information to an Excel file using a JavaScript.
Most of the code now seems to work.
Except for creating a new Excel file on the location I want it.
Export works fine when I open an existing file.
Saving a newly created Excel file also works, it only refuses to write it to the strExcelFileName I specified using GetFileNameDialog().
When I close the newly generated Excel workbook, it saves it as "Map1.xlsx" in the default folder used by the Excel application.

The code below shows what I have used for testing (after cleaning up a bit).
Hope to get some pointers on how to fix this.
Thanks!

Code: [Select]
let objExcelWorkBook = null;
let objExcelApplication = null;

// Start the Excel Application as COMObject
objExcelApplication = new COMObject( "Excel.Application", true );

// Get the strExcelFileName to get the information from
projectInterface = Repository.GetProjectInterface();
strExcelFileName = projectInterface.GetFileNameDialog( strExcelFileName, FilterString, Filterindex, Flags, InitialDirectory, OpenorSave );

// Get objExcelWorkBook from the strExcelFileName provided
objExcelWorkBook = objExcelApplication.Workbooks.Open( strExcelFileName );
if ( objExcelWorkBook != null ) {
// objExcelWorkBook FOUND
Session.Output("EXCELWOpenWorkbook found Workbook with strExcelFileName = " + strExcelFileName + " !" );
} else {

// If the objExcelWorkBook file does not exist, then create one
objExcelWorkBook = objExcelApplication.Workbooks.Add();
if ( objExcelWorkBook != null ) {
// If the file added ok, then save it with new name
objExcelWorkBook.SaveAs( strExcelFileName );
} else {
LOGError( "EXCELWOpenWorkbook could NOT open nor add strExcelFileName " + strExcelFileName + "!" );
}
}

// Close and save the previously opened or created objExcelWorkBook
objExcelApplication.Workbooks.Close();

21
+1

22
General Board / Re: Can you export relationships in CSV?
« on: April 04, 2024, 06:49:13 am »
It might be true that CSV is only for first time use.
The EA Excel Im-Exporter from Geert however uses the GUID to identify elements.

23
General Board / Re: Can you export relationships in CSV?
« on: March 29, 2024, 09:19:20 pm »
I've extended the EA Excel Im-Exporter from Geert (https://bellekens.com/ea-excel-import-export/) to handle connectors.
Needs some more testing.
Send me a DM with your email and I'll send it to you.

24
General Board / Re: Searching in EA
« on: January 22, 2024, 06:00:00 pm »
For deduplication, I use the open source IDEA add-on (see https://data-docent.nl/ideaen.aspx).

25
Imported the new version next to the previous one and used the Deduplicator functionality of the IDEA addin.
Had to do it in batches because of the large number of elements in the reference model.
And had to do a manual check for those elements that had their name changed...

26
Might your add-in be relying on other components like Excel?
When I tried to use the Office integration MDG to import a Visio diagram, it says it needs Visio installed.
We are using EA SaaS where the EA client is running on a cloud server connecting to a repository also in the cloud.

27
The process you described was correct and for me a bit cumbersome with lots of relations to create.
So I extended the tool from Geert to be able to import relations as well.
If you are interested, I can mail you my version.
Please note it is not that thoroughly tested as I would like.

28
For instance for showing it on a Confluence page on my Wiki intranet...

29
Thanks Eve,
This solves the issue.

30
In a model I'm working with, there are a large number of TaggedValues. That many (>28K) that they even won't be exported by the Excel tool of Geert Bellekens.
So I was trying to find why there are that many.
Looks like there are a great number of duplicates (>8K), possibly the result of merging different versions of the reference architectures I imported over time.
The deduplication function of the IDEA add-on didn't deduplicate these TaggedValues when removing duplicate elements.
This should be solved in the latest version of IDEA but still, I keep having a lot of duplicate TaggedValues.
So far only an explanation on the situation I'm in.

During the analysis I noticed an issue with the overview of TaggedValue in the Properties window of an element.
It turns out that that window doesn't show duplicate TaggedValues, making it hard to find and delete them.
In this case, a duplicate TaggedValue is defined as duplicate when two Name attributes are the same for the same element. It is not even necessary to have the same Value attribute.
When entering a TaggedValue by hand, the input process just ignores the new value if the Name of the TaggedValue is already present for this element.
Thus not leading to duplicates.
However, when I use the Excel tool, I can rename TaggedValues and thus (unintendedly?) introduce duplicates.
I suppose I could also get this result with scripts or other add-ons changing the value of the Name attribute of a TaggedValue.
I can replicate the issue with the steps outlined below.
I also wrote a script to show all TaggedValues of all elements on the selected diagram (it is a start for a script to remove the duplicates).
But the issue is thus that the duplicate TaggedValues are not shown.
I'm using EA 16.1 build 1626 - 64 bit

Anybody have similar experiences?
Should I enter this as a separate bug?
Or am I doing something wrong?

Steps to replicate the issue:
1. Create a new QEA model
2. Add View (Package Only)
3. Add Diagram (ArchiMate3.1: Application)
4. Add an ApplicationComponent element
5. Add some TaggedValues:
   a. TagValue1   Any Value
   b. TagValue2   Any Value 2
   c. TagValue3   Any Value
   c. TagValue4   Any Value 2
6. Tag overview shows TagValue1, TagValue2, TagValue3 and TagValue4
7. Used Excel importer to rename TagValue3 and TagValue4 to TagValue1
8. Tag overview only shows TagValue1 and TagValue2
9. Script shows:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Selected Diagram(DiagramID: 1) Name= TaggedValues Issue
Selected diagramObjects.Count: 1
...........................................................................................
curElement(ApplicationComponent)(4) found curTaggedValue.Name= TagValue1, Value= Any Value, PropertyGUID= {05B3A5D8-F1C6-44f8-B480-752EBF44947E}!!!
curElement(ApplicationComponent)(4) found curTaggedValue.Name= TagValue1, Value= Any Value, PropertyGUID= {7BEB3CA7-47DA-4d12-B2FE-35810065ECC9}!!!
curElement(ApplicationComponent)(4) found curTaggedValue.Name= TagValue1, Value= Any Value 2, PropertyGUID= {15B2AC35-7676-4434-A041-3D89D3294EE4}!!!
curElement(ApplicationComponent)(4) found curTaggedValue.Name= TagValue2, Value= Any Value 2, PropertyGUID= {8B7D5D85-8B6A-470f-A73F-915D59A12C72}!!!
===========================================================================================


Script to show TaggedValues in Model:

Code: [Select]
!INC Local Scripts.EAConstants-JavaScript

/*
 * This code has been included from the default Diagram Script template.
 *
 * For all LegendElements on the selected diagram:
 *   If TaggedValue filter
 *      Find all TaggedValues for this Value
 *      Update t_xref list of properties for this legend
 *   Refresh Diagram
 *
 *
 * Script Name: CheckTaggedValues
 * Author:      J de Baat
 * Purpose:     Show the TaggedValues of all elements occuring on the selected diagram
 * Date:        10-08-2023
 */


/*
 * Check the TaggedValues of theElement provided as parameter
 */
function CheckTaggedValuesElement( theElement )
{

// Cast theElement to EA.Element so we get intellisense
var curElement as EA.Element;
var curElementTags as EA.Collection;
curElement = theElement;
curElementTags = curElement.TaggedValues;

// List all element tags
for ( var i = 0 ; i < curElementTags.Count ; i++ )
{
var curTaggedValue as EA.TaggedValue;
curTaggedValue = curElementTags.GetAt( i );
Session.Output("curElement(" + curElement.Name + ")(" + curElementTags.Count + ") found curTaggedValue.Name= " + curTaggedValue.Name + ", Value= " + curTaggedValue.Value + ", PropertyGUID= " + curTaggedValue.PropertyGUID + "!!!" );
}

}

/*
 * Diagram Script main function
 */
function CheckTaggedValues()
{
// Get a reference to the current diagram
var currentDiagram as EA.Diagram;
currentDiagram = Repository.GetCurrentDiagram();

Session.Output("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" );

if ( currentDiagram != null )
{
Session.Output("Selected Diagram(DiagramID: " + currentDiagram.DiagramID + ") Name= " + currentDiagram.Name );

// Get a reference to any selected connector/objects
var diagramObjects as EA.Collection;
var currentElement as EA.Element;
diagramObjects = currentDiagram.DiagramObjects;

// Check whether this diagram has any objects in it
if ( diagramObjects.Count > 0 )
{
Session.Output("Selected diagramObjects.Count: " + diagramObjects.Count );
// One or more diagram objects are selected
for ( var i = 0 ; i < diagramObjects.Count ; i++ )
{
Session.Output("..........................................................................................." );

// Process the currentDiagramElement
var currentDiagramElement as EA.Element;
var currentElement as EA.Element;
currentDiagramElement = diagramObjects.GetAt( i );
currentElement = Repository.GetElementByID( currentDiagramElement.ElementID );

// Check the TaggedValues of the currentElement
CheckTaggedValuesElement( currentElement );
}

// Reload diagram when all processing is done
Repository.ReloadDiagram( currentDiagram.DiagramID );
}
else
{
// No objects on this diagram
Session.Output("No objects on this diagram" );
}
}
else
{
Session.Prompt( "This script requires a diagram to be visible.", promptOK)
}

Session.Output("===========================================================================================" );

}

CheckTaggedValues();

Pages: 1 [2] 3 4 5