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

Pages: [1]
1
Automation Interface, Add-Ins and Tools / COM Exception
« on: January 07, 2011, 09:00:43 pm »
Hi, this is the problem:

When line parent.Elements.AddNew("<Element Name>", type); executes, throw a COMException with "Internal Error" message.

Any ideas??

[size=8] public EA.IDualElement AddChildElement(EA.IDualElement parent, EA.IDualElement child, string type, string stereotype, out bool success)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent", "METESPA_Addin.Model.Dao:AddChildElement(EA.IDualElement parent, EA.IDualElement child, string type, string stereotype, out bool success)");
            }

            object element = null;
            success = true;

            try
            {
                if (child == null)
                {
                    
                 [highlight]   element = parent.Elements.AddNew("<Element Name>", type);[/highlight]
                }
                else
                {
                    element = parent.Elements.AddNew(child.Name, type);
                }

                success &= ((EA.IDualElement)element).Update();
                parent.Elements.Refresh();

                ((EA.IDualElement)element).Stereotype = stereotype;
                success &= ((EA.IDualElement)element).Update();

                ((EA.IDualElement)element).TreePos = parent.Elements.Count;
                success &= ((EA.IDualElement)element).Update();

                if (success)
                {
                    OnAddedElement(((EA.IDualElement)element).ElementID, ((EA.IDualElement)element).PackageID, ((EA.IDualElement)element).ParentID, ((EA.IDualElement)element).Type, ((EA.IDualElement)element).Stereotype);
                }
            }
            catch
            {
                throw new DaoException("METESPA_Addin.Model.Dao:AddChildElement(EA.IDualElement parent, EA.IDualElement child, string type, string stereotype, out bool success)");
            }

            return (EA.IDualElement)element;
        }[/size]


2
Automation Interface, Add-Ins and Tools / Transactions
« on: October 20, 2010, 08:06:53 pm »
Hi,

is possible to perform a transaction begin/commit/rollback using Automation Interface?

How AI handles connections to database? It opens a new connection by every SQL DML generated calling the API functions? Or an unique connection is mantained for all?

My point is that sometimes i have a large set of data to insert or delete from repository and it seems that the performance is very poor ...

3
Automation Interface, Add-Ins and Tools / Access profile data from AI
« on: July 27, 2010, 06:14:03 pm »
Hi, im trying to access stereotype info from a profile that is packed inside a MDG Technology file that is deployed from an Addin.

I have checked that the stereotypes defined in my profile are not accesible from Repository class, since the Stereotypes collection of that class returns only the stereotypes stored in the .eap file.

Any workaround for this scenario?

Thanks in advance

4
Hi!

im developing an add in on c# language and im trying to incorporate copy and paste of packages and elements into the tree structure of an ea project.

First problem here is that AI does not provide constructors for classes derived from EA.IDualPackage and EA.IDualElement (all work is done throught collections Packages and Elements).

I thought about doing deep copy of objects using serialization but classes derived from those interfaces are wrapped into 'System.__ComObject' at runtime and throw exception because this type is not marked as serializable.

Is there any workaround for this? Using windows clipboard maybe?

Thanks in advance for your suggestions

5
Automation Interface, Add-Ins and Tools / Re: model watcher
« on: July 09, 2010, 05:30:37 pm »
It helps a lot, thank you

6
Automation Interface, Add-Ins and Tools / model watcher
« on: July 09, 2010, 02:51:38 am »
Hi, can you put here an example of creating an instance of modelwatcher in c#?

Pages: [1]