Create a new script
Civic Platform provides master scripts for most of the events. You can use the UniversalMasterScript as a template to create scripts for the remaining events.
Civic Platform requires a separate script per event to:
-
Identify the scripted business logic for a module, application type, and sub-typ1.
-
Create and populate event-specific variables needed for each specific event (for example, wfTask, inspType)
To create custom scripts
-
Set up a script repository, which includes a scripts folder organized by trigger mechanisms such as events, batch, expressions, etc. See The EMSE tool and the script repository for more information.
-
Copy the contents of the UniversalMasterScript file and paste the contents into your script editor.
-
Modify the configurable parameters.
-
Implement your business logic using JavaScript syntax.
-
Save the JavaScript file using the script file naming convention. See Event script file naming
-
Deploy the custom script using the EMSE tool. See The EMSE tool and the script repository.
The master scripts and underlying JavaScript require case sensitivity for function calls or when referring to a variable. For example the function addFee can be called in both the then and else action. If you write the same script control but call the function AddFee, the script returns an error that the function AddFee does not exist. The script considers addFee and AddFee two different function names.
Variables and function names in the master scripts follow the camelCase practice. For example totalSquareFeet, taxiNumber, addFee(), etc. Always be aware of case sensitivity as it many times could be the culprit of causing script errors.