Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: ami on January 31, 2011, 05:14:05 pm

Title: exception when trying to add new connector
Post by: ami on January 31, 2011, 05:14:05 pm
Hi,
I'm trying to add a new connector to the element and when performing Update(); I'm getting an exception
The server threw an excepption. (exception from HRESULT: 0x80010105(RPC_E_SERVERFAULT)).
any ideas why? what is the meaning of this message?
Title: Re: exception when trying to add new connector
Post by: KP on January 31, 2011, 05:37:41 pm
First thought is that you need to set the connector's ClientID and SupplierID before calling Update. If that isn't the problem, could you show us your code please?
Title: Re: exception when trying to add new connector
Post by: ami on January 31, 2011, 06:13:40 pm
I called Update() after setting client and supplier and yet same exception is showing.
the code is:



Element newElem = (Element)m_ElemUseCase.Elements.AddNew("NewElement", "Activity");
newElem.Update();
Connector con2 = (Connector)newElem.Connectors.AddNew("Con", "Transition");//create connector from new element to one below
con2.ClientID = m_ListActivities[rowIndex].ElementID;
con2.SupplierID = m_ListActivities[rowIndex + 1].ElementID;
con2.Update();


if you dont understand something - ask me...
thanks-
Ami.
Title: Re: exception when trying to add new connector
Post by: Geert Bellekens on January 31, 2011, 07:42:29 pm
Ami,

If normally you shouldn't set the ClientID, only the supplierID (since the connector was added on newElem.
You better check if indeed the ClientID == newElem.ElementID

Geert

PS. What version are you on? There could have been a fix for this issue...

Title: Re: exception when trying to add new connector
Post by: ami on January 31, 2011, 07:47:31 pm
Hi geert,
I will check if I have to.
my version is 8.0.858
Title: Re: exception when trying to add new connector
Post by: ami on January 31, 2011, 07:58:59 pm
I just want to say that this is the way I was working till today (I'm talking about the client - supplier) and my code worked just fine, I dont know what went wrong...
Title: Re: exception when trying to add new connector
Post by: Geert Bellekens on January 31, 2011, 08:17:46 pm
Sometimes Repository.GetLastError() provides some useful information.

Geert
Title: Re: exception when trying to add new connector
Post by: ami on January 31, 2011, 08:24:06 pm
I will try it and tell you the results

Ami.
Title: Re: exception when trying to add new connector
Post by: ami on January 31, 2011, 08:28:02 pm
GetLastError() just return an empty string...
so its not EA exception??....

Ami.