5. How to work with rules

Business logic in Workmaster apps is seamlessly integrated through the Rule Panel, which is both powerful and easy to understand. Rules in Workmaster are triggered by various events, such as user actions (button clicks, mouse movements), or lifecycle events (page loading, unloading). Additionally, rules can also be triggered by bot commands, which we will explore in the Training Chatbots Module.

This module serves as a guide to help you understand and work with rules in Workmaster. Below is an overview of how to set up rules, the different components of a rule, and how to test and debug them. For detailed instructions, please refer to the respective sections in the User Manual.

1. Understanding the Components of a Rule

A rule consists of three main components:

  • Event: The trigger that starts the rule (e.g., page load, button click).

  • Condition: An optional check to determine whether the action should be executed (e.g., if a field is not empty).

  • Action: The result or operation that occurs when the event and condition are met (e.g., show a message, update data).

For a detailed explanation of individual Events, Conditions, and Actions and how they work, refer to the pages under Events, Conditions, and Actions section in the User Manual.

2. Setting Up Rules

You can set up rules to handle common page events like page load, user interactions (e.g., mouse clicks), and other triggers. Additionally, rules can be customized to execute multiple actions with conditions, including logical operators like AND, OR, and NOT.

For step-by-step instructions on how to set up a rule, refer to the Setting Up Rules section in the User Manual.

3. Using Formulas in Rules

An essential feature in Workmaster is the ability to use formulas within rules. These formulas, similar to those in a spreadsheet, can perform calculations on numbers or text. Formulas use numbers, literal text, operators (e.g., +, -, *, /), and built-in functions.

For an overview of how to work with formulas, including building blocks and operators, refer to the Formula Editor section in the User Manual. You will also learn how to use the Formula Editor to assemble formulas and test them step-by-step.

4. Testing and Debugging Rules

Debugging rules is a crucial step to ensure they perform as expected. In Workmaster, you can pause rule execution using the Visual Rule Panel, enabling you to step through each action and condition, and check the results in the Property Editor at every step. This allows you to identify any issues early and fine-tune your logic.

To learn how to use the debugger and monitor the formula evaluation process, refer to the Debugging page in the User Manual.

To reinforce your understanding of working with rules in Workmaster, we highly encourage you to complete Exercise 5: Creating Page Navigation with Forward and Back Buttons.

Last updated