Jinja2 Integration

The pyalaocl.jinja2 module provides the necessary features to use pyalaocl expressions into jinja2 templates. To be more precise a function is provided to augment jinja2 environment with:

  • jinja filters. asSet, asBag, asSeq can be used as filters.
  • jinja global symbols.

In the context of Modelio, global functions are also added as global symbols.


Add OCL functions to a jinja2 environment so that OCL can be used in jinja2 templates.

Parameters:jinja2Environment (jinja2.Environment) – Jinja2 environment to be instrumented.
Returns:The modified environment.
Return type:jinja2.Environment