Index: openacs-4/packages/workflow/tcl/action-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/workflow/tcl/action-procs.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/workflow/tcl/action-procs.xql 21 Jan 2003 18:06:00 -0000 1.4 +++ openacs-4/packages/workflow/tcl/action-procs.xql 3 Feb 2003 12:23:01 -0000 1.5 @@ -1,6 +1,24 @@ + + + select count(*) + from workflow_actions + where workflow_id = :workflow_id + and sort_order = :sort_order + + + + + + update workflow_actions + set sort_order = sort_order + 1 + where workflow_id = :workflow_id + and sort_order >= :sort_order + + + insert into workflow_action_allowed_roles @@ -24,9 +42,9 @@ insert into workflow_actions (action_id, workflow_id, sort_order, short_name, pretty_name, pretty_past_tense, - assigned_role, always_enabled_p) + edit_fields, assigned_role, always_enabled_p) values (:action_id, :workflow_id, :sort_order, :short_name, :pretty_name, :pretty_past_tense, - :assigned_role_id, :always_enabled_p) + :edit_fields, :assigned_role_id, :always_enabled_p) @@ -73,21 +91,50 @@ - select workflow_id, - sort_order, - short_name, - pretty_name, - pretty_past_tense, - assigned_role, - always_enabled_p - from workflow_actions - where action_id = :action_id + select a.action_id, + a.workflow_id, + a.sort_order, + a.short_name, + a.pretty_name, + a.pretty_past_tense, + a.edit_fields, + a.assigned_role, + (select short_name from workflow_roles where role_id = a.assigned_role) as assigned_role_short_name, + a.always_enabled_p, + (select case when count(*) = 1 then 't' else 'f' end + from workflow_initial_action + where workflow_id = a.workflow_id + and action_id = a.action_id + ) as initial_action_p + from workflow_actions a + where a.action_id = :action_id + + + select impl.impl_owner_name || '.' || impl.impl_name + from acs_sc_impls impl, + workflow_action_callbacks c + where c.action_id = :action_id + and impl.impl_id = c.acs_sc_impl_id + order by c.sort_order + + + + + + select r.short_name + from workflow_roles r, + workflow_action_allowed_roles aar + where aar.action_id = :action_id + and r.role_id = aar.role_id + + + - select coalesce(max(sort_order)) + 1 + select coalesce(max(sort_order),0) + 1 from workflow_action_callbacks where action_id = :action_id @@ -113,7 +160,7 @@ - insert into workflow_fsm_action_enabled_in_states + insert into workflow_fsm_action_en_in_st (action_id, state_id) values (:action_id, :enabled_state_id) @@ -127,4 +174,25 @@ + + + select a.new_state as new_state_id, + s.short_name as new_state + from workflow_fsm_actions a, + workflow_fsm_states s + where a.action_id = :action_id + and s.state_id = a.new_state + + + + + + select s.short_name + from workflow_fsm_action_en_in_st waeis, + workflow_fsm_states s + where waeis.action_id = :action_id + and s.state_id = waeis.state_id + + +