View source | Discuss this page | Page history | Printable version   

ERP 2.50:Developers Guide/Concepts/AD/Alerts

ERP 2.50:Developers Guide

Index


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.

Ad-alert1.png

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:

Definition

 
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')

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.



ERP 2.50:Developers Guide/Concepts/AD/Menu | ERP 2.50:Developers Guide/Concepts/AD/Commons 

Retrieved from "http://wiki.openbravo.com/wiki/ERP_2.50:Developers_Guide/Concepts/AD/Alerts"

This page has been accessed 6,309 times. This page was last modified on 14 June 2011, at 11:03. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.