Book a Demo

Author Topic: RTF recipe how to print state.name and state.notes  (Read 7159 times)

javier974

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
RTF recipe how to print state.name and state.notes
« on: January 22, 2025, 11:25:56 pm »
Hello, I have a Class element with a State Machine as a child.

I would like to iterate over the individual states of the State Machine in a recipe and output both the names and the notes.

Unfortunately, I can only display the entire State Machine as an image.

Do you have any tips on how I can achieve my goal?

Thanks in advanced

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: RTF recipe how to print state.name and state.notes
« Reply #1 on: January 22, 2025, 11:35:24 pm »
I'm not sure what you mean by "in a recipe", but you can write a scrpt to loop the states.

Otherwise you can use report generation templates to generate a report as well.

Geert

javier974

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: RTF recipe how to print state.name and state.notes
« Reply #2 on: January 22, 2025, 11:37:28 pm »
Hi Geert,

thanks for your answer. I mean the report generation templates.

Thanks in advanced

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: RTF recipe how to print state.name and state.notes
« Reply #3 on: January 22, 2025, 11:48:12 pm »
States are child elements under the state machine element.
If you check the box "child elements" it will automatically iterate over these elements.

I personally usually use a sql template fragment for things like this.

Geert

javier974

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: RTF recipe how to print state.name and state.notes
« Reply #4 on: January 23, 2025, 12:52:46 am »
Hi I tried it with child elements but it works strange :(

If I add child elements><child elements it will print the state machine diagramm. If i add child elements>{Element.name}<child elements it prints only the toplevel name of the state machine.

Any hint or how can i solve it with a sql template fragment

Thanks in advanced.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: RTF recipe how to print state.name and state.notes
« Reply #5 on: January 23, 2025, 01:20:02 am »
You are not supposed to put anything between the child element tags.
It will automatically apply the same template on the child elements.

If you search the forum there should be a couple of examples I posted for sql fragments.

Geert

javier974

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: RTF recipe how to print state.name and state.notes
« Reply #6 on: January 24, 2025, 02:42:42 am »
Thanks Geert I was able to fix it with your hint. Best Regards