Index: openacs-4/packages/workflow/tcl/action-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/action-procs-oracle.xql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/workflow/tcl/action-procs-oracle.xql 23 Jan 2004 11:02:27 -0000 1.8 +++ openacs-4/packages/workflow/tcl/action-procs-oracle.xql 5 Feb 2004 10:37:33 -0000 1.9 @@ -47,7 +47,6 @@ from workflow_actions a, workflow_fsm_actions fa where a.workflow_id = :workflow_id - and fa.action_id = a.action_id and a.action_id = fa.action_id (+) order by a.sort_order Index: openacs-4/packages/workflow/tcl/case-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/case-procs-oracle.xql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/workflow/tcl/case-procs-oracle.xql 23 Jan 2004 11:02:27 -0000 1.8 +++ openacs-4/packages/workflow/tcl/case-procs-oracle.xql 5 Feb 2004 10:37:33 -0000 1.9 @@ -5,70 +5,41 @@ select c.case_id, - c.top_case_id, c.workflow_id, - top.object_id, + c.object_id, s.state_id, s.short_name as state_short_name, s.pretty_name as pretty_state, s.hide_fields as state_hide_fields from workflow_cases c, - workflow_cases top, workflow_case_fsm cfsm, workflow_fsm_states s where c.case_id = :case_id and cfsm.case_id = c.case_id - and top.case_id = c.top_case_id - and s.state_id (+) = cfsm.current_state + and cfsm.current_state = s.state_id (+) + and cfsm.parent_enabled_action_id = :parent_enabled_action_id - - TODO: Oracle - select c.case_id, - c.workflow_id, - c.object_id, - s.state_id, - s.short_name as state_short_name, - s.pretty_name as pretty_state, - s.hide_fields as state_hide_fields - from workflow_cases c, - workflow_case_fsm cfsm left outer join - workflow_fsm_states s on (s.state_id = cfsm.current_state) - where c.case_id = :case_id - and cfsm.case_id = c.case_id - and cfsm.parent_action_id is null + select c.case_id, + c.workflow_id, + c.object_id, + s.state_id, + s.short_name as state_short_name, + s.pretty_name as pretty_state, + s.hide_fields as state_hide_fields + from workflow_cases c, + workflow_case_fsm cfsm, + workflow_fsm_states s + where c.case_id = :case_id + and cfsm.case_id = c.case_id + and cfsm.current_state = s.state_id (+) + and cfsm.parent_enabled_action_id is null - - - select enabled_action_id - from workflow_case_enabled_actions - where execution_time <= sysdate - and completed_p = 'f' - - - - - - - TODO: PORT to Oracle - - select cfsm.parent_action_id, - a.short_name as parent_action, - cfsm.current_state as current_state_id, - s.short_name as current_state - from workflow_case_fsm cfsm left outer join - workflow_actions a on (a.action_id = cfsm.parent_action_id), - workflow_states s, - where cfsm.case_id = :case_id - and s.state_id = cfsm.current_state - - - select m.party_id, @@ -117,7 +88,21 @@ + + + select enabled_action_id + from workflow_case_enabled_actions + where execution_time <= sysdate + and completed_p = 'f' + + + + + select acs_object.name(:object_id) as name from dual + + + select distinct acs_object.name(p.party_id) || ' (' || p.email || ')' as label, p.party_id @@ -136,31 +121,6 @@ - - - select a.action_id - from workflow_cases c, - workflow_actions a - where c.case_id = :case_id - and a.workflow_id = c.workflow_id - and a.trigger_type != 'init' - 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 acs_object.name(:object_id) as name from dual - - - begin @@ -169,17 +129,6 @@ - - - update workflow_case_enabled_actions - set enabled_state = 'completed', - executed_date = sysdate - where case_id = :case_id - and action_id = :action_id - and enabled_state = 'enabled' - - - insert into workflow_case_enabled_actions @@ -202,15 +151,34 @@ - TODO PORT - - select 1 - from workflow_case_enabled_actions ean - where ean.action_id = :action_id - and ean.case_id = :case_id - and completed_p = 'f' - limit 1 + select q.* + from (select 1 + from workflow_case_enabled_actions ean + where ean.action_id = :action_id + and ean.case_id = :case_id + and completed_p = 'f' + ) q + where rownum = 1 + + + select enabled_action_id, + case_id, + action_id, + assigned_p, + completed_p, + parent_enabled_action_id, + to_char(execution_time, 'YYYY-MM-DD HH24:MI:SS') as execution_time_ansi, + nvl((select a2.trigger_type + from workflow_case_enabled_actions e2, + workflow_actions a2 + where e2.enabled_action_id = e.parent_enabled_action_id + and a2.action_id = e2.action_id), 'workflow') as parent_trigger_type + from workflow_case_enabled_actions e + where enabled_action_id = :enabled_action_id + + + 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.7 -r1.8 --- openacs-4/packages/workflow/tcl/case-procs-postgresql.xql 23 Jan 2004 11:02:27 -0000 1.7 +++ openacs-4/packages/workflow/tcl/case-procs-postgresql.xql 5 Feb 2004 10:37:33 -0000 1.8 @@ -38,15 +38,6 @@ - - - select cfsm.parent_enabled_action_id, - cfsm.current_state as current_state_id - from workflow_case_fsm cfsm - where cfsm.case_id = :case_id - - - select m.party_id, @@ -159,4 +150,23 @@ + + + select enabled_action_id, + case_id, + action_id, + assigned_p, + completed_p, + parent_enabled_action_id, + to_char(execution_time, 'YYYY-MM-DD HH24:MI:SS') as execution_time_ansi, + coalesce((select a2.trigger_type + from workflow_case_enabled_actions e2, + workflow_actions a2 + where e2.enabled_action_id = e.parent_enabled_action_id + and a2.action_id = e2.action_id), 'workflow') as parent_trigger_type + from workflow_case_enabled_actions e + where enabled_action_id = :enabled_action_id + + + Index: openacs-4/packages/workflow/tcl/case-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/case-procs.tcl,v diff -u -r1.28 -r1.29 --- openacs-4/packages/workflow/tcl/case-procs.tcl 30 Jan 2004 09:46:05 -0000 1.28 +++ openacs-4/packages/workflow/tcl/case-procs.tcl 5 Feb 2004 10:37:33 -0000 1.29 @@ -853,22 +853,7 @@ # Select the info into the upvar'ed Tcl Array upvar $array row - db_1row select_enabled_action { - select enabled_action_id, - case_id, - action_id, - assigned_p, - completed_p, - parent_enabled_action_id, - to_char(execution_time, 'YYYY-MM-DD HH24:MI:SS') as execution_time_ansi, - coalesce((select a2.trigger_type - from workflow_case_enabled_actions e2, - workflow_actions a2 - where e2.enabled_action_id = e.parent_enabled_action_id - and a2.action_id = e2.action_id), 'workflow') as parent_trigger_type - from workflow_case_enabled_actions e - where enabled_action_id = :enabled_action_id - } -column_array row + db_1row select_enabled_action {} -column_array row } ad_proc -public workflow::case::enabled_action_get_element { Index: openacs-4/packages/workflow/tcl/case-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/case-procs.xql,v diff -u -r1.13 -r1.14 --- openacs-4/packages/workflow/tcl/case-procs.xql 28 Jan 2004 09:39:34 -0000 1.13 +++ openacs-4/packages/workflow/tcl/case-procs.xql 5 Feb 2004 10:37:33 -0000 1.14 @@ -252,4 +252,13 @@ + + + select cfsm.parent_enabled_action_id, + cfsm.current_state as current_state_id + from workflow_case_fsm cfsm + where cfsm.case_id = :case_id + + + Index: openacs-4/packages/workflow/tcl/workflow-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/workflow-procs-oracle.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/workflow/tcl/workflow-procs-oracle.xql 23 Jan 2004 11:02:27 -0000 1.6 +++ openacs-4/packages/workflow/tcl/workflow-procs-oracle.xql 5 Feb 2004 10:37:33 -0000 1.7 @@ -14,15 +14,12 @@ w.description_mime_type, a.short_name as initial_action, a.action_id as initial_action_id - - TODO: Changed, see PG version - from workflows w, - workflow_initial_action wia, workflow_actions a where w.workflow_id = :workflow_id - and wia.workflow_id = w.workflow_id (+) - and a.action_id = wia.action_id (+) + and w.workflow_id = a.workflow_id (+) + and a.parent_action_id is null + and (a.trigger_type = 'init' or a.trigger_type is null)