When creating a solution, the user has an option to add custom SQL rules to be triggered after certain events. The rules will act on the environment(s) the solution is connected to

EventDescription
Before create environmentExecute the moment after saving new solution/environment
After create environmentExecutes Last after creating new environment
Before deploymentExecutes the moment user hits Execute SQL
After deploymentExecutes Last after executing SQL
Before delete environment???????

Simple Example

This example covers creating a table and insert data for solution events

  1. Login to AppBase
  2. Go to System Setup and create a new solution  (or edit an existing one)
  3. click on the Events tab 
  4. Fill in the events with following SQL rules 

    EventRule
    Before create environment
    CREATE TABLE LOG
      ( 
         Id NUMBER,
         time_of_creation timestamp,
         event varchar2(255)
      );
    After create environment
    INSERT INTO log (id, time_of_creation, event) VALUES (1, sysdate, 'After Create Environment');
    Before deployment
    INSERT INTO log (id, time_of_creation, event) VALUES (3, sysdate, 'Before Deployment');
    After deployment
    INSERT INTO log (id, time_of_creation, event) VALUES (3, sysdate, 'After Deployment');
    Before delete environment
    INSERT INTO log (id, time_of_creation, event) VALUES (4, sysdate, 'Before Deleting');
  5. When saving the solution (or the environment), AppBase creates the table Log and then inserts data into it.
     
  6. When building the Solution, after pressing Execute SQL, AppBase executes the next two events (Before Deployment,then After Deployment)
  7. Similarly for the other events