Can I apply some algorithms in m2doc?

Hello guys. Can I apply some algorithms, like arrays or stack in my template?
Sometimes we have very specific filter requirements, for example to get the common smallest parent function of several children functions. The current generation can’t satisfy this requirement. I can only get every function’s direct parent function. I can’t judge whether two function is the same in my m2doc template.
It’s just a small question. Maybe a better idea is to use java codes to satisfy this requirement.

If you have complex algorithms, you probably want to create a Java service and import it in your template. This imply that you have knowledge in Java and Eclipse plug-in development.

You can also have a look at the Capella extension code.

Some services can help you like ancestors() that can be filtered on a type, but it will not be enough to satisfy your requirement.

1 Like

Thank you so much for your reply!