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 - Geert Bellekens

Pages: 1 ... 477 478 [479] 480 481 ... 522
7171
Automation Interface, Add-Ins and Tools / Re: pre conditions in sql
« on: December 02, 2010, 04:20:33 am »
Try something like this:
Code: [Select]
SELECT  DISTINCT o.ea_guid AS CLASSGUID, o.Name AS 'Name'
FROM    t_operation o
WHERE   not exists (select 1 from t_operationtag t
                            WHERE t.Property = 'define'
                            AND t.ElementID = o.OperationID)

Geert

7172
Automation Interface, Add-Ins and Tools / Re: pre conditions in sql
« on: December 02, 2010, 01:44:44 am »
Quote
i find the documentation from EA very poor on the sql part.
You Sir are nominated for "Understatement of the year" :o

No seriously, you can open any eap file with ms-access, or otherwise create your db of choice using the SQL creation scripts from the website.

Geert

7173
Automation Interface, Add-Ins and Tools / Re: pre conditions in sql
« on: December 02, 2010, 12:33:13 am »
t_operationpres is of course the table for the pre-conditions.

Geert

7174
Automation Interface, Add-Ins and Tools / Re: pre conditions in sql
« on: December 02, 2010, 12:28:55 am »
Hi,

This EA search query will return operations that contain the search text in the postconditions.
Code: [Select]
select o.ea_guid as CLASSGUID,'Operation' as CLASSTYPE,o.name as Name, class.name as 'Class Name' ,package.name as 'Package Name',package_p1.name as 'Package level -1',package_p2.name as 'Package level -2',package_p3.name as 'Package level -3'
from t_operation as o
join t_operationposts as p on (o.operationID = p.operationID)
join t_object as class on (o.object_id = class.object_id)
join t_package as package on (class.package_id = package.package_id)
left join t_package as package_p1 on (package_p1.package_id = package.parent_id)
left join t_package as package_p2 on (package_p2.package_id = package_p1.parent_id)
left join t_package as package_p3 on (package_p3.package_id = package_p2.parent_id)
where p.Notes like '%<Search Term>%'

Change the '%' by '*' and add brackets around the joins if you are using a local eap file.

Geert

7175
Sven,

You have to set the ConnectorEnd.Aggregation to the value "2" to make it composite.
(by the way, you might want to use regular associations iso aggregations, EA treats them a little different, although in UML the only difference is in the AggregationKind)

Geert

7176
No idea :-/

Geert

7177
No, try reloading, that might help.

Geert

7178
Sven,

In that case you'll have to add the diagram on the parentPackage of the new package.
So you'll have to do something like
Code: [Select]
EA.Package myParentPackage = myRepository.GetPackageByID(myNewPackage.ParentID);
myParentPackage.Diagrams.AddNew(...


Geert

7179
Yes, you can select your package (or the new diagram) again, so it will open the tree again.
Look at Repository.ShowInProjectView (object Item)


Geert

7180
RefreshModelView(0) should reload the whole model, so I would try that first.
If all else fails you can still use Repository.OpenFile (string Filename) to completely reload the model.

Geert

7181
Quote
Or do you mean that you don't see the diagram and the new element in the project browser immediately?
In that case Repository.AdviseElementChange (NewPackage.Element.ElementID)  should fix that. (although I had some issues with that operation in the past, if it isn't working as expected try Repository.RefreshModelView (NewPackage.PackageID))

Geert

7182
That is "normal". Apparently the GUI doesn't know about updates performed by the API, so you have to tell the GUI to update itself.

Geert

7183
Seems OK to me, where is it creating the diagram?

Or do you mean that you don't see the diagram and the new element in the project browser immediately?
In that case Repository.AdviseElementChange (NewPackage.Element.ElementID)  should fix that. (although I had some issues with that operation in the past, if it isn't working as expected try Repository.RefreshModelView (NewPackage.PackageID))

Geert

7184
Sven,

Where it it creating the diagram then?
Post the code you have now, I'll have a look.

Geert

7185
Sven,

I did a little test, and this code works:
Code: [Select]
       public void EA_OnPostNewPackage(EA.Repository Repository, EA.EventProperties Info)
        {
            EA.EventProperty packageID = Info.Get("PackageID");
            EA.Package newPackage = Repository.GetPackageByID(int.Parse((string)packageID.Value));
            string test = newPackage.Name;
        }

Geert

Pages: 1 ... 477 478 [479] 480 481 ... 522