Index: openacs-4/packages/cms/sql/oracle/cms-publishing-wf.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/sql/oracle/cms-publishing-wf.sql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/cms/sql/oracle/cms-publishing-wf.sql 9 Mar 2002 02:00:02 -0000 1.3 +++ openacs-4/packages/cms/sql/oracle/cms-publishing-wf.sql 25 Sep 2002 04:11:22 -0000 1.4 @@ -2,7 +2,6 @@ /* * Business Process Definition: Simple Publishing Workflow (publishing_wf) * - * Auto-generated by ACS Workflow Export, version 4.3 * * Context: default */ @@ -178,52 +177,52 @@ begin workflow.add_arc( workflow_key => 'publishing_wf', - transition_key => 'approval', - place_key => 'authored', - direction => 'out', - guard_callback => 'publishing_wf.is_next', + transition_key => 'authoring', + place_key => 'start', + direction => 'in', + guard_callback => '', guard_custom_arg => '', guard_description => '' ); end; / show errors - + begin workflow.add_arc( workflow_key => 'publishing_wf', - transition_key => 'approval', - place_key => 'edited', - direction => 'in', - guard_callback => '', + transition_key => 'authoring', + place_key => 'authored', + direction => 'out', + guard_callback => 'publishing_wf.is_next', guard_custom_arg => '', guard_description => '' ); end; / show errors - + begin workflow.add_arc( workflow_key => 'publishing_wf', - transition_key => 'approval', - place_key => 'end', + transition_key => 'authoring', + place_key => 'start', direction => 'out', - guard_callback => 'publishing_wf.is_next', + guard_callback => '#', guard_custom_arg => '', guard_description => '' ); end; / show errors - + begin workflow.add_arc( workflow_key => 'publishing_wf', - transition_key => 'approval', - place_key => 'start', - direction => 'out', - guard_callback => 'publishing_wf.is_next', + transition_key => 'editing', + place_key => 'authored', + direction => 'in', + guard_callback => '', guard_custom_arg => '', guard_description => '' ); @@ -234,8 +233,8 @@ begin workflow.add_arc( workflow_key => 'publishing_wf', - transition_key => 'approval', - place_key => 'edited', + transition_key => 'editing', + place_key => 'authored', direction => 'out', guard_callback => '#', guard_custom_arg => '', @@ -245,11 +244,13 @@ / show errors + + begin workflow.add_arc( workflow_key => 'publishing_wf', - transition_key => 'authoring', - place_key => 'authored', + transition_key => 'editing', + place_key => 'edited', direction => 'out', guard_callback => 'publishing_wf.is_next', guard_custom_arg => '', @@ -258,14 +259,15 @@ end; / show errors + begin workflow.add_arc( workflow_key => 'publishing_wf', - transition_key => 'authoring', + transition_key => 'editing', place_key => 'start', direction => 'out', - guard_callback => '#', + guard_callback => 'publishing_wf.is_next', guard_custom_arg => '', guard_description => '' ); @@ -276,8 +278,8 @@ begin workflow.add_arc( workflow_key => 'publishing_wf', - transition_key => 'authoring', - place_key => 'start', + transition_key => 'approval', + place_key => 'edited', direction => 'in', guard_callback => '', guard_custom_arg => '', @@ -287,25 +289,29 @@ / show errors + + begin workflow.add_arc( workflow_key => 'publishing_wf', - transition_key => 'editing', - place_key => 'authored', - direction => 'in', - guard_callback => '', + transition_key => 'approval', + place_key => 'edited', + direction => 'out', + guard_callback => '#', guard_custom_arg => '', guard_description => '' ); end; / show errors - + + + begin workflow.add_arc( workflow_key => 'publishing_wf', - transition_key => 'editing', - place_key => 'edited', + transition_key => 'approval', + place_key => 'end', direction => 'out', guard_callback => 'publishing_wf.is_next', guard_custom_arg => '', @@ -314,12 +320,13 @@ end; / show errors - + + begin workflow.add_arc( workflow_key => 'publishing_wf', - transition_key => 'editing', - place_key => 'start', + transition_key => 'approval', + place_key => 'authored', direction => 'out', guard_callback => 'publishing_wf.is_next', guard_custom_arg => '', @@ -329,21 +336,72 @@ / show errors + begin workflow.add_arc( workflow_key => 'publishing_wf', - transition_key => 'editing', - place_key => 'authored', + transition_key => 'approval', + place_key => 'start', direction => 'out', - guard_callback => '#', + guard_callback => 'publishing_wf.is_next', guard_custom_arg => '', guard_description => '' ); end; / show errors - + + +create or replace package publishing_wf as + + -- simply check the 'next_place' attribute and return true if + -- it matches the submitted place_key + + function is_next ( + case_id in number, + workflow_key in varchar, + transition_key in varchar, + place_key in varchar, + direction in varchar, + custom_arg in varchar + ) return char; + +end publishing_wf; +/ +show errors + +create or replace package body publishing_wf as + + function is_next ( + case_id in number, + workflow_key in varchar, + transition_key in varchar, + place_key in varchar, + direction in varchar, + custom_arg in varchar + ) return char is + + v_next_place varchar(100); + v_result char(1) := 'f'; + + begin + + v_next_place := workflow_case.get_attribute_value(case_id, 'next_place'); + + if v_next_place = place_key then + v_result := 't'; + end if; + + return v_result; + + end is_next; + +end publishing_wf; +/ +show errors + + /***** * Attributes *****/ @@ -366,36 +424,50 @@ begin workflow.add_trans_attribute_map( workflow_key => 'publishing_wf', - transition_key => 'approval', + transition_key => 'authoring', attribute_name => 'next_place', sort_order => 1 ); end; / show errors + begin workflow.add_trans_attribute_map( workflow_key => 'publishing_wf', - transition_key => 'authoring', + transition_key => 'editing', attribute_name => 'next_place', sort_order => 1 ); end; / show errors - + begin workflow.add_trans_attribute_map( workflow_key => 'publishing_wf', - transition_key => 'editing', + transition_key => 'approval', attribute_name => 'next_place', sort_order => 1 ); end; / show errors + +begin + workflow.add_trans_role_assign_map( + workflow_key => 'publishing_wf', + transition_key => 'authoring', + assign_role_key => 'authoring' + ); +end; +/ +show errors + + + /***** * Transition-role-assignment-map *****/ Index: openacs-4/packages/cms/sql/postgresql/cms-publishing-wf.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/sql/postgresql/cms-publishing-wf.sql,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/cms/sql/postgresql/cms-publishing-wf.sql 24 Sep 2002 20:47:12 -0000 1.7 +++ openacs-4/packages/cms/sql/postgresql/cms-publishing-wf.sql 25 Sep 2002 04:11:24 -0000 1.8 @@ -61,15 +61,22 @@ perform workflow__add_role( ''publishing_wf'', - ''author'', - ''Author'', + ''approval'', + ''Approval'', + 2 + ); + + perform workflow__add_role( + ''publishing_wf'', + ''authoring'', + ''Authoring'', 1 ); perform workflow__add_role( ''publishing_wf'', - ''editor'', - ''Editor'', + ''editing'', + ''Editing'', 2 ); /***** @@ -80,7 +87,7 @@ ''publishing_wf'', ''authoring'', ''Authoring'', - ''author'', + ''authoring'', 1, ''user'' ); @@ -89,7 +96,7 @@ ''publishing_wf'', ''editing'', ''Editing'', - ''editor'', + ''editing'', 2, ''user'' ); @@ -98,7 +105,7 @@ ''publishing_wf'', ''approval'', ''Approval'', - ''editor'', + ''approval'', 3, ''user'' ); Index: openacs-4/packages/cms/tcl/form-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/form-procs-oracle.xql,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/cms/tcl/form-procs-oracle.xql 21 Sep 2001 05:01:38 -0000 1.13 +++ openacs-4/packages/cms/tcl/form-procs-oracle.xql 25 Sep 2002 04:11:25 -0000 1.14 @@ -1,5 +1,6 @@ +oracle8.1.6 Index: openacs-4/packages/cms/www/modules/users/edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/users/edit.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/cms/www/modules/users/edit.tcl 20 Aug 2002 11:17:31 -0000 1.5 +++ openacs-4/packages/cms/www/modules/users/edit.tcl 25 Sep 2002 04:11:26 -0000 1.6 @@ -31,7 +31,7 @@ if { [form is_request edit_group] } { - db_1row get_group "" + db_1row get_group_info "" -column_array info element set_properties edit_group group_name -value $info(group_name) element set_properties edit_group email -value $info(email)