Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: javier974 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
-
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
-
Hi Geert,
thanks for your answer. I mean the report generation templates.
Thanks in advanced
-
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
-
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.
-
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
-
Thanks Geert I was able to fix it with your hint. Best Regards