This is a continuation of my post from here: https://mps-support.jetbrains.com/hc/en-us/community/posts/115000710264-Unresolved-references-in-Generated-text
It will help to get some context.
My project structure looks like :
And my language looks as follows:
Using the declaration of Persons (pre-defined) in the 2nd line of my language code, I am able to generate the required fields using a $LOOP$ macro over node.persons where node refers to rrot concept Workflow and persons refers to PersonReferences as shown below:
My Workflowstep concept looks as follows:
The only remaining problem is that I need to generate 3 classes and fill them up with methods based on the action names, i.e.
> there should be 1 class Waiter with method writes_down_order()
> there should be 1 class Chef with method cooks_meal()
> there should be 1 class Customer with 2 methods places_order() and pays_bill()
How may I achieve the 3rd point listed above? If I iterate over the worksflowsteps, I get 2 customer classes, each one containing 1 method only! My generator looks as below
Please provide your suggestions. Thank you very much!