Book a Demo

Author Topic: MDG Transformation - Invoke Java from template?  (Read 5331 times)

rjh

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
MDG Transformation - Invoke Java from template?
« on: October 11, 2012, 06:54:59 am »
Would like to invoke my Java code from within an MDA code generation template, is there a simple way to do that?

Robert Hathaway
Solution Architect
ADP Innovation Lab

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: MDG Transformation - Invoke Java from template
« Reply #1 on: October 11, 2012, 07:02:34 am »
AFAIK you can only invoke AddIn methods from transformation (or code generation) templates using the EXEC_ADDIN() macro.
You can write an AddIn using Java of course, but I pesonally would prefer C#.

HTH
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

rjh

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: MDG Transformation - Invoke Java from template
« Reply #2 on: October 11, 2012, 07:18:44 am »
Thanks for the quick response!   Found the documentation under Function Macros.

Robert Hathaway
Solution Architect
ADP Innovation Lab

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: MDG Transformation - Invoke Java from template
« Reply #3 on: October 11, 2012, 09:19:06 am »
Quote
You can write an AddIn using Java of course, but I pesonally would prefer C#.
Unfortunately it's not possible to write an EA add-in using Java - it's a known limitation of the API.  Java can only be used to access EA as an automation client.  There is no way I can think of that you could invoke Java code from a transformation template.  As per the previous suggestion, I'd suggest writing an add-in using C# based on the examples that are available.

rjh

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: MDG Transformation - Invoke Java from template
« Reply #4 on: October 12, 2012, 03:17:15 am »
I need to access Java APIs.  I presume the way to do this from C# would be to invoke a separate process such as exec and pass parameters thru a CLI.

Vinnie

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: MDG Transformation - Invoke Java from template
« Reply #5 on: October 17, 2012, 02:51:15 am »
Hi, I would like to make use of this topic to ask about add-in development in Java, since I saw that this matter was already addressed.

First, I know about the limitation of using java to access EA's information, but still I have made some research and ended up finding frameworks that says to provide bridging between java and COM, such as:
http://danadler.com/jacob/
http://www.jnbridge.com/index.htm
http://javacombridge.com/

Giving my limited knowledge of ActiveX, COM and .NET platform, I would like to ask if even with the use of these frameworks, creating java add-ins is still impossible? Have anyone ever tried this approach?