How to create Business Rules & Database Triggers:
- go to the Function Hierarchy Diagramer
- select the container that you wish to create the business rule in, or just create a new sheet
- click on Function icon "small white square on the right top of the screen", then place it in the sheet
- type the lable and short definition of that function.
Note:
in this step you are building your business rules tree, so you may keep the root as a description for your business rules to be grouped under. Ex: for PMS, first we start with the root BR_PMS, and its definition is PMS Business Rules. Then for each system model, we have a group of business rules, like Funds/Portfolios Business Rules, or Securities Business Rules...etc.
- pick again the function icon, and type the label according to the following convention:
· BR_TableShortName001_CEV (change event)
· BR_TableShortName002_TRS (transition event)
· BR_TableShortName003_IER (inter-relation event)
· BR_TableShortName004_ENT (entity event)
· BR_TableShortName005_DEL (delete event)
· BR_TableShortName006_UPD (update event)
· BR_TableShortName007_TPL (topple event, used to verify between columns on the table)
è for more description on those event, please reference the oracle manual.
- double click on the function and assign the Entity Usage.
- assign Attribute Usage
- Save the diagram
- go to the Repository Object Navigator
- under the selected container, go to Process Events
- select the event on which you want to fire the trigger, either on the table or a specific column, usually the STATUS column.
Note:
If you do not find your table there, then do the following:
- go to the http://iai2.iai.org.kw:7778/forms/frmservlet?config=hsd65_utilities
- Productivity Booster --> Analysis --> Maintain Default Events for Entities
- pick your table and run.
- this will generate the needed events for the table.
- under Triggering Functions, right click --> create reference --> select the business rule name that you created in the Function Hierarchy Diagramer, and save
- go to the http://iai2.iai.org.kw:7778/forms/frmservlet?config=hsd65_utilities
- Productivity Boosters --> Business Logic Layer --> Rule Layer
- select the Business Rule Design Transformer
- Select the Business Rule Function that you have created, and run
- from the Server Model, refresh your table triggers and you will find your trigger assigned.
- Edit trigger logic, and then generate table CAPI from the utilities and then table API.
Comments