Book a Demo

Author Topic: EA 12 - Invoking Update() on Connector -> EA Cr  (Read 4386 times)

Tomasz

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
EA 12 - Invoking Update() on Connector -> EA Cr
« on: September 08, 2015, 12:42:53 am »
Hi,

I was working very long time on implementing C# plugin for generating custom communications diagrams. And it was working great until version 12 appears :(.

I have found that there's a significant change in internal API (in ver.12) implementation, which causes EA crash when I'm trying to Update() programatically instance of Connector class.

After some investigation I have found that for some reason, some person decided that now it's impossible to create and Update()  Connector instance with type 'Collaboration' between:
- 'Actor' and 'Object' or even between two 'Object's

Of course it's possible to create that manually. I checked exported xml file and I have found that:

<UML:TaggedValue tag="ea_type" value="Collaboration"/>
<UML:TaggedValue tag="direction" value="Source -&gt; Destination"/>
.....
<UML:TaggedValue tag="ea_sourceType" value="Actor"/>
<UML:TaggedValue tag="ea_targetType" value="Object"/>

It worked perfectly in previous version 10 and 11.
Could someone can help me ?

Thank in advance.

Code pieces:

//simple connection between Actor(root of diagram) and first class 'Object'
EA.Connector connector = previous.m_diagramElement.Connectors.AddNew("", "Association");
connector.SupplierID = current.m_diagramElement.ElementID;            
connector.Direction = "Source -> Destination";            


//Manually you should  'Add Message from XX to YY" by selecting from previously created connector on diagram submenu (RMB)
//To achieve the same programatically I created message connector
EA.Connector message = previous.m_diagramElement.Connectors.AddNew(functionData.MethodName, "Collaboration");
message.SupplierID = current.m_diagramElement.ElementID;
message.Direction = "Source -> Destination";

connector.Update();
message.SupplierEnd.Ordering = 1;            
message.ClientEnd.Aggregation = connector.ConnectorID;            
message.ClientEnd.AllowDuplicates = true;
message.ClientEnd.Ordering = 1;
message.Update() <<--------------- Here is a crash

When I use try catch statement, the exception message is:

'Collaboration' is not legal for Actor --> Object' !!

Why it's possible to do it manually, I don't understand  :(

Is it possible to set in C# code that I want to use Lib with version 10 or 11 ?
« Last Edit: September 08, 2015, 12:47:04 am by tomaszlewandowski »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: EA 12 - Invoking Update() on Connector -> EA C
« Reply #1 on: September 08, 2015, 05:21:59 am »
Faintly and eventually unrelated I remember a discussion. Try turning off Package/Model Validation/Configure all options (and turn them on back until the error comes back, then leaving this one off).

q.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: EA 12 - Invoking Update() on Connector -> EA C
« Reply #2 on: September 08, 2015, 04:44:17 pm »
We have had reports of similar problems with creation of other connector types via automation and we have resolved this issues in subsequent EA builds.

For some similar issues, see:
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1424598684
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1426005189
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1437471768

Workaround: Open "Tools | Options | Links" and clear the "Strict Connector Syntax" option

Please submit a bug report and we will investigate your specific issue further.  (See "Report a Bug" link at the foot of this page)

Tomasz

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: EA 12 - Invoking Update() on Connector -> EA C
« Reply #3 on: September 08, 2015, 05:49:29 pm »
Thank you for quick answer.
Workaround works fine.

I will create a bug report today.