Book a Demo

Author Topic: Realisation is not legal for Class --> Interface  (Read 4771 times)

Adrien_

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Realisation is not legal for Class --> Interface
« on: March 11, 2015, 03:33:08 am »
Hello,

I have a problem when trying to add a new realization connector between a class and an interface.

I absolutely can't understand where the problem is:

Code: [Select]
function implementsInterface(classe /* : EA.Element */, interface /* : EA.Element */){
      var connector as EA.Connector;
      if(classe != null && interface != null){
            Session.Output("Interface name: " + interface.Name + ", type:" + interface.Type + "\nClass name: " +  classe.Name + ", type: " + classe.Type);
            connector = classe.Connectors.AddNew("", "Realization");
            connector.SupplierID = interface.ElementID;
            connector.Direction = "Source -> Destination";
            connector.Update();
            classe.Connectors.Refresh();
            interface.Connectors.Refresh();
      }
      return connector;
}

Gives :

Interface name: testDao, type:Interface      
Class name: testDaoImpl, type: Class      
util.interfaces error: Realisation is not legal for Class --> Interface, Line:60      

I have no problem if I try to add an Association instead, and it shows in my model afterwards.

Does anyone have an idea?

Thanks

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Realisation is not legal for Class --> Interfa
« Reply #1 on: March 11, 2015, 07:16:33 am »
I get the same error in V12 and consider that a bug. Manually you can create that connector. In V11 I don't have this issue!

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Realisation is not legal for Class --> Interfa
« Reply #2 on: March 11, 2015, 10:56:14 pm »
Wasn't that fixed in one of the latest versions?
I seem to remember something like that.

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Realisation is not legal for Class --> Inte
« Reply #3 on: March 11, 2015, 11:00:49 pm »
This is what I remembered.
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1424598684/0#0
What happens if you turn "strict connector syntax" off?

In any case I would report it as a bug because Realization IS a legal relationship between Class and Interface.

Geert
« Last Edit: March 11, 2015, 11:01:01 pm by Geert.Bellekens »

Adrien_

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Realisation is not legal for Class --> Interfa
« Reply #4 on: March 12, 2015, 11:47:34 pm »
I had an ancient version of EA 12 so I tried upgrading but still the same problem.

It works when turning "strict connector syntax" off, thanks!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Realisation is not legal for Class --> Interfa
« Reply #5 on: March 13, 2015, 12:52:26 am »
Please remember to send a bug report...

q.