Index: openacs-4/packages/workflow/sql/oracle/workflow-tables-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/sql/oracle/workflow-tables-create.sql,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/workflow/sql/oracle/workflow-tables-create.sql	13 Nov 2003 14:22:03 -0000	1.7
+++ openacs-4/packages/workflow/sql/oracle/workflow-tables-create.sql	18 Nov 2003 17:57:56 -0000	1.8
@@ -158,7 +158,11 @@
                           on delete set null,
   always_enabled_p        char(1) default 'f'
                           constraint wf_acns_enabled_p_ck
-                          check (always_enabled_p in ('t','f'))
+                          check (always_enabled_p in ('t','f')),
+ -- When the action to automatically fire.
+ -- A value of 0 means immediately, null means never.
+ -- Other values mean x amount of time after having become enabled
+ timeout_seconds          integer
 );
 
 create sequence workflow_actions_seq;
@@ -383,6 +387,38 @@
   primary key (case_id, role_id, party_id)
 );
 
+create sequence workflow_case_enbl_act_seq;
+
+create table workflow_case_enabled_actions(
+  enabled_action_id       integer
+                          constraint wf_case_enbl_act_case_id_pk
+                          primary key,
+  case_id                 integer
+                          constraint wf_case_enbl_act_case_id_nn
+                          not null
+                          constraint wf_case_enbl_act_case_id_fk
+                          references workflow_cases(case_id)
+                          on delete cascade,
+  action_id               integer
+                          constraint wf_case_enbl_act_action_id_nn
+                          not null
+                          constraint wf_case_enbl_act_action_id_fk
+                          references workflow_actions(action_id)
+                          on delete cascade,
+  enabled_date            date
+                          default sysdate,
+  executed_date           date,
+  enabled_state           char(40)
+                          constraint wf_case_enbl_act_state_ck
+                          check (enabled_state in ('enabled','completed','canceled','refused')),
+  -- the timestamp when this action will fire
+  execution_time          date
+);
+
+create index wf_case_enbl_act_case_idx on workflow_case_enabled_actions(case_id);
+create index wf_case_enbl_act_action_idx on workflow_case_enabled_actions(action_id);
+create index wf_case_enbl_act_state_idx on workflow_case_enabled_actions(enabled_state);
+
 ---------------------------------
 -- Deputies
 ---------------------------------
@@ -492,6 +528,10 @@
                           on delete cascade
 );
 
+create index workflow_case_log_action_id on workflow_case_log (action_id);
+create index workflow_case_log_case_id on workflow_case_log (case_id);
+
+
 create table workflow_case_log_data (
   entry_id                integer 
 			  constraint wf_case_log_data_eid_nn
