Groovy Library, accessible at Administration > Logics > Groovy Library, is a library of re-usable Groovy functions. Its elements' functions are available in all other logics across the application in the Command Templates > Command Library menu.
For the individual logic elements, you can define a Timeout Override value in seconds. Note that this value is applied only if it is lower than the value defined by the system property formulaEngine.script.maxLibraryTimeoutInSec. This system property defines a maximum possible timeout. It can be changed only by Support.
To preserve backward compatibility, Groovy scripts can still use the lib variable which is exactly the same as using libs.__LIBRARY__.
Example
Create a Groovy library logic named "docLibrary" with a Groovy element called "v1" and put the following content in it:
/**
* Determines if given SKU exists. Sample usage: lib.MyLibrary.skuExists('0000000001')
* @param sku the SKU to be checked
* @return true if the SKU exists
*/
def skuExists(String sku) {
...
return true
}
Then you can call it from any other calculation logic (e.g., a logic for a Price List or Quote) using this code:
def myLibrary = libs.docLibrary.v1
def check = myLibrary.skuExists('0000000002')