Event manager
An integral part of the Civic Platform is the Event Manager. The event manager:
-
Sets the global event variables
-
Sets the event specific variables
-
Executes the script associated with the event, usually an Accela developed master script.
While any script in the Civic Platform can be associated with a specific event, the Accela developed master scripts are designed to load a set of libraries of script functions and variables and then execute the custom business scripts and configurable standard scripts which match the event and the record type (where applicable).
Three global event variables are set when the event executes:
|
Global variable |
Description |
Sample code |
|---|---|---|
|
EventName |
The name of the event executing. |
aa.env.getValue("EventName");
|
|
ScriptName |
The name of the script executed by the event. |
aa.env.getValue("ScriptName");
|
|
CurrentUserID |
The user ID of the login executing the event. |
aa.env.getValue("CurrentUserID");
|
The variables set for each event are different since they reflect the data available and/or needed for the event.
Example: In the PaymentReceiveAfter event, the event manager sets the following environmental variables:
|
Event specific variable |
Description |
Sample code |
|---|---|---|
|
CurrentUserID |
The user ID of the login executing the event. |
aa.env.getValue("CurrentUserID");
|
|
FeeItemsList |
The list of fee items for the record. |
aa.env.getValue("FeeItemsList");
|
|
FeeItemsOffsetList |
aa.env.getValue("FeeItemsOffsetList");
|
|
|
FeeItemsPaidList |
The list of fee items paid with this payment. |
aa.env.getValue("FeeItemsPaidList");
|
|
FeePeriod |
The fee period for assessing the fees. |
aa.env.getValue("FeePeriod");
|
|
NumberOfFeeItems |
The number of fee items in the payment transaction. |
aa.env.getValue("NumberOfFeeItems");
|
|
PaymentCashierId |
The user ID of the person taking the payment. |
aa.env.getValue("PaymentCashierId");
|
|
PaymentComment |
Any comment made on the payment. |
aa.env.getValue("PaymentComment");
|
|
PaymentDate |
The date of the payment. |
aa.env.getValue("PaymentDate");
|
|
PaymentMethod |
The method of the payment. |
aa.env.getValue("PaymentMethod");
|
|
PaymentRegisterId |
The identifier for the register. |
aa.env.getValue("PaymentRegisterId");
|
|
PaymentTotalAvailableAmount |
The total amount available for the payment. |
aa.env.getValue("PaymentTotalAvailableAmount");
|
|
PaymentTotalPaidAmount |
The total amount paid for this payment. |
aa.env.getValue("PaymentTotalPaidAmount");
|
|
PermitId1 |
The first internal identifier for the record. |
aa.env.getValue("PermitId1");
|
|
PermitId2 |
The second internal identifier for the record. |
aa.env.getValue("PermitId2");
|
|
PermitId3 |
The third internal identifier for the record. |
aa.env.getValue("PermitId3");
|
However, in the DocumentDeleteBefore event, the event specific variables are different even though the global event variables are the same:
|
Event specific variable |
Description |
Sample code |
|---|---|---|
|
DocumentIDList |
The list of document IDs to be deleted. |
aa.env.getValue("DocumentIDList");
|
|
ServProvCode |
The agency service provider code. |
aa.env.getValue("ServProvCode");
|
The Accela Civic Platform uses a built-in JavaScript engine called “Rhino”. Rhino is an open source JavaScript engine originally started at Netscape, and early internet company, and then later released to the Mozilla Foundation.
Scripts which are called frequently (which includes the Accela libraries of functions) are usually ‘in memory’ which means they are used enough they are rarely offloaded from memory.
While each event master script is usually distinct from other scripts, they all follow the same basic pattern:
-
The event manager executes the master script associated with the event
-
The event master script loads the master script function library, the global scripts, and the INCLUDES_CUSTOM script library
-
The event master script uses the event specific variables to set variables in scope for the event
-
The event master script executes the standard choice scripts
-
The event master script executes the custom business rules scripts
-
The event master script executes the configurable standard scripts engine
