Nashhorn and GraalVM workflow difference

var test = "abc";
execution.setVariable("myvar", test);
print(myvar);

The above JavaScript code works fine with the ‘Nashorn’ engine but not with ‘GraalVM’.

I am migration from 7.15 to 7.19 camunda.
Am I missing some GraalVM settings? There are a lot of workflows like this that I want to make work with GraalVM without changing the bpmn files.

I have also added the following configuration:

<property name="enableScriptEngineNashornCompatibility">true</property>

Everything is working fine except for the attached code sample.
test_workflow.bpmn (2.3 KB)

Hi @Shriram_Jadhav
Does it work if you update print(myvar); to print(execution.getVariable("myvar")); ?

Regards,
Alex

1 Like

Yes. It works fine with

print(execution.getVariable("myvar"));

print(myvar) works with nashorn but not sure it is not working with GraalVM.

Am I missing any configurational parameter for script engine?

I do not think you’re missing anything here.
And I’m not an expert on the topic, but that’s what the documentation states:

  • GraalJS tries to be compatible with the ECMAScript specification, as well as competing engines (including Nashorn). In some cases, this is a contradicting requirement; in these cases, ECMAScript is given precedence. Also, there are cases where GraalJS does not exactly replicate Nashorn features intentionally, for example, for security reasons.

So maybe this is the case here.

1 Like

Thank you @Alex_Voloshyn. That might be the case.

Thia seems to be not according to camunda spec
(Scripting | docs.camunda.org) - read on Variables.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.