Author Topic: Update on connector causes fault  (Read 4584 times)

ajaxx

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Update on connector causes fault
« on: February 19, 2009, 05:39:46 pm »
I've got an application that translates one workflow model into an activity diagram for EA.  Once I tried to enable the connector I encountered the following error.  If the EA process is not reset and a subsequent call is made it causes EA to fault.

System.Runtime.InteropServices.COMException

The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

The following is the code I use.  I can assure you that the elementTable never returns null for either the source or target.  Both are non-null values (they are simply my index for quickly looking up elements by my own internal key).

            foreach (var item in list)
            {
                EA.Element target = elementTable[item];
                foreach (PrecedenceConstraint constraint in item.PrecedenceConstraints)
                {
                    EA.Element source = elementTable[lookupTable[constraint.StepName]];
                    EA.Connector connector = (EA.Connector)source.Connectors.AddNew("test link", "Control Flow");
                   connector.SupplierID = target.ElementID;
                    connector.Update();
               }
            }

I've

xhanness

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: Update on connector causes fault
« Reply #1 on: March 09, 2009, 08:10:36 am »
I am getting the same error ...

my method goes here:
Code: [Select]
       public static EA.Connector createConnector(EA.Element aClient, EA.Element aSupplier, string aAssociationName, string aAssociationType, string aStereotype)
        {

            EA.Connector newConnector = (EA.Connector)aClient.Connectors.AddNew(aAssociationName, aAssociationType);
            newConnector.Stereotype = aStereotype;
            newConnector.SupplierID = aSupplier.ElementID;
            newConnector.ClientID = aClient.ElementID;
            Console.WriteLine(aClient.ElementID + "," + aSupplier.ElementID);

            newConnector.Update();
            aClient.Connectors.Refresh();

            return newConnector;
        }


any ideas what could be wrong ?  :(
« Last Edit: March 09, 2009, 08:10:53 am by xhanness »

xhanness

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: Update on connector causes fault
« Reply #2 on: March 09, 2009, 08:27:19 am »
Uhh, the problem was in setting wrong type to the cpnnector. I was setting "Association " - one space more ...

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Update on connector causes fault
« Reply #3 on: March 09, 2009, 11:58:14 pm »
That would do it!

This is worth stressing: the connector Type string must be set exactly as given. Spaces (leading, trailing, embedded) must be present or absent as appropriate, and the string is case sensitive.

I believe this was once mentioned in the documentation, but is not evident now. [I cannot tell if it is missing or has been moved.] The documentation also fails to list connector types, but refers the reader to the database schema (without explaining how to read the file). This is particularly grating, as the Type attribute for elements is explained. A related problem applies to the SubType attribute for both connectors and elements, but in these cases there is no way to obtain a list of legal values.

[Yes, I have mentioned this to Sparx; no results yet.]

David
No, you can't have it!

Virgil

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Update on connector causes fault
« Reply #4 on: March 18, 2009, 11:10:28 pm »
If the connector Type I set is not correct, after the call to the Update function I get an exception "LoaderLock was detected" and the application crashes.
Has anyone experienced that?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Update on connector causes fault
« Reply #5 on: March 19, 2009, 11:08:06 pm »
What version and build of EA are you using? If not 7.1 build 834 or 7.5 beta build 842 then I suggest you update or at least read through the intervening release notes.

If it is either of these builds, are you using an EAP file or a DBMS? In the former case try setting Jet 4.0 on the Tools | Options | General dialog. Remember that you must exit and restart running EA instances (whether by hand or via automation) before the change will take effect.

In you still have the problem then, as mentioned above, please send an immediate bug report to Sparx. Include the code you are using (or the entire project if you can). [Just compress an archive and use that.]

If you don't attach a file then you can use the Report a Bug link below the Support link near the bottom of any forum page. If you need to attach a file then use the registered users support form.

David
No, you can't have it!

Virgil

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Update on connector causes fault
« Reply #6 on: March 20, 2009, 12:50:34 am »
I'm using EA 7.1 build 831, with an EAP file. I have tried the build 834 trial, it's the same thing.
After I have modified the exception handling in Visual Studio 2005, I get the following message "Unhandled exception at 0x7c943345 in EA.exe: 0xC0150010: The activation context being deactivated is not active for the current thread of execution."

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Update on connector causes fault
« Reply #7 on: March 20, 2009, 05:08:37 am »
Have you sent in the bug report? [Remember, you don't have to be a licensed user to do so.]
No, you can't have it!

Virgil

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Update on connector causes fault
« Reply #8 on: March 20, 2009, 05:24:32 am »
Yes, I have sent the bug report but I cannot send the project. I hope they'll understand/reproduce my problem.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Update on connector causes fault
« Reply #9 on: March 20, 2009, 08:49:55 am »
Thanks Virgil,

I am sure they will try. They can generally ferret out the solution.

If they get back to you and cannot reproduce it, ask them about their tool for removing sensitive data from a project. That might work well enough for you to send the file.
No, you can't have it!