Book a Demo

Author Topic: Code generation + constraints  (Read 3906 times)

JBR

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
  • Sorry for my english, I'm french ;-)
    • View Profile
Code generation + constraints
« on: August 23, 2006, 01:21:53 am »
Hi,

sorry for all my english mistaskes (I'm french  :P)

I defined constraints in classes and in attributes...
When I generate the code, I would like to recover the list of constraints (classes and attributes)

How to do it ?
ty

PS: idem for TagValues
« Last Edit: August 23, 2006, 02:03:27 am by JBR »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Code generation + constraints
« Reply #1 on: August 23, 2006, 04:46:03 am »
What do you mean by "recover?" Are you trying to capture the content of the constraints in the generated code? Or are you trying to make sure the constraints (or tag values) are all captured?
No, you can't have it!

JBR

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
  • Sorry for my english, I'm french ;-)
    • View Profile
Re: Code generation + constraints
« Reply #2 on: August 23, 2006, 04:48:54 am »
Yes I would like to capture the content of the constraints in the generated code but I don't know how to do.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code generation + constraints
« Reply #3 on: August 23, 2006, 03:48:17 pm »
Code Generation Templates don't directly support getting the constraints.  However if you want them you can access them using the EXEC_ADD_IN call from the templates.

C# method
Code: [Select]
// sample EXEC_ADD_IN call
public object MyAddInFunction(EA.Repository repository, object argsObject)
{
string[] args = (string[])argsObject;
return "";
}

Template
Code: [Select]
%EXEC_ADD_IN ("MyAddin", "MyAddInFunction", classGUID)%

Hope that gets you going.

JBR

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
  • Sorry for my english, I'm french ;-)
    • View Profile
Re: Code generation + constraints
« Reply #4 on: August 23, 2006, 11:59:45 pm »
ty for your reply...I'll try it today...