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.
Related objects
- Smart engine settings : where the engine is configured.
- Where we can use scripts:
- Agents : properties, mappings and triggers
- Custom scripts : all the scripts
- Account naming rules : script to validate and set name
- Role assignment rules : script to validate
- BPM editor : visualization, triggers, transitions
- Password policies : optional script
Table of diffencesdifferences
| Topic | Beanshell | Javascript |
| variable | s = "text"; | var s = "text"; |
| function | public 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" |
| java class |
es.caib.seycon.ng.comu.AccountType |
Java.type("es.caib.seycon.ng.comu.AccountType") |