Index: openacs-4/contrib/obsolete-packages/acs-workflow/acs-workflow.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/acs-workflow.info,v diff -u -r1.10 -r1.11 --- openacs-4/contrib/obsolete-packages/acs-workflow/acs-workflow.info 26 Aug 2001 22:57:00 -0000 1.10 +++ openacs-4/contrib/obsolete-packages/acs-workflow/acs-workflow.info 19 Nov 2001 18:34:18 -0000 1.11 @@ -1,18 +1,20 @@ - + ACS Workflow ACS Workflow Services t t - + oracle postgresql Lars Pind + Neophytos Demetriou + Daniel Wickstrom Provides generic workflow management features to all ACS objects. 2001-03-06 ArsDigita Corporation @@ -33,13 +35,20 @@ - + + + + + + + + @@ -49,45 +58,72 @@ + + + + + + + + - + + + + + + + + + + - + + + + + + + + + + + @@ -96,6 +132,8 @@ + + @@ -110,6 +148,7 @@ + @@ -149,15 +188,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + @@ -174,6 +239,7 @@ + @@ -184,12 +250,12 @@ - + @@ -209,11 +275,23 @@ + + + + + + + + + + + + @@ -272,36 +350,70 @@ + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -336,6 +448,10 @@ + + + + @@ -353,26 +469,37 @@ + + + + + + + + + + + - - - - - - - + + + + + + + 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 -r1.1 -r1.2 --- openacs-4/packages/cms/sql/oracle/cms-publishing-wf.sql 20 Apr 2001 20:51:09 -0000 1.1 +++ openacs-4/packages/cms/sql/oracle/cms-publishing-wf.sql 19 Nov 2001 18:39:05 -0000 1.2 @@ -1,243 +1,425 @@ + +/* + * Business Process Definition: Simple Publishing Workflow (publishing_wf) + * + * Auto-generated by ACS Workflow Export, version 4.3 + * + * Context: default + */ + + +/* + * Cases table + */ create table cr_workflows ( - case_id integer - constraint cr_workflows_pk - primary key - constraint cr_workflows_case_id_fk - references wf_cases + case_id integer primary key + references wf_cases on delete cascade ); -declare - v_workflow_key varchar(100); +/* + * Declare the object type + */ +declare + v_workflow_key varchar2(40); begin - - v_workflow_key := workflow.create_workflow ( - workflow_key => 'publishing', - pretty_name => 'Simple Publishing Workflow', - pretty_plural => 'Simple Publishing Workflows', - description => 'A simple linear workflow for authoring, - editing and scheduling content items.', - table_name => 'cr_workflows'); - + v_workflow_key := workflow.create_workflow( + workflow_key => 'publishing_wf', + pretty_name => 'Simple Publishing Workflow', + pretty_plural => 'Simple Publishing Workflows', + description => 'A simple linear workflow for authoring, + editing and scheduling content items.', + table_name => 'cr_workflows' + ); 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; +/***** + * Places + *****/ -end publishing_wf; +begin + workflow.add_place( + workflow_key => 'publishing_wf', + place_key => 'start', + place_name => 'Created', + sort_order => 1 + ); +end; / -show errors +show errors + +begin + workflow.add_place( + workflow_key => 'publishing_wf', + place_key => 'authored', + place_name => 'Authored', + sort_order => 2 + ); +end; +/ +show errors + +begin + workflow.add_place( + workflow_key => 'publishing_wf', + place_key => 'edited', + place_name => 'Edited', + sort_order => 3 + ); +end; +/ +show errors + +begin + workflow.add_place( + workflow_key => 'publishing_wf', + place_key => 'end', + place_name => 'Approved', + sort_order => 4 + ); +end; +/ +show errors + +/***** + * Roles + *****/ -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 +begin + workflow.add_role( + workflow_key => 'publishing_wf', + role_key => 'approval', + role_name => 'Approval', + sort_order => 3 + ); +end; +/ +show errors + +begin + workflow.add_role( + workflow_key => 'publishing_wf', + role_key => 'authoring', + role_name => 'Authoring', + sort_order => 1 + ); +end; +/ +show errors + +begin + workflow.add_role( + workflow_key => 'publishing_wf', + role_key => 'editing', + role_name => 'Editing', + sort_order => 2 + ); +end; +/ +show errors + - v_next_place varchar(100); - v_result char(1) := 'f'; +/***** + * Transitions + *****/ - begin - v_next_place := workflow_case.get_attribute_value(case_id, 'next_place'); +begin + workflow.add_transition( + workflow_key => 'publishing_wf', + transition_key => 'authoring', + transition_name => 'Authoring', + role_key => 'authoring', + sort_order => 1, + trigger_type => 'user' + ); +end; +/ +show errors + +begin + workflow.add_transition( + workflow_key => 'publishing_wf', + transition_key => 'editing', + transition_name => 'Editing', + role_key => 'editing', + sort_order => 2, + trigger_type => 'user' + ); +end; +/ +show errors + +begin + workflow.add_transition( + workflow_key => 'publishing_wf', + transition_key => 'approval', + transition_name => 'Approval', + role_key => 'approval', + sort_order => 3, + trigger_type => 'user' + ); +end; +/ +show errors + - if v_next_place = place_key then - v_result := 't'; - end if; - - return v_result; +/***** + * Arcs + *****/ - end is_next; - -end publishing_wf; + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'approval', + 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 => 'edited', + 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 => 'end', + 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 => 'start', + 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 => 'edited', + direction => 'out', + guard_callback => '#', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + 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 => 'authoring', + place_key => 'start', + direction => 'out', + guard_callback => '#', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + 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 => 'editing', + place_key => 'authored', + direction => 'in', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'editing', + place_key => 'edited', + 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 => 'editing', + place_key => 'start', + 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 => 'editing', + place_key => 'authored', + direction => 'out', + guard_callback => '#', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + -insert into wf_places ( - place_key, workflow_key, place_name, sort_order -) values ( - 'start', 'publishing_wf', 'Created', 1 -); +/***** + * Attributes + *****/ -insert into wf_places ( - place_key, workflow_key, place_name, sort_order -) values ( - 'authored', 'publishing_wf', 'Authored', 2 -); -insert into wf_places ( - place_key, workflow_key, place_name, sort_order -) values ( - 'edited', 'publishing_wf', 'Edited', 3 -); +declare + v_attribute_id number; +begin + v_attribute_id := workflow.create_attribute( + workflow_key => 'publishing_wf', + attribute_name => 'next_place', + datatype => 'string', + pretty_name => 'Next Place', + default_value => 'start' + ); +end; +/ +show errors + +begin + workflow.add_trans_attribute_map( + workflow_key => 'publishing_wf', + transition_key => 'approval', + attribute_name => 'next_place', + sort_order => 1 + ); +end; +/ +show errors + +begin + workflow.add_trans_attribute_map( + workflow_key => 'publishing_wf', + 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 => 'editing', + attribute_name => 'next_place', + sort_order => 1 + ); +end; +/ +show errors + +/***** + * Transition-role-assignment-map + *****/ -insert into wf_places ( - place_key, workflow_key, place_name, sort_order -) values ( - 'end', 'publishing_wf', 'Approved', 4 -); + /* - * The next step is to define the valid transitions from one place in the - * workflow to another. Transitions are where actions occur, either on the - * part of users or machines. + * Context/Transition info + * (for context = default) */ -insert into wf_transitions ( - transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( - 'authoring', 'Authoring', 'publishing_wf', 1, 'user' -); -insert into wf_transitions ( - transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( - 'editing', 'Editing', 'publishing_wf', 2, 'user' -); -insert into wf_transitions ( - transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( - 'approval', 'Approval', 'publishing_wf', 3, 'user' -); - -/* - * The next step is connect transitions to places. This is analogous - * to adding arrows or arcs to the workflow diagram, pointing from places - * to transitions and from transitions to other places. +/* + * Context/Role info + * (for context = default) */ -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction -) values ( - 'publishing_wf', 'authoring', 'start', 'in' -); --- The authoring transition can either be to 'authored' or back to 'start' --- if the author checks in the item without completing it -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'authoring', 'authored', 'out', 'publishing_wf.is_next' -); +/* + * Context Task Panels + * (for context = default) + */ -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'authoring', 'start', 'out', '#' -); - -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction -) values ( - 'publishing_wf', 'editing', 'authored', 'in' -); - --- The editing transition can either be to 'edited' or back to 'start' --- if the item is rejected - -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'editing', 'authored', 'out', '#' -); - -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'editing', 'edited', 'out', 'publishing_wf.is_next' -); - -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'editing', 'start', 'out', 'publishing_wf.is_next' -); - -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction -) values ( - 'publishing_wf', 'approval', 'edited', 'in' -); - --- The approval transition can be to the end, back to authored --- for further editor review, or back to start for further author work. - - -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'approval', 'edited', 'out', '#' -); - - -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'approval', 'end', 'out', 'publishing_wf.is_next' -); - -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'approval', 'authored', 'out', 'publishing_wf.is_next' -); - -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'approval', 'start', 'out', 'publishing_wf.is_next' -); - - -declare - v_attribute_id acs_attributes.attribute_id%TYPE; -begin - v_attribute_id := workflow.create_attribute( - workflow_key => 'publishing_wf', - attribute_name => 'next_place', - datatype => 'string', - wf_datatype => 'none', - pretty_name => 'Next Place', - default_value => 'start' - ); - - insert into wf_transition_attribute_map - (workflow_key, transition_key, attribute_id, sort_order) - values - ('publishing_wf', 'authoring', v_attribute_id, 1); - - insert into wf_transition_attribute_map - (workflow_key, transition_key, attribute_id, sort_order) - values - ('publishing_wf', 'editing', v_attribute_id, 1); - - insert into wf_transition_attribute_map - (workflow_key, transition_key, attribute_id, sort_order) - values - ('publishing_wf', 'approval', v_attribute_id, 1); - -end; -/ -show errors; - +commit; 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 -r1.4 -r1.5 --- openacs-4/packages/cms/sql/postgresql/cms-publishing-wf.sql 14 Jun 2001 00:28:06 -0000 1.4 +++ openacs-4/packages/cms/sql/postgresql/cms-publishing-wf.sql 19 Nov 2001 18:38:19 -0000 1.5 @@ -1,265 +1,383 @@ + +/* + * Business Process Definition: Simple Publishing Workflow (publishing_wf) + * + * Auto-generated by ACS Workflow Export, version 4.3 + * + * Context: default + */ + + +/* + * Cases table + */ create table cr_workflows ( - case_id integer - constraint cr_workflows_pk - primary key - constraint cr_workflows_case_id_fk - references wf_cases + case_id integer primary key + references wf_cases on delete cascade ); -create function inline_0 () -returns integer as ' -declare - v_workflow_key varchar(100); +/* + * Declare the object type + */ + +create function inline_0 () returns integer as ' begin + PERFORM workflow__create_workflow ( + ''publishing_wf'', + ''Simple Publishing Workflow'', + ''Simple Publishing Workflows'', + ''A simple linear workflow for authoring, + editing and scheduling content items.'', + ''cr_workflows'', + ''case_id'' + ); - v_workflow_key := workflow__create_workflow( - ''publishing'', - ''Simple Publishing Workflow'', - ''Simple Publishing Workflows'', - ''A simple linear workflow for authoring, - editing and scheduling content items.'', - ''cr_workflows'', - ''case_id'' - ); + return null; - return 0; end;' language 'plpgsql'; select inline_0 (); - drop function inline_0 (); - --- 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 +/***** + * Places + *****/ --- create or replace package body publishing_wf as --- function is_next -create function publishing_wf__is_next (integer,varchar,varchar,varchar,varchar,varchar) -returns char as ' -declare - p_case_id alias for $1; - p_workflow_key alias for $2; - p_transition_key alias for $3; - p_place_key alias for $4; - p_direction alias for $5; - p_custom_arg alias for $6; - v_next_place varchar(100); - v_result boolean; -begin - v_next_place := workflow_case__get_attribute_value(p_case_id,''next_place''); + select workflow__add_place( + 'publishing_wf', + 'start', + 'Created', + 1 + ); - if v_next_place = p_place_key then - v_result := ''t''; - end if; - - return v_result; - -end;' language 'plpgsql'; + --- show errors + select workflow__add_place( + 'publishing_wf', + 'authored', + 'Authored', + 2 + ); -insert into wf_places ( - place_key, workflow_key, place_name, sort_order -) values ( - 'start', 'publishing_wf', 'Created', 1 -); + -insert into wf_places ( - place_key, workflow_key, place_name, sort_order -) values ( - 'authored', 'publishing_wf', 'Authored', 2 -); + select workflow__add_place( + 'publishing_wf', + 'edited', + 'Edited', + 3 + ); -insert into wf_places ( - place_key, workflow_key, place_name, sort_order -) values ( - 'edited', 'publishing_wf', 'Edited', 3 -); + -insert into wf_places ( - place_key, workflow_key, place_name, sort_order -) values ( - 'end', 'publishing_wf', 'Approved', 4 -); + select workflow__add_place( + 'publishing_wf', + 'end', + 'Approved', + 4 + ); -/* - * The next step is to define the valid transitions from one place in the - * workflow to another. Transitions are where actions occur, either on the - * part of users or machines. - */ + +/***** + * Roles + *****/ -insert into wf_transitions ( - transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( - 'authoring', 'Authoring', 'publishing_wf', 1, 'user' -); -insert into wf_transitions ( - transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( - 'editing', 'Editing', 'publishing_wf', 2, 'user' -); -insert into wf_transitions ( - transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( - 'approval', 'Approval', 'publishing_wf', 3, 'user' -); + select workflow__add_role ( + 'publishing_wf', + 'approval', + 'Approval', + 3 + ); -/* - * The next step is connect transitions to places. This is analogous - * to adding arrows or arcs to the workflow diagram, pointing from places - * to transitions and from transitions to other places. - */ + -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction -) values ( - 'publishing_wf', 'authoring', 'start', 'in' -); + select workflow__add_role ( + 'publishing_wf', + 'authoring', + 'Authoring', + 1 + ); --- The authoring transition can either be to 'authored' or back to 'start' --- if the author checks in the item without completing it + -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'authoring', 'authored', 'out', 'publishing_wf__is_next' -); + select workflow__add_role ( + 'publishing_wf', + 'editing', + 'Editing', + 2 + ); -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'authoring', 'start', 'out', '#' -); + +/***** + * Transitions + *****/ -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction -) values ( - 'publishing_wf', 'editing', 'authored', 'in' -); --- The editing transition can either be to 'edited' or back to 'start' --- if the item is rejected -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'editing', 'authored', 'out', '#' -); + select workflow__add_transition ( + 'publishing_wf', + 'authoring', + 'Authoring', + 'authoring', + 1, + 'user' + ); + + -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'editing', 'edited', 'out', 'publishing_wf__is_next' -); + select workflow__add_transition ( + 'publishing_wf', + 'editing', + 'Editing', + 'editing', + 2, + 'user' + ); + + -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'editing', 'start', 'out', 'publishing_wf__is_next' -); + select workflow__add_transition ( + 'publishing_wf', + 'approval', + 'Approval', + 'approval', + 3, + 'user' + ); + + -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction -) values ( - 'publishing_wf', 'approval', 'edited', 'in' -); +/***** + * Arcs + *****/ --- The approval transition can be to the end, back to authored --- for further editor review, or back to start for further author work. -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'approval', 'edited', 'out', '#' -); + select workflow__add_arc ( + 'publishing_wf', + 'approval', + 'authored', + 'out', + 'publishing_wf__is_next', + '', + '' + ); + -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'approval', 'end', 'out', 'publishing_wf__is_next' -); + select workflow__add_arc ( + 'publishing_wf', + 'approval', + 'edited', + 'out', + '#', + '', + '' + ); -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'approval', 'authored', 'out', 'publishing_wf__is_next' -); + -insert into wf_arcs ( - workflow_key, transition_key, place_key, direction, guard_callback -) values ( - 'publishing_wf', 'approval', 'start', 'out', 'publishing_wf__is_next' -); + select workflow__add_arc ( + 'publishing_wf', + 'approval', + 'edited', + 'in', + '', + '', + '' + ); + -create function inline_1 () -returns integer as ' -declare - v_attribute_id acs_attributes.attribute_id%TYPE; -begin - v_attribute_id := workflow__create_attribute( - ''publishing_wf'', - ''next_place'', - ''string'', - ''Next Place'', - null, - null, - null, - ''start'', - 1, - 1, - null, - ''generic'', - ''none'' + select workflow__add_arc ( + 'publishing_wf', + 'approval', + 'end', + 'out', + 'publishing_wf__is_next', + '', + '' + ); + + + + select workflow__add_arc ( + 'publishing_wf', + 'approval', + 'start', + 'out', + 'publishing_wf__is_next', + '', + '' + ); + + + + select workflow__add_arc ( + 'publishing_wf', + 'authoring', + 'authored', + 'out', + 'publishing_wf__is_next', + '', + '' + ); + + + + select workflow__add_arc ( + 'publishing_wf', + 'authoring', + 'start', + 'out', + '#', + '', + '' + ); + + + + select workflow__add_arc ( + 'publishing_wf', + 'authoring', + 'start', + 'in', + '', + '', + '' + ); + + + + select workflow__add_arc ( + 'publishing_wf', + 'editing', + 'authored', + 'out', + '#', + '', + '' + ); + + + + select workflow__add_arc ( + 'publishing_wf', + 'editing', + 'authored', + 'in', + '', + '', + '' + ); + + + + select workflow__add_arc ( + 'publishing_wf', + 'editing', + 'edited', + 'out', + 'publishing_wf__is_next', + '', + '' + ); + + + + select workflow__add_arc ( + 'publishing_wf', + 'editing', + 'start', + 'out', + 'publishing_wf__is_next', + '', + '' + ); + + + +/***** + * Attributes + *****/ + + + + select workflow__create_attribute( + 'publishing_wf', + 'next_place', + 'string', + 'Next Place', + null, + null, + null, + 'start', + 1, + 1, + null, + 'generic' ); - insert into wf_transition_attribute_map - (workflow_key, transition_key, attribute_id, sort_order) - values - (''publishing_wf'', ''authoring'', v_attribute_id, 1); + - insert into wf_transition_attribute_map - (workflow_key, transition_key, attribute_id, sort_order) - values - (''publishing_wf'', ''editing'', v_attribute_id, 1); + select workflow__add_trans_attribute_map( + 'publishing_wf', + 'approval', + 'next_place', + 1 + ); - insert into wf_transition_attribute_map - (workflow_key, transition_key, attribute_id, sort_order) - values - (''publishing_wf'', ''approval'', v_attribute_id, 1); + - return 0; -end;' language 'plpgsql'; + select workflow__add_trans_attribute_map( + 'publishing_wf', + 'authoring', + 'next_place', + 1 + ); -select inline_1 (); + -drop function inline_1 (); + select workflow__add_trans_attribute_map( + 'publishing_wf', + 'editing', + 'next_place', + 1 + ); + +/***** + * Transition-role-assignment-map + *****/ --- show errors + +/* + * Context/Transition info + * (for context = default) + */ + + + +/* + * Context/Role info + * (for context = default) + */ + + + +/* + * Context Task Panels + * (for context = default) + */ + + +commit; Index: openacs-4/packages/cms/tcl/workflow-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/workflow-procs-oracle.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/cms/tcl/workflow-procs-oracle.xql 3 Sep 2001 05:56:37 -0000 1.4 +++ openacs-4/packages/cms/tcl/workflow-procs-oracle.xql 19 Nov 2001 18:40:38 -0000 1.5 @@ -3,226 +3,839 @@ oracle8.1.6 - + + + select case_id, + acs_object.name(object_id) as object_name, + + state + from wf_cases + where case_id = :case_id + + + - begin - :1 := acs_mail_nt.post_request( - party_from => :user_id, - party_to => :party_id, - expand_group => 'f', - subject => :subject, - message => :message - ); - end; + + + + + select t.task_id, + t.case_id, + c.object_id, + acs_object.name(c.object_id) as object_name, + ot.pretty_name as object_type_pretty, + c.workflow_key, + tr.transition_name as task_name, + tr.instructions, + t.state, + t.enabled_date, + to_char(t.enabled_date, :date_format) as enabled_date_pretty, + t.started_date, + to_char(t.started_date, :date_format) as started_date_pretty, + t.canceled_date, + to_char(t.canceled_date, :date_format) as canceled_date_pretty, + t.finished_date, + to_char(t.finished_date, :date_format) as finished_date_pretty, + t.overridden_date, + to_char(t.overridden_date, :date_format) as overridden_date_pretty, + t.holding_user, + acs_object.name(t.holding_user) as holding_user_name, + p.email as holding_user_email, + t.hold_timeout, + to_char(t.hold_timeout, :date_format) as hold_timeout_pretty, + t.deadline, + to_char(t.deadline, :date_format) as deadline_pretty, + t.deadline - sysdate as days_till_deadline, + tr.estimated_minutes, + sysdate + from wf_tasks t, + wf_cases c, + wf_transition_info tr, + acs_objects o, + acs_object_types ot, + parties p + where t.task_id = :task_id + and c.case_id = t.case_id + and tr.transition_key = t.transition_key + and tr.workflow_key = t.workflow_key and tr.context_key = c.context_key + and o.object_id = c.object_id + and ot.object_type = o.object_type + and p.party_id (+) = t.holding_user + + + + + + + + select a.attribute_id, + a.attribute_name, + a.pretty_name, + a.datatype, + acs_object.get_attribute(t.case_id, a.attribute_name) as value, + '' as attribute_widget + from acs_attributes a, wf_transition_attribute_map m, wf_tasks t + where t.task_id = :task_id + and m.workflow_key = t.workflow_key and m.transition_key = t.transition_key + and a.attribute_id = m.attribute_id + order by m.sort_order + - + + + + select ut.user_id, + acs_object.name(ut.user_id) as name, + p.email as email + from wf_user_tasks ut, parties p + where ut.task_id = :task_id + and p.party_id = ut.user_id + + + - begin - :1 := acs_mail_nt.post_request( - party_from => null, - party_to => :admin_id, - expand_group => 'f', - subject => :subject, - message => :message - ); - end; + + + + + select j.journal_id, + j.action, + j.action_pretty, + o.creation_date, + to_char(o.creation_date, :date_format) as creation_date_pretty, + o.creation_user, + acs_object.name(o.creation_user) as creation_user_name, + p.email as creation_user_email, + o.creation_ip, + j.msg + from journal_entries j, acs_objects o, parties p + where j.object_id = :case_id + and o.object_id = j.journal_id + and p.party_id (+) = o.creation_user + order by o.creation_date $sql_order + + + + + + + + begin + :1 := workflow_case.begin_task_action( + task_id => :task_id, + action => :action, + action_ip => :modifying_ip, + user_id => :user_id, + msg => :msg); + end; + - + + + + begin + workflow_case.set_attribute_value( + journal_id => :journal_id, + attribute_name => :attribute_name, + value => :value + ); + end; + + + - begin - :1 := acs_mail_nt.post_request( - party_from => null, - party_to => :admin_id, - expand_group => 'f', - subject => :subject, - message => :message - ); - end; + + + + + begin + workflow_case.clear_manual_assignments( + case_id => :case_id, + role_key => :role_key + ); + end; + + + + + + + + begin + workflow_case.add_manual_assignment( + case_id => :case_id, + role_key => :role_key, + party_id => :party_id + ); + end; + - + + - select - transition_name, party_id, - content_item.get_title(i.item_id) title, - to_char(cd.deadline,'Month DD, YYYY') deadline_pretty, - nvl(party.name(party_id),person.name(party_id)) name - from - wf_transitions t, cr_items i, - wf_cases c, wf_case_assignments ca, wf_case_deadlines cd - where - c.workflow_key = 'publishing_wf' - and - c.workflow_key = t.workflow_key - and - ca.transition_key = t.transition_key - and - ca.transition_key = cd.transition_key - and - c.case_id = ca.case_id - and - c.case_id = cd.case_id - and - c.case_id = :case_id - and - c.state = 'active' - and - c.object_id = i.item_id + begin + workflow_case.end_task_action( + journal_id => :journal_id, + action => :action, + task_id => :task_id + ); + end; + + + + + + + + + begin + workflow_case.fire_message_transition( + task_id => :task_id + ); + end; - + - begin - :1 := acs_mail_nt.post_request( - party_from => :user_id, - party_to => :party_id, - expand_group => 'f', - subject => :subject, - message => :message - ); + begin + :1 := workflow_case.new(case_id => :case_id, + workflow_key => :workflow_key, + context_key => :context_key, + object_id => :object_id, + creation_user => :user_id, + creation_ip => :creation_ip + ); end; + + + + begin workflow_case.start_case(case_id => :case_id, + creation_user => :user_id, + creation_ip => :creation_ip + ); end; - + + + + + - select - o.creation_user as admin_id, transition_name, party_id, - content_item.get_title(i.item_id) title, - to_char(deadline,'Month DD, YYYY') deadline_pretty, - nvl(party.name(party_id),person.name(party_id)) name, - nvl(party.name(admin_id),person.name(admin_id)) admin_name - from - wf_cases c, wf_case_assignments ca, wf_case_deadlines cd, - wf_transitions t, cr_items i, acs_objects o - where - c.workflow_key = 'publishing_wf' - and - c.workflow_key = t.workflow_key - and - c.case_id = ca.case_id - and - c.case_id = cd.case_id - and - c.case_id = :case_id - and - ca.transition_key = t.transition_key - and - ca.transition_key = cd.transition_key - and - t.transition_key = :transition_key - and - c.state = 'active' - and - c.object_id = i.item_id - and - c.case_id = o.object_id + begin + workflow_case.suspend( + case_id => :case_id, + user_id => :user_id, + ip_address => :ip_address, + msg => :msg + ); + end; - + + + begin + workflow_case.resume( + case_id => :case_id, + user_id => :user_id, + ip_address => :ip_address, + msg => :msg + ); + end; + + + - begin - :1 := acs_mail_nt.post_request( - party_from => null, - party_to => :admin_id, - expand_group => 'f', - subject => :subject, - message => :message - ); - end; + + + + + begin + workflow_case.cancel( + case_id => :case_id, + user_id => :user_id, + ip_address => :ip_address, + msg => :msg + ); + end; + + + + + + + + begin + :1 := journal_entry.new( + object_id => :case_id, + action => 'comment', + creation_user => :user_id, + creation_ip => :ip_address, + msg => :msg + ); + end; + + + + + + begin + workflow_case.add_manual_assignment( + case_id => :case_id, + role_key => :role_key, + party_id => :party_id + ); + end; + + + - + + - select person.name( :user_id ) from dual + begin + workflow_case.remove_manual_assignment( + case_id => :case_id, + role_key => :role_key, + party_id => :party_id + ); + end; - + - select - transition_name, - content_item.get_title(i.item_id) as title, - o.creation_user as admin_id, - person.name( o.creation_user ) as admin_name, - to_char(sysdate,'Mon DD, YYYY') as today - from - wf_tasks t, wf_transitions tr, wf_cases c, - cr_items i, acs_objects o - where - tr.transition_key = t.transition_key - and - tr.workflow_key = t.workflow_key - and - t.case_id = c.case_id - and - c.object_id = i.item_id - and - i.item_id = o.object_id - and - t.task_id = :task_id + begin + workflow_case.clear_manual_assignments( + case_id => :case_id, + role_key => :role_key + ); + end; - + + + begin + workflow_case.add_task_assignment( + task_id => :task_id, + party_id => :party_id, + permanent_p => :permanent_value + ); + end; + + + - begin - :1 := acs_mail_nt.post_request( - party_from => null, - party_to => :admin_id, - expand_group => 'f', - subject => :subject, - message => :message - ); - end; + + + + + begin + workflow_case.remove_task_assignment( + task_id => :task_id, + party_id => :party_id, + permanent_p => :permanent_value + ); + end; + + + + + + + + begin + workflow_case.clear_task_assignments( + task_id => :task_id, + permanent_p => :permanent_value + ); + end; + + + + + + begin + workflow_case.set_case_deadline( + case_id => :case_id, + transition_key => :transition_key, + deadline => :deadline + ); + end; + + + - + + - select - content_workflow.can_touch( :item_id, :user_id ) - from - dual + begin + workflow_case.remove_case_deadline( + case_id => :case_id, + transition_key => :transition_key + ); + end; + + + + begin + workflow.add_place( + workflow_key => :workflow_key, + place_key => :place_key, + place_name => :place_name, + sort_order => :sort_order + ); + end; + + + + + + + + + begin + workflow.delete_place( + workflow_key => :workflow_key, + place_key => :place_key + ); + end; + + + + + + + + + begin + workflow.add_role( + workflow_key => :workflow_key, + role_key => :role_key, + role_name => :role_name, + sort_order => :sort_order + ); + end; + + + + + + + + + begin + workflow.move_role_up( + workflow_key => :workflow_key, + role_key => :role_key + ); + end; + + + + + + + + + begin + workflow.move_role_down( + workflow_key => :workflow_key, + role_key => :role_key + ); + end; + + + + + + + + + begin + workflow.delete_role( + workflow_key => :workflow_key, + role_key => :role_key + ); + end; + + + + + + + + + begin + workflow.add_transition( + workflow_key => :workflow_key, + transition_key => :transition_key, + transition_name => :transition_name, + role_key => :role_key, + sort_order => :sort_order, + trigger_type => :trigger_type + ); + end; + + + + + + + + + begin + workflow.delete_transition( + workflow_key => :workflow_key, + transition_key => :transition_key + ); + end; + + + + + + + + + begin + workflow.add_arc( + workflow_key => :workflow_key, + transition_key => :transition_key, + place_key => :place_key, + direction => :direction, + guard_callback => :guard_callback, + guard_custom_arg => :guard_custom_arg, + guard_description => :guard_description + ); + end; + + + + + + + + + begin + workflow.add_arc( + workflow_key => :workflow_key, + transition_key => :from_transition_key, + place_key => :to_place_key, + guard_callback => :guard_callback, + guard_custom_arg => :guard_custom_arg, + guard_description => :guard_description + ); + end; + + + + + + + + + begin + workflow.add_arc( + workflow_key => :workflow_key, + transition_key => :to_transition_key, + place_key => :from_place_key + ); + end; + + + + + + + + + begin + workflow.delete_arc( + workflow_key => :workflow_key, + transition_key => :transition_key, + place_key => :place_key, + direction => :direction + ); + end; + + + + + + + + + begin + workflow.add_trans_attribute_map( + workflow_key => :workflow_key, + transition_key => :transition_key, + attribute_id => :attribute_id, + sort_order => :sort_order + ); + end; + + + + + + + + + begin + workflow.add_trans_attribute_map( + workflow_key => :workflow_key, + transition_key => :transition_key, + attribute_name => :attribute_name, + sort_order => :sort_order + ); + end; + + + + + + + + + begin + workflow.delete_trans_attribute_map( + workflow_key => :workflow_key, + transition_key => :transition_key, + attribute_id => :attribute_id + ); + end; + + + + + + + + + begin + workflow.add_trans_role_assign_map( + workflow_key => :workflow_key, + transition_key => :transition_key, + assign_role_key => :assign_role_key + ); + end; + + + + + + + + + begin + workflow.delete_trans_role_assign_map( + workflow_key => :workflow_key, + transition_key => :transition_key, + assign_role_key => :assign_role_key + ); + end; + + + + + + + + begin :1 := workflow.simple_p(:workflow_key); end; + + + + + + +declare + v_workflow_key varchar2(40); +begin + v_workflow_key := workflow.create_workflow( + workflow_key => '[db_quote $new_workflow_key]', + pretty_name => '[db_quote $new_workflow_pretty_name]', + pretty_plural => '[db_quote $new_workflow_pretty_plural]', + description => '[db_quote $description]', + table_name => '[db_quote $new_table_name]' + ); +end; +/ +show errors + + + + + + + +begin + workflow.add_place( + workflow_key => '[db_quote $new_workflow_key]', + place_key => '[db_quote $place_key]', + place_name => '[db_quote $place_name]', + sort_order => [ad_decode $sort_order "" "null" $sort_order] + ); +end; +/ +show errors + + + + + + + +begin + workflow.add_role( + workflow_key => '[db_quote $new_workflow_key]', + role_key => '[db_quote $role_key]', + role_name => '[db_quote $role_name]', + sort_order => [ad_decode $sort_order "" "null" $sort_order] + ); +end; +/ +show errors + + + + + + +begin + workflow.add_transition( + workflow_key => '[db_quote $new_workflow_key]', + transition_key => '[db_quote $transition_key]', + transition_name => '[db_quote $transition_name]', + role_key => '[db_quote $role_key]', + sort_order => [ad_decode $sort_order "" "null" $sort_order], + trigger_type => '[db_quote $trigger_type]' + ); +end; +/ +show errors + + + + + + + +begin + workflow.add_arc( + workflow_key => '[db_quote $new_workflow_key]', + transition_key => '[db_quote $transition_key]', + place_key => '[db_quote $place_key]', + direction => '[db_quote $direction]', + guard_callback => '[db_quote $guard_callback]', + guard_custom_arg => '[db_quote $guard_custom_arg]', + guard_description => '[db_quote $guard_description]' + ); +end; +/ +show errors + + + + + + + + +declare + v_attribute_id integer; +begin + v_attribute_id := workflow.create_attribute( + workflow_key => '[db_quote $new_workflow_key]', + attribute_name => '[db_quote $attribute_name]', + datatype => '[db_quote $datatype]', + pretty_name => '[db_quote $pretty_name]', + default_value => '[db_quote $default_value]' + ); +end; +/ +show errors + + + + + + + + +begin + workflow.add_trans_attribute_map( + workflow_key => '[db_quote $new_workflow_key]', + transition_key => '[db_quote $transition_key]', + attribute_name => '[db_quote $attribute_name]', + sort_order => [ad_decode $sort_order "" "null" $sort_order] + ); +end; +/ +show errors + + + + + + + +begin + workflow.add_trans_role_assign_map( + workflow_key => '[db_quote $new_workflow_key]', + transition_key => '[db_quote $transition_key]', + assign_role_key => '[db_quote $assign_role_key]' + ); +end; +/ +show errors; + + + Index: openacs-4/packages/cms/tcl/workflow-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/workflow-procs-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/cms/tcl/workflow-procs-postgresql.xql 27 Aug 2001 03:59:17 -0000 1.5 +++ openacs-4/packages/cms/tcl/workflow-procs-postgresql.xql 19 Nov 2001 18:40:38 -0000 1.6 @@ -54,16 +54,19 @@ coalesce(party__name(party_id), person__name(party_id)) as name from wf_transitions t, cr_items i, - wf_cases c, wf_case_assignments ca, wf_case_deadlines cd + wf_cases c, wf_case_assignments ca, wf_case_deadlines cd, + wf_transition_role_assign_map trans_role where c.workflow_key = 'publishing_wf' and c.workflow_key = t.workflow_key and - ca.transition_key = t.transition_key + ca.role_key = trans_role.assign_role_key and - ca.transition_key = cd.transition_key + t.transition_key = trans_role.transition_key and + trans_role.transition_key = cd.transition_key + and c.case_id = ca.case_id and c.case_id = cd.case_id @@ -107,7 +110,8 @@ coalesce(party__name(admin_id),person__name(admin_id)) as admin_name from wf_cases c, wf_case_assignments ca, wf_case_deadlines cd, - wf_transitions t, cr_items i, acs_objects o + wf_transitions t, cr_items i, acs_objects o, + wf_transition_role_assign_map trans_role where c.workflow_key = 'publishing_wf' and @@ -119,10 +123,12 @@ and c.case_id = :case_id and - ca.transition_key = t.transition_key + ca.role_key = trans_role.assign_role_key and - ca.transition_key = cd.transition_key + t.transition_key = trans_role.transition_key and + trans_role.transition_key = cd.transition_key + and t.transition_key = :transition_key and c.state = 'active' Index: openacs-4/packages/cms/www/modules/workflow/case-create-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/case-create-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/workflow/case-create-oracle.xql 3 Sep 2001 05:28:28 -0000 1.2 +++ openacs-4/packages/cms/www/modules/workflow/case-create-oracle.xql 19 Nov 2001 18:43:25 -0000 1.3 @@ -24,7 +24,7 @@ begin workflow_case.add_manual_assignment( case_id => :case_id, - transition_key => :transition, + role_key => :transition, party_id => :value ); end; @@ -39,7 +39,7 @@ begin workflow_case.add_manual_assignment( case_id => :case_id, - transition_key => :transition, + role_key => :transition, party_id => :new_value ); end; Index: openacs-4/packages/cms/www/modules/workflow/case-create-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/case-create-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/workflow/case-create-postgresql.xql 12 Jun 2001 04:13:46 -0000 1.2 +++ openacs-4/packages/cms/www/modules/workflow/case-create-postgresql.xql 19 Nov 2001 18:43:25 -0000 1.3 @@ -6,7 +6,6 @@ - select workflow_case__new( :case_id, 'publishing_wf', @@ -20,7 +19,7 @@ - + @@ -90,3 +89,6 @@ + + + Index: openacs-4/packages/cms/www/modules/workflow/case-status.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/case-status.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/workflow/case-status.xql 12 Jun 2001 04:13:46 -0000 1.2 +++ openacs-4/packages/cms/www/modules/workflow/case-status.xql 19 Nov 2001 18:43:25 -0000 1.3 @@ -12,9 +12,11 @@ select case when count(*) = 0 then 'no' else 'yes' end - from wf_case_assignments + from wf_case_assignments ca, + wf_transitions trans where case_id = :case_id - and transition_key = :transition_key + and ca.role_key = trans.role_key + and trans.transition_key = :transition_key and party_id = :user_id Index: openacs-4/packages/cms/www/modules/workflow/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/index-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workflow/index-oracle.xql 25 May 2001 23:49:05 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workflow/index-oracle.xql 19 Nov 2001 18:43:25 -0000 1.2 @@ -98,7 +98,7 @@ and c.case_id = ca.case_id and - ca.transition_key = t.transition_key + ca.role_key = t.role_key and p.person_id = ca.party_id and Index: openacs-4/packages/cms/www/modules/workflow/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/index-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workflow/index-postgresql.xql 25 May 2001 23:49:05 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workflow/index-postgresql.xql 19 Nov 2001 18:43:25 -0000 1.2 @@ -82,7 +82,7 @@ and c.case_id = ca.case_id and - ca.transition_key = t.transition_key + ca.role_key = t.role_key and p.person_id = ca.party_id and Index: openacs-4/packages/cms/www/modules/workflow/overdue-items-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/overdue-items-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workflow/overdue-items-oracle.xql 8 Jun 2001 01:44:53 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workflow/overdue-items-oracle.xql 19 Nov 2001 18:43:25 -0000 1.2 @@ -20,9 +20,9 @@ and c.case_id = ca.case_id and - ca.transition_key = dead.transition_key + ca.role_key = trans.role_key and - trans.transition_key = ca.transition_key + dead.transition_key = trans.transition_key and c.workflow_key = 'publishing_wf' and Index: openacs-4/packages/cms/www/modules/workflow/overdue-items-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/overdue-items-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workflow/overdue-items-postgresql.xql 8 Jun 2001 01:44:53 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workflow/overdue-items-postgresql.xql 19 Nov 2001 18:43:25 -0000 1.2 @@ -20,9 +20,9 @@ and c.case_id = ca.case_id and - ca.transition_key = dead.transition_key + ca.role_key = trans.role_key and - trans.transition_key = ca.transition_key + dead.transition_key = trans.transition_key and c.workflow_key = 'publishing_wf' and Index: openacs-4/packages/cms/www/modules/workflow/user-tasks-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/user-tasks-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workflow/user-tasks-oracle.xql 25 May 2001 23:49:05 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workflow/user-tasks-oracle.xql 19 Nov 2001 18:43:25 -0000 1.2 @@ -24,7 +24,7 @@ to_char(started_date,$date_format) as started_date_pretty, to_char(hold_timeout,'Mon. DD, YYYY') as hold_timeout_pretty, holding_user, person.name(holding_user) as holding_user_name, - content_workflow.is_overdue(c.case_id, ca.transition_key) as is_overdue + content_workflow.is_overdue(c.case_id, trans.transition_key) as is_overdue from wf_transitions trans, wf_tasks t, cr_items i, wf_cases c, wf_case_assignments ca @@ -41,7 +41,7 @@ and t.transition_key = trans.transition_key and - ca.transition_key = trans.transition_key + ca.role_key = trans.role_key and c.state = 'active' and @@ -58,10 +58,10 @@ select - ca.transition_key, transition_name, + trans.transition_key, transition_name, item_id, content_item.get_title(item_id) as title, to_char(deadline,'Mon. DD, YYYY') as deadline_pretty, - content_workflow.is_overdue(c.case_id, ca.transition_key) as is_overdue + content_workflow.is_overdue(c.case_id, trans.transition_key) as is_overdue from wf_case_assignments ca, wf_case_deadlines dead, wf_cases c, cr_items i, wf_transitions trans @@ -74,23 +74,23 @@ and c.case_id = dead.case_id and - ca.transition_key = trans.transition_key + ca.role_key = trans.role_key and dead.transition_key = trans.transition_key and c.object_id = i.item_id and c.state = 'active' and - content_workflow.is_finished(c.case_id, ca.transition_key) = 'f' + content_workflow.is_finished(c.case_id, trans.transition_key) = 'f' and not exists ( select 1 from wf_tasks where case_id = c.case_id and - transition_key = ca.transition_key + transition_key = trans.transition_key and state in ('enabled','started') ) and Index: openacs-4/packages/cms/www/modules/workflow/user-tasks-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/user-tasks-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workflow/user-tasks-postgresql.xql 25 May 2001 23:49:05 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workflow/user-tasks-postgresql.xql 19 Nov 2001 18:43:25 -0000 1.2 @@ -24,7 +24,7 @@ to_char(started_date,$date_format) as started_date_pretty, to_char(hold_timeout,'Mon. DD, YYYY') as hold_timeout_pretty, holding_user, person__name(holding_user) as holding_user_name, - content_workflow__is_overdue(c.case_id, ca.transition_key) as is_overdue + content_workflow__is_overdue(c.case_id, trans.transition_key) as is_overdue from wf_transitions trans, wf_tasks t, cr_items i, wf_cases c, wf_case_assignments ca @@ -41,7 +41,7 @@ and t.transition_key = trans.transition_key and - ca.transition_key = trans.transition_key + ca.role_key = trans.role_key and c.state = 'active' and @@ -58,10 +58,10 @@ select - ca.transition_key, transition_name, + trans.transition_key, transition_name, item_id, content_item__get_title(item_id) as title, to_char(deadline,'Mon. DD, YYYY') as deadline_pretty, - content_workflow__is_overdue(c.case_id, ca.transition_key) as is_overdue + content_workflow__is_overdue(c.case_id, trans.transition_key) as is_overdue from wf_case_assignments ca, wf_case_deadlines dead, wf_cases c, cr_items i, wf_transitions trans @@ -74,23 +74,23 @@ and c.case_id = dead.case_id and - ca.transition_key = trans.transition_key + ca.role_key = trans.role_key and dead.transition_key = trans.transition_key and c.object_id = i.item_id and c.state = 'active' and - content_workflow__is_finished(c.case_id, ca.transition_key) = 'f' + content_workflow__is_finished(c.case_id, trans.transition_key) = 'f' and not exists ( select 1 from wf_tasks where case_id = c.case_id and - transition_key = ca.transition_key + transition_key = trans.transition_key and state in ('enabled','started') ) and Index: openacs-4/packages/cms/www/modules/workflow/workflow-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/workflow-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workflow/workflow-oracle.xql 25 May 2001 23:49:05 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workflow/workflow-oracle.xql 19 Nov 2001 18:43:25 -0000 1.2 @@ -37,7 +37,7 @@ and t.transition_key = trans.transition_key and - ca.transition_key = t.transition_key + ca.role_key = trans.role_key and t.state in ('started','enabled') $transition_sql @@ -52,11 +52,11 @@ select - ca.transition_key, transition_name, ca.party_id, + trans.transition_key, transition_name, ca.party_id, item_id, content_item.get_title(item_id) as title, nvl(party.name(ca.party_id),person.name(ca.party_id)) as assigned_party, to_char(dead.deadline,'Mon.DD, YYYY') as deadline_pretty, - content_workflow.is_overdue(c.case_id, ca.transition_key) as is_overdue + content_workflow.is_overdue(c.case_id, trans.transition_key) as is_overdue from wf_cases c, wf_case_assignments ca, wf_case_deadlines dead, wf_transitions trans, cr_items i @@ -71,7 +71,7 @@ and c.case_id = dead.case_id and - ca.transition_key = trans.transition_key + ca.role_key = trans.role_key and dead.transition_key = trans.transition_key and @@ -86,11 +86,11 @@ and case_id = c.case_id and - transition_key = ca.transition_key ) + transition_key = trans.transition_key ) and -- its finished - content_workflow.is_finished(c.case_id, ca.transition_key) = 'f' - -- ca.transition_key = transition + content_workflow.is_finished(c.case_id, trans.transition_key) = 'f' + -- trans.transition_key = transition $transition_sql order by trans.sort_order, title, assigned_party, dead.deadline desc Index: openacs-4/packages/cms/www/modules/workflow/workflow-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/workflow-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workflow/workflow-postgresql.xql 25 May 2001 23:49:05 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workflow/workflow-postgresql.xql 19 Nov 2001 18:43:25 -0000 1.2 @@ -37,7 +37,7 @@ and t.transition_key = trans.transition_key and - ca.transition_key = t.transition_key + ca.role_key = trans.role_key and t.state in ('started','enabled') $transition_sql @@ -52,11 +52,11 @@ select - ca.transition_key, transition_name, ca.party_id, + trans.transition_key, transition_name, ca.party_id, item_id, content_item__get_title(item_id,'f') as title, coalesce(party__name(ca.party_id),person__name(ca.party_id)) as assigned_party, to_char(dead.deadline,'Mon.DD, YYYY') as deadline_pretty, - content_workflow__is_overdue(c.case_id, ca.transition_key) as is_overdue + content_workflow__is_overdue(c.case_id, trans.transition_key) as is_overdue from wf_cases c, wf_case_assignments ca, wf_case_deadlines dead, wf_transitions trans, cr_items i @@ -71,7 +71,7 @@ and c.case_id = dead.case_id and - ca.transition_key = trans.transition_key + ca.role_key = trans.role_key and dead.transition_key = trans.transition_key and @@ -86,11 +86,11 @@ and case_id = c.case_id and - transition_key = ca.transition_key ) + transition_key = trans.transition_key ) and -- its finished - content_workflow__is_finished(c.case_id, ca.transition_key) = 'f' - -- ca.transition_key = transition + content_workflow__is_finished(c.case_id, trans.transition_key) = 'f' + -- trans.transition_key = transition $transition_sql order by trans.sort_order, title, assigned_party, dead.deadline desc Index: openacs-4/packages/cms/www/modules/workflow/workflow.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/workflow.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/workflow/workflow.tcl 24 May 2001 23:57:17 -0000 1.2 +++ openacs-4/packages/cms/www/modules/workflow/workflow.tcl 19 Nov 2001 18:43:25 -0000 1.3 @@ -26,7 +26,7 @@ ns_log notice "workflow.tcl - Bad transition - $transition" forward "workflow" } - set transition_sql "and ca.transition_key = :transition" + set transition_sql "and ca.role_key = trans.role_key" } Index: openacs-4/packages/cms/www/modules/workspace/assignments-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workspace/assignments-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workspace/assignments-oracle.xql 8 Jun 2001 01:44:53 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workspace/assignments-oracle.xql 19 Nov 2001 18:42:10 -0000 1.2 @@ -23,7 +23,8 @@ wf_transitions trans, wf_tasks task, wf_cases case, - wf_case_deadlines dead + wf_case_deadlines dead, + wf_transition_role_assign_map trans_role where dead.case_id = case.case_id and @@ -33,7 +34,9 @@ and assign.case_id = task.case_id and - assign.transition_key = task.transition_key + assign.role_key = trans_role.assign_role_key + and + task.transition_key = trans_role.transition_key and task.state = 'started' and Index: openacs-4/packages/cms/www/modules/workspace/assignments-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workspace/assignments-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workspace/assignments-postgresql.xql 8 Jun 2001 01:44:53 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workspace/assignments-postgresql.xql 19 Nov 2001 18:42:10 -0000 1.2 @@ -23,7 +23,8 @@ wf_transitions trans, wf_tasks task, wf_cases cases, - wf_case_deadlines dead + wf_case_deadlines dead, + wf_transition_role_assign_map trans_role where dead.case_id = cases.case_id and @@ -33,7 +34,9 @@ and assign.case_id = task.case_id and - assign.transition_key = task.transition_key + assign.role_key = trans_role.assign_role_key + and + task.transition_key = trans_role.transition_key and task.state = 'started' and Index: openacs-4/packages/cms/www/modules/workspace/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workspace/index-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workspace/index-oracle.xql 8 Jun 2001 01:44:53 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workspace/index-oracle.xql 19 Nov 2001 18:42:10 -0000 1.2 @@ -35,7 +35,9 @@ and assign.case_id = task.case_id and - assign.transition_key = task.transition_key + assign.role_key = trans.role_key + and + task.transition_key = trans.transition_key and ( task.state = 'enabled' or (task.state = 'started' and task.holding_user = :user_id) Index: openacs-4/packages/cms/www/modules/workspace/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workspace/index-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/workspace/index-postgresql.xql 8 Jun 2001 01:44:53 -0000 1.1 +++ openacs-4/packages/cms/www/modules/workspace/index-postgresql.xql 19 Nov 2001 18:42:10 -0000 1.2 @@ -35,7 +35,9 @@ and assign.case_id = task.case_id and - assign.transition_key = task.transition_key + assign.role_key = trans.role_key + and + task.transition_key = trans.transition_key and ( task.state = 'enabled' or (task.state = 'started' and task.holding_user = :user_id) @@ -55,3 +57,13 @@ + + + + + + + + + +