Business Data Scripting Best Practice
This section contains some suggestions for Business Data scripting.
Keep the Scripts Small
It is recommended that you keep scripts small. You can do this by breaking potentially large chunks of logic into separate scripts.
Ensure Business Objects Are Valid Before Scripts Complete
Remember that the length, limits, and multiplicity are checked at the end of every script, so ensure that all the Out and In / Out fields for the task have valid values before the script task is completed.
Check for Nulls
It is very important to check that fields and attributes are not null before attempting to get their values.
Use Comments in Scripts
It is good practice to comment code to make it easier for others who follow you to understand what the scripts are doing.
Use Constant First when Comparing a Constant with a Variable
Using:
constant == variable
is safer than:
variable == constant
If "=" is used instead of "==" by mistake, the former construction results in a syntax error.