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

Pages: [1]
1
Automation Interface, Add-Ins and Tools / Re: Last Modification Date
« on: August 24, 2011, 09:55:54 am »
Simon,

I don't understand why would the following query cause any inconsistencies:

Quote
select MAX(d.modifiedDate) from t_diagram d

I'm running SQL Server 2008. Executing the query through MS SQL Server Management Studio returns a legitimate result.

At the same time running this query:

Quote
select TOP(1) ModifiedDate from t_object order by modifiedDate desc

returns a valid result for models stored in SQL Database, but NOT for models stored in EAP file. It's probably much slower than using MAX, but I guess I can leave with that. Sigh... :)

With some try-catch magic I managed to get this to work across all models (stored in EAP and Database) but it's not pretty. If somebody has a better solution, please share it.

Thanks Geert and Simon for your hints.

Marek

UPDATE:
Oh, and I forgot, I still would love to be able to get the time, not only the date. Anybody?  8-)

2
Automation Interface, Add-Ins and Tools / Re: Last Modification Date
« on: August 24, 2011, 12:55:29 am »
Geert,

thank you very much, this has been a huge help!

The result I get looks like that:

Quote
<?xml version="1.0"?>
<EADATA version="1.0" exporter="Enterprise Architect">
        <Dataset_0><Data><Row><Expr1000>8/23/2011</Expr1000></Row></Data></Dataset_0>
</EADATA>

Do you know if there is a way to get a time in addition to the date? This would be perfect!
I looked up the actual database (one of my models is stored in SQL DB) and the type used to store ModifiedDate is datetime, in the following format: '2011-08-23 09:53:20.000'. Any ideas why the SQLQuery method returns only '8/23/2011'?

Again, thanks a lot for your suggestions!

Mark

UPDATE:
The suggested solution doesn't seem to work with repositories stored in Database, I somehow missed that when I posted my original message.
Running the above listed SQL queries on a project that has been transferred to a database gives the following result:
Quote
<?xml version="1.0"?>
<EADATA version="1.0" exporter="Enterprise Architect">
        <Dataset_0><Data><Row/></Data></Dataset_0>
</EADATA>
Running the SQL against the same repo, only stored in an EAP file gives the following:
Quote
<?xml version="1.0"?>
<EADATA version="1.0" exporter="Enterprise Architect">
        <Dataset_0><Data><Row><Expr1000>8/21/2011</Expr1000></Row></Data></Dataset_0>
</EADATA>
Any hints? Why is there a difference in how EA Automation treats projects stored in file vs a database?

3
Automation Interface, Add-Ins and Tools / Last Modification Date
« on: August 17, 2011, 04:59:18 am »
Hello,

I'm trying to find out when was the last change made to a model (or the entire repository). I'm using Java Automation API. There is a method GetModified that can be called on a Package object, but it doesn't seem to work (that is, it returns some odd values from the distant past like: Sat Dec 30 00:00:00 CST 1899).

I tried recursively traversing the entire tree and getting GetModified on all models (Package objects), packages and elements, but the values simply don't match what I expect to get.

And my expectation is that if I make a change to an element (add a note, add a method or field to a class in the diagram, change the stereotype etc.) the Date returned by GetModifed will be set to my current Date. This is not the case though. Any thoughts and hints?

All I really need to do is to be able to say if the any part of the model has been modified after a given Date. (I know I could just check the time stamp on the EAP file, but sadly this approach doesn't work for EAP files that link to a Database).

Thanks!

Pages: [1]