Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from Nashorn to GraalVM for javascript execution #302

Open
jeremythuff opened this issue Aug 4, 2023 · 3 comments
Open

Switch from Nashorn to GraalVM for javascript execution #302

jeremythuff opened this issue Aug 4, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@jeremythuff
Copy link
Member

  1. Add the GraalVM JavaScript JAR to your classpath. If you're using Maven, you can add this dependency to your pom.xml:
<dependency>
    <groupId>org.graalvm.js</groupId>
    <artifactId>js</artifactId>
    <version>19.3.1</version>
</dependency>
  1. Configure Camunda to use GraalVM JavaScript. You can do this by setting the javascriptScriptEngine property in your bpm-platform.xml, processes.xml or camunda.cfg.xml:
<property name="javascriptScriptEngine">graal.js</property>

Remember to replace the version number with the version of GraalVM JavaScript that you're using.

Please note that while GraalVM JavaScript is largely compatible with Nashorn, there might be some differences in behavior. You should thoroughly test your scripts after switching to GraalVM JavaScript to make sure they still work as expected.

@jeremythuff jeremythuff added the enhancement New feature or request label Aug 4, 2023
@kaladay
Copy link
Contributor

kaladay commented Oct 2, 2023

Java 21+ has new experimental alternative to this. This is out of scope but would be worth noting when setting the version of GraalVM.

The implementation is intended to be run on numerous languages, however, our priority is Javascript. Test using Ruby and other languages if possible. If it fails in languages other than Javascript, then report this as a regression.

This is the Foreign Function & Memory API. By Java 21+ this is third preview and is probably close to being stable but is also not yet stable.

...the API enables Java programs to call native libraries and process native data without the brittleness and danger of JNI...

see: https://openjdk.org/jeps/442

@kaladay
Copy link
Contributor

kaladay commented Oct 5, 2023

The minimum required Java version is Java 17.

@kaladay
Copy link
Contributor

kaladay commented Oct 18, 2023

This issue should be in mod-camunda and not fw-registry.
The PR for this issue is: TAMULib/mod-camunda#221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: ⛵ Deploying
Development

No branches or pull requests

3 participants