Custom Logic
An extremely powerful and useful component of many applications is custom logic written to support extended functionality. Logic is often used to provide additional manipulation and analysis of data or to add custom components to an interface.
While custom logic is very powerful, it needs to be written (programmed). Logic can be coded manually, or developed via services by Visual Action. Below is some general information about custom logic in the Platform:
-
Logic functions and files are written in either Python or JavaScript (JS). With the appropriate technical expertise and programmatic connections, other languages may be used, but ultimately, the functions called within Platform applications must be written in proper JavaScript. This section will focus only on JS logic, since it is most applicable to the frontend features of applications.
-
There is a single, globally accessible variable where all Logic Layer functions are stored. The variable is simply named Logic.
- Logic is a JavaScript object, with several properties that are also JavaScript objects. Each of these objects is a category for a specific type of logic functions.
- While Logic is globally accessible (and thus, can be overwritten), it is best not to overwrite it. The Platform expects to access Logic and its default properties, and modifying them may result in performance errors. Similarly, it is advised that the default properties of Logic not be overwritten, but only added to.
- New properties may be added to the Logic variable. The Platform, however, provides no user interface for accessing custom properties of Logic. Only functions defined within the default properties of Logic are accessible via the user interface.
-
Logic functions have different parameter and return value requirements, depending on which type of logic function they are.
The following sections detail the technical parameters and processes for developing and including common types of custom logic in the Logic Layer of the Visual Action Platform.