ERP 2.50:Developers Guide/Concepts/AD/Alerts
Contents |
Introduction
Alerts are the way Openbravo ERP informs users about virtually any event that happens in the system. The System Administrator defines when an alert should be prompted. This notifications are shown in the Menu, just below to the user role settings.
Alert Rules
The definition of the Alert Rules is made in the Alert window (General Setup || Application || Alert). There are two types of Alert Rules: Data Driven or External
Data Driven
With this type of Alert Rules the System Administrator can define a query to test a particular scenario, e.g. Products without defined price, Products under stock, Customers with exceeded credit, etc.
The flow for data driven alerts is as follows:
- The System Administrator creates alert rules, which include a SQL clause defining the event that is going to be monitored and the recipients for the alerts.
- A background process is permanently checking if the condition defined in each of the active alert rules return any record, in this case a new alert instance will be created for each one of the returned record.
- When a user logs in the application there is another process that constantly checks whether there are alert instances for this user and shows them.
Definition
- SQL: Example of 'Products without defined price' rule
SELECT m_product_id AS referencekey_id, p.name AS record_id, 0 AS ad_role_id, NULL AS ad_user_id, p.name ||' is not in any Purchase price list' AS description, 'Y' AS isActive, ad_org_id, ad_client_id, now() AS created, 0 AS createdBy, now() AS updated, 0 AS updatedBy FROM m_product p WHERE p.ispurchased='Y' AND NOT EXISTS (SELECT 1 FROM m_productprice pp, m_pricelist_version pv, m_pricelist pl WHERE p.m_product_id = pp.m_product_id AND pv.m_pricelist_version_id = pv.m_pricelist_version_id AND pv.m_pricelist_id = pl.m_pricelist_id AND issopricelist='N') union SELECT m_product_id AS referencekey_id, p.name AS record_id, 0 AS ad_role_id, NULL AS ad_user_id, p.name ||' is not in any Sales price list' AS description, 'Y' AS isActive, ad_org_id, ad_client_id, now() AS created, 0 AS createdBy, now() AS updated, 0 AS updatedBy FROM m_product p WHERE p.ispurchased='N' AND NOT EXISTS (SELECT 1 FROM m_productprice pp, m_pricelist_version pv, m_pricelist pl WHERE p.m_product_id = pp.m_product_id AND pv.m_pricelist_version_id = pv.m_pricelist_version_id AND pv.m_pricelist_id = pl.m_pricelist_id AND issopricelist='Y')
- The SQL query must have the following columns:
- referencekey_id
- record_id
- ad_role_id
- ad_user_id
- description
- isactive
- ad_org_id
- ad_client_id
- created
- createdby
- updated
- updatedby
- Tab: The Alert management window you can navigate directly to a record. In the Tab you define to which tab you'll navigate to.
External
The creation of a new external alert instance is not handled by Openbravo. The background process only checks if a new instance was created and notifies the recipients. An example of this type is 'Updates Available'. The Heartbeat process creates new alert instance when it receives updates from the data collection server.
Alert Recipient
The Alert Recipient tab handles the alert recipients management. You can define the Role whom will be notified, or an specific user. Also you can define if the user(s) should be notified by email.
Languages: |
ERP 2.50:Developers Guide/Concepts/AD/Menu | ERP 2.50:Developers Guide/Concepts/AD/Commons