Hello ${name}! – Templating with camunda BPM

As part of our scripting improvements we also addressed templating as a new feature of camunda BPM. With the new camunda BPM 7.2.0-alpha3 release it is now also possible to use FreeMarker or Apache Velocity templates inside your BPMN process.


We integrated this template engines as JSR 223 compatible scripting engines. Therefore we create small wrappers for these template engines in our camunda-template-engines-jsr223 project. This has the advantage that we do not need new extension elements or attributes for the BPMN xml. Instead a template can be used everywhere a script can be used. This is especially useful for script tasks and input output mappings. If the template engine JSR 223 wrapper is part of your classpath you can use the name of the template engine as script language.

The maven coordinates of the template engine wrappers a the following if you want to use them with an embedded engine or in a JUnit test case:

<dependency>
  <groupId>org.camunda.template-engines</groupId>
  <artifactId>camunda-template-engines-freemarker</artifactId>
  <version>1.0.0</version>
</dependency>

<dependency>
  <groupId>org.camunda.template-engines</groupId>
  <artifactId>camunda-template-engines-velocity</artifactId>
  <version>1.0.0</version>
</dependency>

<code>

The following example shows a simple use case where an input output mapping is used on a service task to generate a text content needed by this task. Here we use the FreeMarker template engine to generate the body of an email.

<code>

<code>As you can see the process variables in the current scope can directly be used in the template. The result of the processed template is than save in a local variable which is available inside of the service task.

<code>Another interesting use case for templates are camunda connectors (added in 7.2.0-alpha2). As templates like scripts can be loaded from external resources it is possible to use the a SOAP envelope template in multiple processes or projects. An example for such an template can be found in our SOAP connector example.

<code>

<code>As a side effect of this new feature we have demonstrated that you can now easily integrate own scripting-like languages in camunda BPM. If it is possible to create a JSR 223 compatible wrapper it can be used in camunda BPM.

<code>To read more technical details about templating please visit our user guide. And please let us know what you think about this new feature.


  • Monitoring Camunda Platform 7 with Prometheus

    Monitoring is an essential facet of running applications in a production system. Through this process, organizations collect and analyze data, and determine if a program is performing as expected within set boundaries. When combined with alerting, monitoring allows for detecting unexpected system behavior to mitigate exceptional situations as fast as possible. Furthermore, tracking the performance of a system enables organizations to improve those aspects that have the biggest impact with higher priority. One essential aspect of monitoring is the list of key metrics you want to observe. There are different categories of statistics that can be of interest here. To observe the defined metrics, there are plenty of application monitoring tools on the market today. They differ in many aspects...

    Read more
  • Securing Camunda 8 self-managed cluster and applications...

    Directory services are an effective way to manage an organization’s users, groups, printers, devices, and more. Most organizations accomplish this using Active Directory, Apache Directory, Oracle Internet Directory, or other similar tools. Recently I worked with a customer who wanted to see how he could secure the Camunda 8 Platform and process applications with such a directory. Their requirements consisted of: Allowing Directory users to access Camunda applications (Tasklist, Operate, Optimize) Accessing secured Tasklist & Operate APIs from our custom project Securing the custom project In this article, I’ll briefly explain the 3 easy steps taken to fulfill their requirements which include: Federate users from the Directory service into Keycloak Declare an application in Identity to access Camunda APIs Configure...

    Read more
  • Accelerate Connectivity with Camunda Platform 8.1

    We’re thrilled to announce Camunda Platform 8.1, the latest release of our process orchestration solution. This new version introduces features that accelerate connectivity to the many different systems and technologies that are required for true digital transformation, including: Create custom Connectors with our Integration Framework to accelerate connectivity New out-of-the-box Connectors for popular services Enhancements to Camunda Modeler that improve productivity Hot backups and official support for Amazon EKS and Red Hat OpenShift Plus, several upgrades requested by Camunda Platform 7 customers Organizations across all industries rely on complex technology stacks to adapt and enhance their operations in response to market dynamics, new disruptive companies, and increasing consumer expectations. Your technology stack likely includes everything from cutting-edge technologies to legacy...

    Read more

Ready to get started?

Still have questions?