Author Topic: connector.Update() fails  (Read 2902 times)

xkrystof

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
connector.Update() fails
« on: November 15, 2007, 05:31:32 am »
Hi,

I'm trying to create connectors via Java API.
So far I haven't had any problems with connectors creating.
However, I reached a point where the connector.Update() method fails:

Code: [Select]

sourceID=490, targetID=5651
sourceID=486, targetID=5653
sourceID=489, targetID=5650
sourceID=488, targetID=5652
Exception in thread "main" java.lang.Exception: I

at org.sparx.Connector.comUpdate(Native Method)

at org.sparx.Connector.Update(Connector.java:538)

at cz.tconsult.moTr.eaImportExport.DMExporterToEA.exportDMConnector(DMExporterToEA.java:594)

at cz.tconsult.moTr.eaImportExport.DMExporterToEA.exportDMConnectors(DMExporterToEA.java:522)

at cz.tconsult.moTr.eaImportExport.DMExporterToEA.exportDMTree(DMExporterToEA.java:182)

at cz.tconsult.moTr.prevodymodelu.RoseXML2EA.main(RoseXML2EA.java:963)


You can see just the last few line of my standard output...
The first lines display info about the connector client and supplier IDs. Then suddenly an exception appears without any obvious reason.

I've tried to run my application several times and I always get the same exception on the same place (i.e. for the same connector).

Don't you know any reason why the update method could fail?

Code: [Select]

newConnector = connectors.AddNew(dmConnector.getName(),dmConnector.getType());
newConnector.SetDirection(dmConnector.getDirection());
newConnector.SetNotes(dmConnector.getNotes());
newConnector.SetStereotype(dmConnector.getStereotype());
newConnector.SetClientID(dmConnector.getSource().getNodeID());    newConnector.SetSupplierID(dmConnector.getTarget().getNodeID());        newConnector.SetStyleEx(dmConnector.getStyleEx());      
newConnector.Update();


All the code above works fine for several thousand hundred connectors but finally the Update method fails (although the previous methods such as SetSupplierID etc. succeeded)

Any hint?

Thanks.

Radek

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: connector.Update() fails
« Reply #1 on: November 15, 2007, 07:07:14 am »
Radek,

What happens if you run an integrity check on the project?

You can do this from the EA main menu via Tools | Data Management | Project Integrity Check.

Also, does the fault happen at a predictable time? Is it associated with any particular type of client or supplier element?

David
No, you can't have it!

DmitriyKnyazhin

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • Sorry for that
    • View Profile
Re: connector.Update() fails
« Reply #2 on: November 15, 2007, 07:12:19 pm »
I'v had similar problem.
In my case, type of connector was incorrect.

Try 'Dependency' or some else "correct" type of connectors in EA.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: connector.Update() fails
« Reply #3 on: November 15, 2007, 08:59:15 pm »
Can you please specify what type of connector you are creating and what types the source and target elements are?