4.5. Code Instructions with snippets

There are use cases where using only XML pattern features is not enough:

  • To evaluate complex expressions

  • To generate plain text files

  • To extract and manipulate model data

4.5.1. Lots of added flexibility

MetaFactory supports both Freemarker (our recommended choice) and Velocity. This means that you have access to all functionality that these template engines deliver to create snippets.

The content of snippets can define an expression to be called upon from an XML pattern, method bodies, complete classes or any content that you wish to fill a generated text file with. Inside these snippets you can also access your pattern properties or any item from the model.

Glasses M Documentation offered by Freemarker and Velocity will get you up and running quickly.

4.5.2. How to use it

GoTo S How to use snippets