Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
...
...
Do not use wildcard in import statement. It giving a very bad performance in Bean Shell interpreter to search the whole package and loads it in memory.
Don't:
Code Block | ||
---|---|---|
| ||
import java.util.*; |
Do:
Code Block | ||
---|---|---|
| ||
import java.util.Collection; |
Bean Shell interpreter cannot recognise the element type syntax of collections class like Collection, Map, List, Set and etc.
Don't:
Code Block | ||
---|---|---|
| ||
Map<String, String> map = new HashMap<String, String>(); |
Do:
Code Block | ||
---|---|---|
| ||
Map map = new HashMap(); |
It will make yours and others life easier to maintain and review the script whenever necessary as Joget Workflow provided flexibility to adapt change quickly.
If your script is pretty long and some parts of the script are reusable, please make use of function to write your script. It provided better reading and performance.
It will helps you and others to understand what is the purpose for the script quickly.
If you are using a log of Bean Shell Scripting in your app, a meaningful log message can help you to locate your issue quickly.
Don't
Code Block |
---|
try {
//do something
} catch (Exception e) {
LogUtil.error("BeanShell", e, "Error executing script");
} |
Do:
Code Block | ||
---|---|---|
| ||
try {
//do something
} catch (Exception e) {
LogUtil.error("CRM app - Backend userview", e, "Error retrieving user department in Report category permission");
} |