We make extensive use of javascript in our bpmn models. Upon upgrading from Camunda 7.22.0 to 7.23.0, a service task with existing javascript now fails. We are using the docker version of the Tomcat distribution. In our bpm-platform.xml file we have been using the compatibility mode with the previous javascript engine with:
<property name="enableScriptEngineNashornCompatibility">true</property>
The error from the Catalina log that we are now getting is:
org.camunda.bpm.engine.ScriptEvaluationException: Unable to evaluate script while executing activity 'ce609242_0f8d_4985_8594_740e9a5347b6_assignPermissions' in the process definition with id 'd52c4928-358f-11f0-9a75-c62da50a19d9':org.graalvm.polyglot.PolyglotException: TypeError: deduped.findIndex is not a function
The javascript in question is in a Rest Connector service task, in the payload specification for the Input Parameters. The portion of the script that causes the error is:
const dedupedAssignees = modifiedAssignees.reduce((deduped, current) => {
const existingIndex = deduped.findIndex(item => item.assignee === current.assignee);
...
return deduped;
}, []);
The variable deduped is clearly an array so the function findIndex should not be undefined.
We have found that if we remove the Nashorn compatibility setting from the bpm-platform.xml file that the problem is gone. However, this is not a viable option because we have extensive javascripting that relies on this setting.
So for us, this upgrade to v7.23.0 is a breaking change. Do you have any idea what the cause of the error could be and how this can be resolved?