Add js external libs to embedded Camunda with Graalvm js-engine

476 Views Asked by At

I'm trying to implement some complex business validation logic via JS in DMN using java embedded camunda with spring boot. To avoid usage of deprecated Nashorn and add ES6 support, I've added to project graal js engine. It seems it works pretty well, but I have no idea how to add custom functions into context of js-script engine. Let's say I have index.js in my resource folder with exported functions, how can I register such extension to be able to use it into camunda?

1

There are 1 best solutions below

0
On

Graal.js already works to a certain extent, but official support for it is only added in 7.16. Please see: https://jira.camunda.com/browse/CAM-13516 Specifically the point of allowing to load external scripts by default is in discussion there. You may explain your use case in a comment on the ticket.