Rules and Actions
Rules and Actions provide a powerful mechanism to make applications dynamic and a simple way of adding logic. The Rules and Actions section contains both rules and actions, which are typically used to model business logic within an app. Rules are the programmatic conditions that must be met to trigger an action. There are a number of actions available such as sending emails or executing scripts.
For example, in an ordering-system application we want to send an email to the customer when an order has been shipped. We can accomplish that by creating a rule that triggers when an order-record changes status from ‘PENDING’ to ‘SHIPPED’. The rule would be connected to a SendMail action that will send an email to the customer.
Rule Types
Click the +New Rule button to add a new rule, and give it a unique name. A rule must have a triggering condition as follows:
- Data Change
- Schedule
- Webhook
- Message received
- Email received
Data Change
Rules that trigger on data change react to creating, editing or deleting data records. A data change rule triggers before or after the change has been applied. Rules that trigger before the change has been applied can modify or even reject the change.
Description of fields:
-Attribute
-Value
-Parameter
Schedule
Rules that trigger according to schedules can be created. Scheduling can be used to run batch processes or even to send push notifications to users.
Description of fields:
Webhook
Rules that trigger on an incoming REST request are used to perform actions at will or that react to external inputs. They are used to trigger rules directly from a user interface which does not have access to server side data. A REST rule will be triggered any time the platform receives a request on the URL endpoint configured in the rule.
For Example: a rule with the endpoint “myrule” created in an called MyApp would react to requests to the URL: http://apps.appivo.com/api/app/MyApp/service/myrule. These rules can also be triggered by using a script in a user interface and calling context.invokeService with the name of the rule.
Description of fields:
-GET
-POST
-PUT
-DELETE
Message Received
The Developer can set up the rules that trigger when a message arrives on a topic on the application message bus. This can be used to support real time interactivity in application user interfaces or to handle data or commands received from IoT devices.
Description of fields:
Email Received
Developers can configure rules that trigger on incoming email as each application has its own email address. This allows for creating simple types of integrations where users or remote systems can send email to feed data into an application. For multi-tenant scenarios, it’s important to note that an email address is generated for each application-tenant pair.
Description of fields:
Up Next
No Topics.