Server Automation Script Libraries
Use server automation script libraries to organize code on the server and reuse the code in automation scripts by attaching the automation script library to the desired automation scripts.
You can attach multiple automation script libraries to automation scripts but you cannot attach automation script libraries to other automation script libraries.
Libraries allow you to easily maintain the code by modifying it once (within the automation script library). The code updates will be automatically propagated to all the automation scripts that are calling the automation script library.
The typical use case scenarios for server automation script libraries include:
- Executing a specific block of code after an entity business status is changed. To use an automation script library to execute a block of code after a business status is changed, you need to create it first.
- Call the automation script library from a server script using server-side functions.
To see the list of defined server automation script libraries, go to Main Menu > Advanced > Server Automation Script Libraries.
Create Automation Script Libraries
- In FintechOS Studio, go to Main Menu > Advanced > Server Automation Script Libraries.
- Click Insert. The Add Server Automation Script Library page appears.
- In the Name field, enter the name of the library.
- In the Code field, enter the script code (write code using Server SDK functions).
- Click Save and close. The server automation script library is saved and will be displayed in the Server Automation Script Libraries List.
Make sure to include in the code at least a function you wish to call from your server automation scripts.
For example:
var FTOSExample = FTOSExample || (function () {
var count = 100;
this.getCount = function () {
return count;
}
return {
getCount: this.getCount
}
});