Search

JavaScript is Deprecated in Camunda BPM

When you execute JavaScript code in a Camunda BPM process model, decision table or case model, that code is executed via an engine called "Nashorn", which Oracle introduced in Java 8. Unfortunately, Nashorn has been deprecated in Java 11 and will be removed in a future release of the JVM. To wit, You may have seen this message below in your application server or Spring Boot log:



That's an unsettling message!


Nashorn was deprecated via the proposal in JEP 335 and has now been scheduled for removal via JEP 372. Per Oracle Labs: "If you are running on Nashorn today, the clock is ticking faster now until the day when you will be unsupported."*


To this point, Camunda Services GmbH hasn't provided any guidance on how they intend to address this deprecation, meaning that developers building JavaScript code in Camunda are taking a significant risk... The code they're developing today may simply not work in future Camunda BPM installations.


To address this, Summit58 is now offering - under the permissive Apache Software Foundation 2.0 license - a drop-in replacement for Camunda BPM Version 7.12.0 that enables the use of the Graal.js JavaScript engine from GraalVM. The Maven coordinates for this drop-in replacement are:


<dependency>
  <groupId>co.summit58.bpmn</groupId>
  <artifactId>camunda-engine</artifactId>
  <version>7.12.2</version>
</dependency>

With this upgrade, Graal.js will automatically replace Nashorn if it's on the Java classpath, and you'll be able to execute any existing JavaScript logic that you'd previously executed in the Nashorn engine... but without deprecation worries or warnings! (NOTE: Summit58's engine will automatically fall back to the Nashorn engine if Graal.js isn't on the Java classpath.) There are just two caveats:


  1. If you use Camunda Spin, you'll need to replace your "camunda-spin-core" library with the Summit58-customized "camunda-spin-core" library, as Camunda's legacy mechanism of enabling the "S(string)" function is not compatible with Graal.js.

  2. Summit58's upgraded engine - by default and for security reasons - won't allow the use of the "load(...)" function to load JavaScript from an external file. You can change this by setting the "enableScriptIO" configuration parameter on the "ProcessEngineConfigurationImpl" class to true.


The Maven coordinates for the drop-in replacement for camunda-spin-core are:


<dependency>
  <groupId>co.summit58.json</groupId>
  <artifactId>camunda-spin-core</artifactId>
  <version>1.7.4.1</version>
</dependency>

To utilize Summit58's upgraded engine in an application server, simply replace the existing "camunda-engine-7.12.0.jar" file with Summit58's upgraded JAR file. To utilize the upgraded engine in a Spring Boot application, you can add Summit58's upgraded engine to your "pom.xml" file. (NOTE: You may need to exclude Camunda's engine version from another Camunda component, as it's a transitive dependency in some cases.)


This upgrade can also be made to Enterprise Edition versions of Camunda; if you need that upgrade in your enterprise, please contact us directly via the email address listed below. It can also be back-ported to earlier versions of the platform if desired.


Please let us know that you're using our enhanced engine by reaching out to us at info@summit58.co. We'd love to hear from you!


* - "Nashorn removal: GraalVM to the rescue!" (link)

372 views1 comment

Recent Posts

See All