Hi Rob
Thank you for your interesting question. I would suggest that you model an extends relationship between the entities:
- Example00.png (7.69 KiB) Viewed 55843 times
Doing so allows you to model the base entities with the desired attributes:
- Example01.png (51.79 KiB) Viewed 55843 times
Writing standard template code you would ask for all attributes in the entity as follows:
- Example02.png (21.65 KiB) Viewed 55843 times
This would lead to the following result:
- Example03.png (42.12 KiB) Viewed 55843 times
But it is also possible to write much more complex selector expressions which are able to recursively call themselves.
- Example04.png (34.88 KiB) Viewed 55843 times
- Create a new resource of type FunctionSpace
- Inside, create a new ResourceInfo with typeRef Entity
- Inside create a new SelectorFunction named allEntity
- returnType shall be of type ListType with innerTypeRef Entity
This means that we create a function which can be called in the template on type Entity and returns a list of Entity. The idea is now to collect all base entities which can be recursively reached via the extends relation.
For that reason please enter the following selector statement:
- Entity.extends.allEntity@Common union Entity:Entity
This means that
- On the current entity we follow the extends relation an call ourself recursively
- Then we create a union (set theory) with the current entity itself
As a result, you are now able to use allEntity in your template code and ask for the attributes on this result:
- Example05.png (25.21 KiB) Viewed 55843 times
As a result the generated files contains all the entity from the modeled base classes:
- Example06.png (48.65 KiB) Viewed 55843 times
Please find the working example for actifsource V 5.3.2 here: