In this Part-3 of Beginner’s guide to Outsystems that enables Digital Transformation to Businesses with enterprise-grade applications.? We are going to cover the LOGIC tab functionalities.
The logic tab in Outsystems provides developers with a centralized environment for designing and implementing the core logic of the applications, enabling them to build robust and scalable solutions with minimal manual coding.
By right clicking the client actions you can add client action as shown in the above images.
Client action represents the logic executed on the client-side in the user’s browser or device and can be triggered by user interactions or events.
Features of Client actions.
- Client actions promote code reusability, developers can easily reuse them in different screens, modules, or applications.
- When a client action set “Yes” to function in the property tab, we can reuse that logic which will be seen in User function folder (refer to the image below). Client action can have more than one output parameter but when function is set to “Yes” only one output is allowed.
- Error handling and Validations can be executed as client actions are often used to respond to user interactions or events such as button clicks, form submissions, or input field changes.
- Client actions can interact with browser storage mechanisms such as local storage or session storage to store and retrieve data on the client-side. This enables features like caching data, storing user preferences, or implementing offline functionality in mobile applications.
By right clicking the server actions you can add server action same as the client action.
Server actions enables developers to implement backend functionality, enforce business rules, integrate with external systems, and ensure the security and reliability of their applications. Actions are executed on the server side, primarily used for implementing business logic, data manipulation, integrations with external systems.
- Server actions operations includes data validation, calculations, decision-making processes, and other business logics.
- Server actions interacts with databases, external Apis, and other data sources to retrieve, manipulate, and persist data, perform CRUD operations (Create, Read, Update, Delete) on database records, execute SQL queries and process data as needed.
- Server actions promote code reusability, developers can easily reuse them in different screens, modules, or applications.
- Server actions enforces security measures within an application. They can handle user authentication, authorization, and access control, ensuring that sensitive data and functionality are protected from unauthorized access.
- Error handling is included to manage exceptions, developers can define error handling logic to handle errors, display meaningful error messages to users, and log information for debugging purposes.
- Server actions can communicate between frontend and backend layers of an application as server actions are called from client-side components, such as screens, widgets, or mobile interfaces.
?Integrations folder in the logic tab of Service studio is where developers manage integrations with external systems, such as databases, web services, REST APIs, and other third-party services.
- Database connections used by Outsystems applications can be managed in the integrations folder such as database connections, configuring data source settings, and database entities management.
- Integrate with SOAP and Restful web services. Rest APIs can be created and managed, defining API endpoints, JSON or XML, configuring authentication methods such as API keys or OAuth tokens and handling error responses.
- For integrations authentication mechanism is required to ensure secure communication between systems using token-based authentication, SSL certificates, credential management and other security measures.
- Error handling can be defined to handle exceptions and log error messages for troubleshooting to provide feedback to users when integration failures occur.
- Tools are available to monitor the integration usages to optimize data transfer processes to ensure performance.
In the Roles folder developers able to manage user roles and access permissions within the applications based on the user’s role. It helps track who has access to sensitive data and functionality within the application.
- Roles can be defined to represent different levels of access and permissions such as “Administrator”, “Manager” and can create more roles with three actions “Check”, “Grant”, “Revoke”. Anonymous and Registered roles are pre-built with “CHECK” action.
- Roles can be assigned to users or groups of users. Developers can also implement role assignment logic in the application.
- Roles can be assigned or revoked based on various criteria, such as user attributes, group memberships, or business rules.
This exception folder is where you can find and manage exception handlers within your Outsystems application.
- Exception handlers in the exception folder are reusable units of logic that handle specific type of exceptions within the application. Exception handlers manages and handles the exceptions that occur during the execution of the application.
- Custom exceptions logic can be defined in the user exception within the exception handlers.
- Outsystems provides built-in logging and monitoring features that allow you to track and analyze exceptions and errors that occur within the application.
- There are four built in exceptions Database, Security, Communication and Abort activity change exceptions and in the User exception custom exceptions can be added.