Install a Template Engine
Install a Template Engine for an Embedded Process Engine
A template engine must be installed in the same way as a script engine. This means that the template engine must be added to the process engine classpath. When using an embedded process engine, the template engine libraries must be added to the application deployment. When using the process engine in a mavenwar project, the template engine
dependencies must be added as dependencies to the maven pom.xml file:
The ASEE Flow BOM only contains the officially supported freemarker template engine.
For the community-driven template engines, please check the Maven coordinates below.
Install a Template Engine for a Shared Process Engine
When using a shared process engine, the template engine must be added to the shared process engine classpath. The procedure for this depends on the application server. In Apache Tomcat, the libraries have to be added to the sharedlib/ folder.
FreeMarker is pre-installed in the ASEE Flow pre-packaged distribution.
Use a Template Engine
If the template engine library is in the classpath, you can use templates everywhere in the BPMN process where you can use scripts, for example as a script task or inputOutput mapping. The FreeMarker template engine is part of the ASEE Flow distribution. Inside the template, all process variables of the BPMN element scope are available. The template can also be loaded from an external resource as described in the script source section. The following example shows a FreeMarker template, of which the result is saved in the process variabletext.
camunda:connector.
Use XSLT as Template Engine
Use XSLT Template Engine with an embedded process engine
When using an embedded process engine, the XSLT template engine library must be added to the application deployment. When using the process engine in a mavenwar project, the template engine
dependency must be added as dependencies to the maven pom.xml file:
Use XSLT Templates
The following is an example of a BPMN ScriptTask used to execute an XSLT Template:camunda:resource
attribute. It may be loaded from the classpath or the deployment (database) in the same way as
described for script tasks.
The result of the transformation can be mapped to a variable using the camunda:resultVariable
attribute.
Finally, the input of the transformation must be mapped using the special variable camunda_source
using a <camunda:inputParameter ... /> mapping.
A full example of the XSLT Template Engine in ASEE Flow can be found in the
examples’ repository.