Expression Builder
The Expression Builder in OwlGen offers a precise method for defining logic and performing calculations using a text-based syntax. It grants users greater control over the structure of expressions, including operators, functions, and variables employed. This level of detail empowers advanced users and developers to implement intricate business rules or algorithms that may not be easily achievable through a visual interface.
Expressions can be created in two ways, either by double-clicking the items from the explorer or by manual typing. The expression builder provides helpful features such as syntax checking and data type validation for user-defined expressions. These capabilities enhance productivity and assist users in identifying and resolving errors or issues in the expressions.
Furthermore, the expression binder supports complex multi-line assignments and conditional expressions, allowing for the implementation of sophisticated logic flows.
The following categories allows the user to organize the different elements and functionalities available within the Expression Builder, making it easier to find and use the appropriate functions, variables, and activities in expressions.
- System Functions: Contains a set of predefined functions provided by the system. These functions perform various operations and calculations, such as manipulating strings, converting data types, handling dates and times, and performing mathematical operations. For example, use the "STRING_LENGTH" function to calculate the length of a leave request comment. To view the list of system functions, click here.
- Security Context: Contains functions and variables related to security and authentication. It provides access to information about the current user, roles, permissions, and other security-related properties. Access the current user's ID using the "CURRENT_USER_ID" variable. To view the list of functions, click here.
- Input Params: Contains the parameters that are passed as input to the current logic flow or action. These parameters can be used within expressions to access and manipulate the input data. Retrieve the leave start date from the input parameter named "startDate".
- Output Params: Contains the parameters that are passed as output from the current logic flow or action. These parameters can be used within expressions to store and manipulate the output data. Set the approval status in the output parameter "approvalStatus" based on the leave request result.
- Variables: User-defined variables that are declared and used within the current logic flow or action. Variables can store and manipulate data throughout the execution of the logic flow. Store the total number of available leave days in the variable "availableLeaveDays".
- API Activities: Represents the eventual completion (or failure) of an asynchronous operation and the resulting value. It is a way to handle tasks that may take some time to finish, such as fetching data from a server, or making an API call. Make a POST request to the "LeaveRequestAPI" to submit a new leave request.
- Workflow Activities: Represents the eventual completion (or failure) of an asynchronous operation and the resulting value. It is a way to handle tasks that may take some time to finish, such as calling another workflow or activity. Start the "LeaveApprovalWorkflow" when a leave request is submitted.
- SQL Activities: Contains functions and variables related to SQL activities. It provides access to information and properties for executing SQL queries and interacting with databases. Execute an SQL query to retrieve all leave requests from the "LeaveRequest" table.
- ServerFlow Activities: Represents the eventual completion (or failure) of an asynchronous operation and the resulting value. It is a way to handle tasks that may take some time to finish, such as fetching data from another server flow. Invoke the "UpdateLeaveBalanceFlow" to update the employee's leave balance.
- Constants: Contains predefined constants that can be used in expressions. Constants are fixed values that do not change during the execution of the logic flow. Use the constant "MAX_LEAVE_DAYS" to set a maximum limit for leave duration validation.
All the activities that are in the scope of current logic flow will be displayed in the expression builder. Activities that are called asynchornously needs to be awaited to read the response (response=await <ActivityName>). Activities called in sequential mode doesn't needs to be explicity awaited. System will generate the required await.