Author Topic: EA10-CodGen - Macro for TaggedValue for Attribute?  (Read 2039 times)

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
EA10-CodGen - Macro for TaggedValue for Attribute?
« on: January 18, 2013, 01:13:16 pm »
Hi,

Summary: I fail to be able to retrive Tagged Values from Attributes. Why?

I tried to retrieve TaggedValeus from an Attribute in my SoonToBe CodeGenerator, but it seems like the macros doesn't return any (existing) TV data from my Attributes.

I found the following macros in the help section "Macros, Code Template Syntax" with the title "Tagged Value Substitution Macros":
Code: [Select]
(attTag)
(classTag)
(connectorDestElemTag)
(connectorDestTag)
(connectorSourceElemTag)
(connectorSourceTag)
(connectorTag)
(linkAttTag)
(linkTag)
(opTag)
(packageTag)
(paramTag)

These were all called in the "Attribute Declaration" template, but I get only empty strings as the result. What am I missing? :( :

Code: [Select]
()
()
()
()
()
()
()
()
()
()
()
()
Any hints?

// Rolf Lampa
« Last Edit: January 18, 2013, 01:15:53 pm by Rolf_Lampa »
-- There's always a solution --

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7731
  • Karma: +103/-18
    • View Profile
Re: EA10-CodGen - Macro for TaggedValue for Attrib
« Reply #1 on: January 18, 2013, 03:35:59 pm »
I'm not sure that you are doing it, but you need to specify the tag by name.

eg.
%attTag:"myTag"%

And it will only work from within and Attribute template. (Because outside of an attribute template there is no attribute in scope)
Eve

support@sparxsystems.com

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: EA10-CodGen - Macro for TaggedValue for Attrib
« Reply #2 on: January 18, 2013, 05:31:02 pm »
Ops, ok, I see... thanks, I now have tried (also) that syntax... but to no avail.  Screenshot of some TV's I'm trying to catch:


That is, I don't get the expected printout from the template using the following expression: %attTab:"AllowNULL"%

Are there any Tools or something such that also needs to be included in the "path" or identifier of the TV?

Edit: This code is in the template named "Attribute Declaration" so the context for the TV should be ok.

// Rolf Lampa
« Last Edit: January 18, 2013, 05:48:15 pm by Rolf_Lampa »
-- There's always a solution --

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: EA10-CodGen - Macro for TaggedValue for Attrib
« Reply #3 on: January 18, 2013, 07:43:24 pm »

Edit:  { scrapping the former answer altogether }

Unbelievable, I misspelled the identifier: It should read attTag, not attTab

 :-[

// Rolf Lampa
« Last Edit: January 18, 2013, 08:51:26 pm by Rolf_Lampa »
-- There's always a solution --