Skip to main content

Beanshell vs Javascript

Introduction

Soffid 4 configures the smart engine with the JavaScript engine by default.

Previously, the default engine was Beanshell, and many scripts will need to be adapted.

This page lists these differences.

  • Smart engine settings :  where the engine is configured.
  • Where we can use scripts:
    • Agents
    • Custom scripts
    • Account naming rules
    • Role assignment rules
    • BPM editor
    • Password policies

Table of diffences

TopicBeanshellJavascript
variables = "text";var s = "text";
functionpublic void doSomething(String system) {
  ...
}
doSomething("APP_USERS");
function doSomething(system) {
  ...
}
doSomething("APP_USERS");
for

for (user : listOfUsers) {

  ...

}

for (var i=0; i<listOgUsers.size(); i++) {
  ...
equals

user == null

user === null
equals

userName.equals("myName")

userName === "myName"