Modordinvpost/Technical Specifications
Contents |
Introduction
The development of this functionality consists on creating an extension point handler that depending on the extension point that has been launched it executes several procedures. The development includes:
- Creating an extension point handler.
- Creating a window to define the extension points and the procedures that executes each one.
- Creating 2 extension points.
Extension Point handler
A generic extension point handler procedure is needed, AD_EXTENSION_POINT_HANDLER. Based on the given AD_Extension_Points_ID it will execute all the procedures associated to it. The procedures that are launched can only have a parameter, AD_EP_Instance_ID, used to retrieve the parameters stored in the AD_EP_Instance_Para table. The available parameters depend on each extension point.
As it is needed to launch a dynamic query to execute the procedures it is needed to differentiate the case of Oracle and PostgreSQL (CALL procedurename(ad_ep_instance_id) for Oracle and SELECT procedurename(ad_ep_instance_id) FROM DUAL for Postgresql). To do that it has to be added in the postscript of each database a AD_GET_RDBMS() function that returns ORACLE or POSTGRESQL.
Parameter Handling
The parameters available in each Extension Point are stored in the AD_EP_Instance_Para table. This table is populated before the Extension Point Handler is called and deleted afterwards. Each set of parameters is identified by the AD_EP_Instance_ID that it is generated each time that is called the handler and the AD_Extension_Points_ID. The parameters can be of different types, so different columns have to be created to support strings, numbers, dates, long texts and ranges.
Configuration window
The window, Extension Point, has 2 tabs.
The main tab, Extension Points, is the definition of the Extension Points. The table behind it is the AD_Extension_Points. It is defined the name, description and the module it belongs to. The 2 extension points defined within this project will belong to core.
The child tab, Procedures is where are defined the procedures that have to be executed in the Extension Point. The table behind it is the AD_EP_Procedures. In this tab is defined the procedure name and the module owner of the procedure.
Available Extension points
Within this project 2 extension points are included.
"C_Order_Post - Finish Process" extension point
- Parameters:
- Record_ID (p_String column of AD_EP_Instance_Para). c_order_id of the order that is being processed.
- DocAction (p_String). Action performed during the order process.
- User (p_String). AD_User_Id who has launched the process.
- Message (p_Text). Variable to set a message if needed.
- Result (p_Number). Integer to set the result of the process (1 success, 0 error, 2 warning)
Message and Result have to be retrieved after the procedures have been launched as they might be changed by those procedures to set warnings and messages to the user.
"C_Invoice_Post - Finish Process" extension point
- Parameters:
- Record_ID (p_String column of AD_EP_Instance_Para). c_invoice_id of the invoice that is being processed.
- DocAction (p_String). Action performed during the order process.
- User (p_String). AD_User_Id who has launched the process.
- Message (p_Text). Variable to set a message if needed.
- Result (p_Number). Integer to set the result of the process (1 success, 0 error, 2 warning)
Message and Result have to be retrieved after the procedures have been launched as they might be changed by those procedures to set warnings and messages to the user.