Index: openacs-4/packages/workflow/tcl/case-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/case-procs-postgresql.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/workflow/tcl/case-procs-postgresql.xql 28 Aug 2003 09:41:59 -0000 1.4
+++ openacs-4/packages/workflow/tcl/case-procs-postgresql.xql 18 Nov 2003 17:57:57 -0000 1.5
@@ -61,6 +61,39 @@
+
+
+ select a.action_id,
+ extract(seconds from a.timeout) as timeout_seconds
+ from workflow_cases c,
+ workflow_actions a
+ where c.case_id = :case_id
+ and a.workflow_id = c.workflow_id
+ and not exists (select 1
+ from workflow_initial_action wia
+ where wia.workflow_id = c.workflow_id
+ and wia.action_id = a.action_id)
+ and (a.always_enabled_p = 't'
+ or exists (select 1
+ from workflow_case_fsm cfsm,
+ workflow_fsm_action_en_in_st waeis
+ where cfsm.case_id = c.case_id
+ and waeis.state_id = cfsm.current_state
+ and waeis.action_id = a.action_id))
+ order by a.sort_order
+
+
+
+
+
+ select case_id,
+ action_id
+ from workflow_case_enabled_actions
+ where execution_time <= current_timestamp
+ and enabled_state = 'enabled'
+
+
+
select acs_object__name(:object_id) as name
@@ -91,4 +124,25 @@
+
+
+ update workflow_case_enabled_actions
+ set enabled_state = 'completed',
+ executed_date = current_timestamp
+ where case_id = :case_id
+ and action_id = :action_id
+ and enabled_state = 'enabled'
+
+
+
+
+
+ insert into workflow_case_enabled_actions
+ (enabled_action_id, case_id, action_id, enabled_state, execution_time)
+ select :enabled_action_id, :case_id, a.action_id, 'enabled', current_timestamp + a.timeout
+ from workflow_actions a
+ where a.action_id = :action_id
+
+
+