Author Topic: exception when trying to add new connector  (Read 3529 times)

ami

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
exception when trying to add new connector
« 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?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: exception when trying to add new connector
« Reply #1 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?
The Sparx Team
[email protected]

ami

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: exception when trying to add new connector
« Reply #2 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.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13065
  • Karma: +544/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: exception when trying to add new connector
« Reply #3 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...


ami

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: exception when trying to add new connector
« Reply #4 on: January 31, 2011, 07:47:31 pm »
Hi geert,
I will check if I have to.
my version is 8.0.858

ami

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: exception when trying to add new connector
« Reply #5 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...

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13065
  • Karma: +544/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: exception when trying to add new connector
« Reply #6 on: January 31, 2011, 08:17:46 pm »
Sometimes Repository.GetLastError() provides some useful information.

Geert

ami

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: exception when trying to add new connector
« Reply #7 on: January 31, 2011, 08:24:06 pm »
I will try it and tell you the results

Ami.

ami

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: exception when trying to add new connector
« Reply #8 on: January 31, 2011, 08:28:02 pm »
GetLastError() just return an empty string...
so its not EA exception??....

Ami.