Index: openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/upgrade/upgrade-4.1.1-4.3.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/upgrade/upgrade-4.1.1-4.3.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/obsolete-packages/acs-workflow/sql/postgresql/upgrade/upgrade-4.1.1-4.3.sql 19 Nov 2001 18:22:16 -0000 1.1 @@ -0,0 +1,697 @@ +/* + * We've added support for roles, which is an intermediate step between + * transitions and assignments. A role is a relationship to a process, e.g., + * an editor, publisher, submitter, fixer, doctor, manager, etc. + * A task is performed by a role, but one role may have many tasks to perform. + * The idea is that when you reassign a role, it affects all the tasks that role + * has been assigned to. + * + * For the upgrade, we simply create one role per transtiion, and change + * all the other tables correspondingly. This will execute exactly equivalent + * to the way it would have without the roles refactoring. + * + * We've also added other minor things, such as task instructions and gotten rid + * of wf_attribute_info. + */ + + + +/* + * Table wf_roles: + * Added. + */ + +create table wf_roles ( + role_key varchar(100), + workflow_key varchar(100) + constraint wf_roles_workflow_fk + references wf_workflows(workflow_key) + on delete cascade, + role_name varchar(100) + constraint wf_role_role_name_nn + not null, + -- so we can display roles in some logical order -- + sort_order integer + constraint wf_roles_order_ck + check (sort_order > 0), + -- table constraints -- + constraint wf_role_pk + primary key (workflow_key, role_key), + constraint wf_roles_wf_key_role_name_un + unique (workflow_key, role_name) +); + +comment on table wf_roles is ' + A process has certain roles associated with it, such as "submitter", + "reviewer", "editor", "claimant", etc. For each transition, then, you + specify what role is to perform that task. Thus, two or more tasks can be + performed by one and the same role, so that when the role is reassigned, + it reflects assignments of both tasks. Users and parties are then assigned + to roles instead of directly to tasks. +'; + + + +/* + * Now populate the roles table: + * We just create a role per transition, then hook them up + */ + +insert into wf_roles + (workflow_key, + role_key, + role_name, + sort_order) +select workflow_key, transition_key, transition_name, sort_order + from wf_transitions; + + +/* + * Table wf_transitions: + * Added column role_key. + * Added foreign key constraint wf_transition_role_fk. + */ + +alter table wf_transitions add role_key varchar(100); + + +alter table wf_transitions add constraint wf_transition_role_fk + foreign key (workflow_key,role_key) references wf_roles(workflow_key,role_key); + /* We don't do on delete cascade here, because that would mean that + * when a role is deleted, the transitions associated with that role would be deleted, too */ + + +/* Now populate the new column corresponding to the roles we just created: + * Since there's a one-to-one role per transition, and the have the same keys, + * we just set role_key = transition_key + */ + +update wf_transitions + set role_key = transition_key; + +/* + * Table wf_transition_role_assign_map: + * Added. + * This replaces wf_transtiion_assign_map, since transitions now assign + * roles instead of other transitions. + */ + +create table wf_transition_role_assign_map ( + workflow_key varchar(100) + constraint wf_role_asgn_map_workflow_fk + references wf_workflows(workflow_key) + on delete cascade, + transition_key varchar(100), + assign_role_key varchar(100), + -- table constraints -- + constraint wf_role_asgn_map_pk + primary key (workflow_key, transition_key, assign_role_key), + constraint wf_role_asgn_map_trans_fk + foreign key (workflow_key, transition_key) references wf_transitions(workflow_key, transition_key) + on delete cascade, + constraint wf_tr_role_asgn_map_asgn_fk + foreign key (workflow_key, assign_role_key) references wf_roles(workflow_key, role_key) + on delete cascade +); + +create index wf_role_asgn_map_wf_trans_idx on wf_transition_role_assign_map(workflow_key, transition_key); +create index wf_role_asgn_map_wf_as_tr_idx on wf_transition_role_assign_map(workflow_key, assign_role_key); + +comment on table wf_transition_role_assign_map is ' + When part of the output of one task is to assign users to a role, + specify that this is the case by inserting a row here. +'; + +comment on column wf_transition_role_assign_map.transition_key is ' + transition_key is the assigning transition. +'; + +comment on column wf_transition_role_assign_map.assign_role_key is ' + assign_role_key is the role being assigned a user to. +'; + + +/* Populate new wf_transition_role_assign_map with the rows from + * wf_transition_assignment_map. Since role_key map one-to-one with transition_keys + * in this upgrade, that's pretty straight-forward. + */ + +insert into wf_transition_role_assign_map + (workflow_key, + transition_key, + assign_role_key) +select workflow_key, + transition_key, + assign_transition_key + from wf_transition_assignment_map; + +/* + * Table wf_transition_assignment_map: + * Dropped. + * This table is no longer releavnt, since transitions don't assign other + * transitions, they assign roles. + */ + +drop table wf_transition_assignment_map; + + +/* + * Table wf_attribute_info: + * Dropped. + * This table was a hang-over from earlier versions and is no longer necessary. + */ + +drop table wf_attribute_info; + +/* + * Table wf_context_role_info: + * Added. + */ + +create table wf_context_role_info ( + context_key varchar(100) + constraint wf_context_role_context_fk + references wf_contexts(context_key) + on delete cascade, + workflow_key varchar(100) + constraint wf_context_role_workflow_fk + references wf_workflows(workflow_key) + on delete cascade, + role_key varchar(100), + /* + * Callback to programatically assign a role. + * Must call wordflow_case.*_role_assignment to make the assignments. + * Will be called when a transition for that role becomes enabled + * signature: (role_key in varchar2, custom_arg in varchar2) + */ + assignment_callback varchar(100), + assignment_custom_arg text, + -- table constraints -- + constraint wf_context_role_role_fk + foreign key (workflow_key, role_key) references wf_roles(workflow_key, role_key) + on delete cascade, + constraint wf_context_role_info_pk + primary key (context_key, workflow_key, role_key) +); + +comment on table wf_context_role_info is ' + This table holds context-dependent info for roles, currently only the assignment callback +'; + + +/* Populate by a straight copy from wf_context_transition_info */ + +insert into wf_context_role_info + (context_key, + workflow_key, + role_key, + assignment_callback, + assignment_custom_arg) +select context_key, + workflow_key, + transition_key, + assignment_callback, + assignment_custom_arg + from wf_context_transition_info + where assignment_callback is not null + or assignment_custom_arg is not null; + +/* + * Table wf_context_transition_info: + */ +create table temp as select + context_key, + workflow_key, + transition_key, + estimated_minutes, + enable_callback, + enable_custom_arg, + fire_callback, + fire_custom_arg, + time_callback, + time_custom_arg, + deadline_callback, + deadline_custom_arg, + deadline_attribute_name, + hold_timeout_callback, + hold_timeout_custom_arg, + notification_callback, + notification_custom_arg, + unassigned_callback, + unassigned_custom_arg, + access_privilege +from wf_context_transition_info; + +drop table wf_context_transition_info; + +create table wf_context_transition_info ( + context_key varchar(100) + constraint wf_context_trans_context_fk + references wf_contexts, + workflow_key varchar(100) + constraint wf_context_trans_workflow_fk + references wf_workflows, + transition_key varchar(100), + /* information for the transition in the context */ + /* The integer of minutes this task is estimated to take */ + estimated_minutes integer, + /* Instructions for how to complete the task. Will be displayed on the task page. */ + instructions text, + /* + * Will be called when the transition is enabled/fired. + * signature: (case_id in integer, transition_key in varchar, custom_arg in varchar2) + */ + enable_callback varchar(100), + enable_custom_arg text, + fire_callback varchar(100), + fire_custom_arg text, + /* + * Must return the date that the timed transition should fire + * Will be called when the transition is enabled + * signature: (case_id in integer, transition_key in varchar, custom_arg in varchar2) return date + */ + time_callback varchar(100), + time_custom_arg text, + /* + * Returns the deadline for this task. + * Will be called when the transition becomes enabled + * Signature: (case_id in integer, transition_key in varchar, custom_arg in varchar2) return date + */ + deadline_callback varchar(100), + deadline_custom_arg text, + /* The name of an attribute that holds the deadline */ + deadline_attribute_name varchar(100), + /* + * Must return the date that the user's hold on the task times out. + * called when the user starts the task. + * signature: (case_id in integer, transition_key in varchar, custom_arg in varchar2) return date + */ + hold_timeout_callback varchar(100), + hold_timeout_custom_arg text, + /* + * Notification callback + * Will be called when a notification is sent i.e., when a transition is enabled, + * or assignment changes. + * signature: (task_id in integer, + * custom_arg in varchar, + * party_to in integer, + * party_from in out integer, + * subject in out varchar, + * body in out varchar) + */ + notification_callback varchar(100), + notification_custom_arg text, + /* + * Callback to handle unassigned tasks. + * Will be called when an enabled task becomes unassigned. + * Signature: (task_id in number, custom_arg in varchar2) + */ + unassigned_callback varchar(100), + unassigned_custom_arg text, + -- table constraints -- + constraint wf_context_trans_trans_fk + foreign key (workflow_key, transition_key) references wf_transitions(workflow_key, transition_key) + on delete cascade, + constraint wf_context_transition_pk + primary key (context_key, workflow_key, transition_key) +); + +create index wf_ctx_trans_wf_trans_idx on wf_context_transition_info(workflow_key, transition_key); + +comment on table wf_context_transition_info is ' + This table holds information that pertains to a transition in a specific context. + It will specifically hold +'; + +insert into wf_context_transition_info select * from temp; +drop table temp; + + +/* + * Table wf_context_workflow_info: + * Added. + */ + +create table wf_context_workflow_info ( + context_key varchar(100) + constraint wf_context_wf_context_fk + references wf_contexts + on delete cascade, + workflow_key varchar(100) + constraint wf_context_wf_workflow_fk + references wf_workflows + on delete cascade, + /* The principal is the user/party that sends out email assignment notifications + * And receives email when a task becomes unassigned (for more than x minutes?) + */ + principal_party integer + constraint wf_context_wf_principal_fk + references parties + on delete set null, + -- table constraints -- + constraint wf_context_workflow_pk + primary key (context_key, workflow_key) +); + +/* Insert someone for all existing processes. Hopefully this will be the administrator user. */ + +insert into wf_context_workflow_info + (context_key, + workflow_key, + principal_party) +select 'default', workflow_key, (select min(party_id) from parties) + from wf_workflows; + + +/* + * Table wf_context_task_panels: + * Added columns overrides_action_p and only_display_when_started_p + * Renamed column sort_key to sort_order for consistency + */ +create table temp as select +context_key, +workflow_key, +transition_key, +sort_key as sort_order, +header, +template_url +from wf_context_task_panels; + +drop table wf_context_task_panels; + + +create table wf_context_task_panels ( + context_key varchar(100) not null + constraint wf_context_panels_context_fk + references wf_contexts(context_key) + on delete cascade, + workflow_key varchar(100) not null + constraint wf_context_panels_workflow_fk + references wf_workflows(workflow_key) + on delete cascade, + transition_key varchar(100) not null, + sort_order integer not null, + header varchar(200) not null, + template_url varchar(500) not null, + /* Display this panel in place of the action panel */ + overrides_action_p char(1) default 'f' + constraint wf_context_panels_ovrd_p_ck + check (overrides_action_p in ('t','f')), + /* Display this panel only when the task has been started (and not finished) */ + only_display_when_started_p char(1) default 'f' + constraint wf_context_panels_display_p_ck + check (only_display_when_started_p in ('t','f')), + -- table constraints -- + constraint wf_context_panels_trans_fk + foreign key (workflow_key, transition_key) references wf_transitions(workflow_key, transition_key) + on delete cascade, + constraint wf_context_panels_pk + primary key (context_key, workflow_key, transition_key, sort_order) +); + +create index wf_ctx_panl_workflow_trans_idx on wf_context_task_panels(workflow_key, transition_key); + +comment on table wf_context_task_panels is ' + Holds information about the panels to be displayed on the task page. +'; + +insert into wf_context_task_panels select * from temp; +drop table temp; + + + +/* + * Table wf_context_assignments + * Replaced transition_key with role_key + */ +create table temp as select + context_key, + workflow_key, + transition_key as role_key, + party_id +from wf_context_assignments; + +drop table wf_context_assignments; + +create table wf_context_assignments ( + context_key varchar(100) + constraint wf_context_assign_context_fk + references wf_contexts(context_key) + on delete cascade, + workflow_key varchar(100) + constraint wf_context_assign_workflow_fk + references wf_workflows(workflow_key) + on delete cascade, + role_key varchar(100), + party_id integer + constraint wf_context_assign_party_fk + references parties(party_id) + on delete cascade, + -- table constraints -- + constraint wf_context_assign_pk + primary key (context_key, workflow_key, role_key, party_id), + constraint wf_context_assign_role_fk + foreign key (workflow_key, role_key) references wf_roles(workflow_key, role_key) + on delete cascade +); + +create index wf_ctx_assg_workflow_trans_idx on wf_context_assignments(workflow_key, role_key); + +comment on table wf_context_assignments is ' + Static (default) per-context assignments of roles to parties. +'; + +insert into wf_context_assignments select * from temp; +drop table temp; + + + +/* + * Table wf_case_assignments: + * Changed transition_key to role_key + */ + +create table temp as select + case_id, + workflow_key, + transition as role_key, + party_id +from wf_case_assignments; + +drop table wf_case_assignments; + +create table wf_case_assignments ( + case_id integer + constraint wf_case_assign_fk + references wf_cases(case_id) + on delete cascade, + workflow_key varchar(100), + role_key varchar(100), + party_id integer + constraint wf_case_assign_party_fk + references parties(party_id) + on delete cascade, + -- table constraints -- + constraint wf_case_assign_pk + primary key (case_id, role_key, party_id), + constraint wf_case_assign_role_fk + foreign key (workflow_key, role_key) references wf_roles(workflow_key, role_key) + on delete cascade +); + +create index wf_case_assgn_party_idx on wf_case_assignments(party_id); + +comment on table wf_case_assignments is ' + Manual per-case assignments of roles to parties. +'; + +insert into wf_case_assignments select * from temp; +drop table temp; + + +/* + * View wf_transition_contexts: + * Added column role_key. + */ +drop view wf_transition_contexts; +create view wf_transition_contexts as +select t.transition_key, + t.transition_name, + t.workflow_key, + t.sort_order, + t.trigger_type, + t.role_key, + c.context_key, + c.context_name +from wf_transitions t, wf_contexts c; + + + +/* + * View wf_transition_info: + * Added columns role_key and instructions. + * Removed columns assignment_callback/custom_arg. + */ +drop view wf_transition_info; +create view wf_transition_info as +select t.transition_key, + t.transition_name, + t.workflow_key, + t.sort_order, + t.trigger_type, + t.context_key, + t.role_key, + ct.estimated_minutes, + ct.instructions, + ct.enable_callback, + ct.enable_custom_arg, + ct.fire_callback, + ct.fire_custom_arg, + ct.time_callback, + ct.time_custom_arg, + ct.deadline_callback, + ct.deadline_custom_arg, + ct.deadline_attribute_name, + ct.hold_timeout_callback, + ct.hold_timeout_custom_arg, + ct.notification_callback, + ct.notification_custom_arg, + ct.unassigned_callback, + ct.unassigned_custom_arg +from wf_transition_contexts t LEFT OUTER JOIN wf_context_transition_info ct ON ( + ct.workflow_key = t.workflow_key + and ct.transition_key = t.transition_key + and ct.context_key = t.context_key); + + +/* + * View wf_role_info: + * Added. + */ + +drop view wf_role_info; +create view wf_role_info as +select r.role_key, + r.role_name, + r.workflow_key, + c.context_key, + cr.assignment_callback, + cr.assignment_custom_arg +from wf_contexts c, wf_roles r LEFT OUTER JOIN wf_context_role_info cr ON ( + cr.workflow_key = r.workflow_key + and cr.role_key = r.role_key) +where cr.context_key = c.context_key; + + +/* + * View wf_enabled_transitions: + * Added columns role_key and instructions. + * Removed columns assignment_callback/custom_arg. + */ + +drop view wf_enabled_transitions; +create view wf_enabled_transitions as +select c.case_id, + t.transition_key, + t.transition_name, + t.workflow_key, + t.sort_order, + t.trigger_type, + t.context_key, + t.role_key, + t.enable_callback, + t.enable_custom_arg, + t.fire_callback, + t.fire_custom_arg, + t.time_callback, + t.time_custom_arg, + t.deadline_callback, + t.deadline_custom_arg, + t.deadline_attribute_name, + t.hold_timeout_callback, + t.hold_timeout_custom_arg, + t.notification_callback, + t.notification_custom_arg, + t.estimated_minutes, + t.instructions, + t.unassigned_callback, + t.unassigned_custom_arg + from wf_transition_info t, + wf_cases c + where t.workflow_key = c.workflow_key + and t.context_key = c.context_key + and c.state = 'active' + and not exists + (select tp.place_key + from wf_transition_places tp + where tp.transition_key = t.transition_key + and tp.workflow_key = t.workflow_key + and tp.direction = 'in' + and not exists + (select tk.token_id + from wf_tokens tk + where tk.place_key = tp.place_key + and tk.case_id = c.case_id + and tk.state = 'free' + ) + ); + + +/* + * View wf_user_tasks: + * Added column instructions + * Added "and tr.workflow_key = ta.workflow_key" to where clause + * (looks like a bug) + */ + +drop view wf_user_tasks; +create view wf_user_tasks as +select distinct ta.task_id, + ta.case_id, + ta.workflow_key, + ta.transition_key, + tr.transition_name, + tr.instructions, + ta.enabled_date, + ta.started_date, + u.user_id, + ta.state, + ta.holding_user, + ta.hold_timeout, + ta.deadline, + ta.estimated_minutes +from wf_tasks ta, + wf_task_assignments tasgn, + wf_cases c, + wf_transition_info tr, + party_approved_member_map m, + users u +where ta.state in ( 'enabled','started') +and c.case_id = ta.case_id +and c.state = 'active' +and tr.transition_key = ta.transition_key +and tr.workflow_key = ta.workflow_key +and tr.trigger_type = 'user' +and tr.context_key = c.context_key +and tasgn.task_id = ta.task_id +and m.party_id = tasgn.party_id +and u.user_id = m.member_id; + + + +drop function __workflow__simple_p (varchar,integer); +drop table guard_list; +drop table target_place_list; +drop table previous_place_list; +drop sequence workflow_session_id; +drop function sweep_hold_timeout (); +drop function sweep_timed_transitions (); + +select drop_package('workflow'); +select drop_package('workflow_case'); + + +\i workflow-package.sql +\i workflow-case-package-head.sql +\i workflow-case-package-body.sql + Index: openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-oracle.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-oracle.xql 14 May 2001 23:16:08 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-oracle.xql 19 Nov 2001 18:25:09 -0000 1.3 @@ -1,13 +1,14 @@ + oracle8.1.6 - + select p.party_id, acs_object.name(p.party_id) as name, - case when p.email = '' then '' else '(' || p.email || ')' end as email + case when p.email = '' then '' else '('||p.email||' end') as email from parties p where 0 < (select count(*) from users u, @@ -18,40 +19,13 @@ - - - - select p.party_id, - acs_object.name(p.party_id) as name, - case when p.email = '' then '' else '(' || p.email || ')' end as email - from parties p - where 0 < (select count(*) - from users u, - party_approved_member_map m - where m.party_id = p.party_id - and u.user_id = m.member_id) - - - - - - - - select acs_object.name(party_id) as name - from parties - where party_id = :value - - - - - - + select p.party_id, acs_object.name(p.party_id) as name, - decode(p.email, '', '', '('||p.email||')') as email + case when p.email = '' then '' else '('||p.email||' end') as email from parties p where 0 < (select count(*) from users u, Index: openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-postgresql.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-postgresql.xql 14 May 2001 23:16:08 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs-postgresql.xql 19 Nov 2001 18:25:09 -0000 1.3 @@ -1,13 +1,14 @@ + postgresql7.1 - + select p.party_id, acs_object__name(p.party_id) as name, - case when p.email = '' then '' else '(' || p.email || ')' end as email + case when p.email = '' then '' else '('||p.email||')' end as email from parties p where 0 < (select count(*) from users u, @@ -18,40 +19,13 @@ + - - select p.party_id, - acs_object__name(p.party_id) as name, - case when p.email = '' then '' else '(' || p.email || ')' end as email - from parties p - where 0 < (select count(*) - from users u, - party_approved_member_map m - where m.party_id = p.party_id - and u.user_id = m.member_id) - - - - - - - - select acs_object__name(party_id) as name - from parties - where party_id = :value - - - - - - - - select p.party_id, acs_object__name(p.party_id) as name, - case when p.email = '' then '' else '(' || p.email || ')' end as email + case when p.email = '' then '' else '('||p.email||')' end as email from parties p where 0 < (select count(*) from users u, Index: openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/display-procs.tcl 19 Nov 2001 18:25:09 -0000 1.2 @@ -93,18 +93,6 @@ boolean { set value [ad_decode $value "t" "Yes" "No"] } - number { - switch $attribute(wf_datatype) { - party { - db_1row party_info { - select acs_object.name(party_id) as name - from parties - where party_id = :value - } - set value "[ad_present_user $value $name]" - } - } - } } return $value } @@ -115,7 +103,8 @@ ad_proc wf_assignment_widget { {-name ""} - transition_info + -case_id + role_key } { Returns an HTML fragment containing a form element for entering the value of an attribute.

@@ -124,12 +113,22 @@ @author Lars Pind (lars@pinds.com) @creation-date 10 July, 2000 } { - array set transition $transition_info - if { [empty_string_p $name] } { - set name "assignments.$transition(transition_key)" + set name "assignments.$role_key" } + if { [info exists case_id] && ![empty_string_p $case_id] } { + set current_assignments [db_list assignment_select " + select ca.party_id + from wf_case_assignments ca, wf_cases c + where c.case_id = :case_id + and ca.role_key = :role_key + and ca.workflow_key = c.workflow_key + "] + } else { + set current_assignments {} + } + set widget "" Index: openacs-4/contrib/obsolete-packages/acs-workflow/tcl/graph-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/graph-procs.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/graph-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/graph-procs.tcl 19 Nov 2001 18:25:09 -0000 1.2 @@ -223,6 +223,7 @@ ad_proc wf_generate_dot_representation { {-orientation portrait} {-rankdir UD} + {-size} workflow_varname } { Generates a dot-file for use with Graphviz. @@ -248,21 +249,13 @@ foreach type { transition place } { foreach key $workflow(${type}s) { set workflow($type,$key,style) solid - set workflow($type,$key,shape) [ad_decode $type transition "box" "ellipse"] - set workflow($type,$key,label) $workflow($type,$key,${type}_name) - if { [string equal $type "place"] } { - if { [string equal $workflow($type,$key,${type}_key) "start"] } { - append workflow($type,$key,label) {\n[+]} - } elseif { [string equal $workflow($type,$key,${type}_key) "end"] } { - append workflow($type,$key,label) {\n[-]} - } - } - if { [string equal $type transition] && ![string equal $workflow($type,$key,trigger_type) user] } { - append workflow($type,$key,label) "\\n($workflow($type,$key,trigger_type))" - } - - set workflow($type,$key,fontsize) [ad_decode $type transition $transition_font_size $place_font_size] - set workflow($type,$key,fontname) [ad_decode $type transition $transition_font_name $place_font_name] + set workflow($type,$key,shape) [ad_decode $type "transition" "box" "circle"] + set workflow($type,$key,label) [ad_decode $type "transition" $workflow($type,$key,${type}_name) ""] + set workflow($type,$key,peripheries) 1 + set workflow($type,$key,fontname) [ad_decode $type "transition" $transition_font_name $place_font_name] + set workflow($type,$key,fontsize) [ad_decode $type "transition" $transition_font_size $place_font_size] + set workflow($type,$key,height) [ad_decode $type "transition" 0.4 0.2] + set workflow($type,$key,width) [ad_decode $type "transition" 0.4 0.2] set workflow($type,$key,URL) $workflow($type,$key,url) if { ![empty_string_p $workflow($type,$key,URL)] } { @@ -271,6 +264,30 @@ set workflow($type,$key,color) grey } set workflow($type,$key,fontcolor) $workflow($type,$key,color) + + #set workflow($type,$key,fillcolor) blue + #set workflow($type,$key,color) black + #set workflow($type,$key,style) filled + + if { [string equal $type "place"] } { + switch $workflow($type,$key,${type}_key) { + start { + append workflow($type,$key,label) {S} + set workflow($type,$key,peripheries) 2 + } + end { + append workflow($type,$key,label) {E} + set workflow($type,$key,peripheries) 2 + } + default { + set workflow($type,$key,fontsize) 1 + } + } + } + if { [string equal $type transition] && ![string equal $workflow($type,$key,trigger_type) user] } { + append workflow($type,$key,label) "\\n($workflow($type,$key,trigger_type))" + } + } } @@ -292,23 +309,31 @@ set dot_text "digraph workflow {\n" append dot_text " orientation=$orientation;\n" append dot_text " rankdir=$rankdir;\n" + append dot_text " ratio=compress;\n" + if { [info exists size] && ![empty_string_p $size] } { + append dot_text " size=\"$size\";\n" + } foreach place_key $workflow(places) { set attributes [list] - foreach attr { fontsize label URL color fontname fontcolor style shape } { - set val $workflow(place,$place_key,$attr) - regsub -all {"} $val {\"} val - lappend attributes "$attr=\"$val\"" + foreach attr { fontsize label URL color fontname fontcolor style shape peripheries fillcolor height width fixedsize } { + if { [info exists workflow(place,$place_key,$attr)] } { + set val $workflow(place,$place_key,$attr) + regsub -all {"} $val {\"} val + lappend attributes "$attr=\"$val\"" + } } append dot_text " node \[ [join $attributes " "] \]; \"place,$place_key\";\n" } foreach transition_key $workflow(transitions) { set attributes [list] - foreach attr { fontsize label URL color fontname fontcolor style shape } { - set val $workflow(transition,$transition_key,$attr) - regsub -all {"} $val {\"} val - lappend attributes "$attr=\"$val\"" + foreach attr { fontsize label URL color fontname fontcolor style shape peripheries fillcolor height width fixedsize } { + if { [info exists workflow(transition,$transition_key,$attr)] } { + set val $workflow(transition,$transition_key,$attr) + regsub -all {"} $val {\"} val + lappend attributes "$attr=\"$val\"" + } } append dot_text " node \[ [join $attributes " "] \]; \"transition,$transition_key\";\n" } @@ -323,6 +348,8 @@ lappend attributes "fontsize=\"$guard_font_size\"" lappend attributes "fontcolor=red" lappend attributes "color=$workflow(arc_color)" + lappend attributes "minlen=1" + #lappend attributes "decorate=1" append dot_text " \"$workflow(arc,$arc,from)\" -> \"$workflow(arc,$arc,to)\" \[ [join $attributes " "] \]; \n" } @@ -420,9 +447,9 @@ set lines [split $ismap "\n"] foreach line $lines { - if { [regexp {^\s*([^\s]+)\s+\(([0-9]+),([0-9]+)\)\s+\(([0-9]+),([0-9]+)\)\s+([^\s]+)$} $line match shape c1 c2 c3 c4 href] } { - append client_map "\n" - } + if { [regexp {^\s*([^\s]+)\s+\(([0-9]+),([0-9]+)\)\s+\(([0-9]+),([0-9]+)\)\s+([^\s]+)(.*)$} $line match shape c1 c2 c3 c4 href alt] } { + append client_map "\"$alt\"\n" + } } append client_map "\n" Index: openacs-4/contrib/obsolete-packages/acs-workflow/tcl/wizard-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/wizard-procs.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/wizard-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/wizard-procs.tcl 19 Nov 2001 18:25:09 -0000 1.2 @@ -159,6 +159,7 @@ return $html } + ad_proc wf_wizard_massage_tasks { the_tasks list_var @@ -181,8 +182,9 @@ @creation-date 29 September, 2000 } { - # Note also: This whole way of representing the information here in three or four different formats, actually sucks. - # Don't do this if you happen to be porting this to a real language. + # Note also: This whole way of representing the information here in three or four different formats, + # actually sucks. + # Don't do this if you happen to be porting this to a real language (e.g., Java) if { ![empty_string_p $list_var] } { upvar 1 $list_var the_list Index: openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs-oracle.xql,v diff -u -N -r1.4 -r1.5 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs-oracle.xql 17 May 2001 05:35:35 -0000 1.4 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs-oracle.xql 19 Nov 2001 18:25:09 -0000 1.5 @@ -3,22 +3,214 @@ oracle8.1.6 + + + + select case_id, + acs_object.name(object_id) as object_name, + + state + from wf_cases + where case_id = :case_id + + + + + + + + + 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 + + + + + + + + + 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 + :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 + 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; + + + + + + + + + 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; + + + + + @@ -42,280 +234,476 @@ creation_user => :user_id, creation_ip => :creation_ip ); end; + + + + + 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 + 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; + + + + + + + + begin - :1 := journal_entry.new( - object_id => :case_id, - action => 'comment', - creation_user => :user_id, - creation_ip => :ip_address, - msg => :msg + workflow_case.remove_manual_assignment( + case_id => :case_id, + role_key => :role_key, + party_id => :party_id ); end; - + - begin :1 := workflow.simple_p(:workflow_key); end; + + begin + workflow_case.clear_manual_assignments( + case_id => :case_id, + role_key => :role_key + ); + end; + - + + - select case_id, - acs_object.name(object_id) as object_name, - - state - from wf_cases - where case_id = :case_id + begin + workflow_case.add_task_assignment( + task_id => :task_id, + party_id => :party_id, + permanent_p => :permanent_value + ); + 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; + + + - 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, - 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, - tr.access_privilege, - 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 + + + + + begin + workflow_case.set_case_deadline( + case_id => :case_id, + transition_key => :transition_key, + deadline => :deadline + ); + end; - + + - select a.attribute_id, - a.attribute_name, - a.pretty_name, - a.datatype, - acs_object.get_attribute(c.case_id, a.attribute_name) as value, - wfai.wf_datatype, - '' as attribute_widget - from acs_attributes a, wf_transition_attribute_map m, wf_tasks t, wf_cases c, wf_attribute_info wfai - where t.task_id = :task_id - and c.case_id = t.case_id - and m.workflow_key = c.workflow_key - and m.transition_key = t.transition_key - and a.attribute_id = m.attribute_id - and wfai.attribute_id = a.attribute_id - order by m.sort_order + begin + workflow_case.remove_case_deadline( + case_id => :case_id, + transition_key => :transition_key + ); + end; - + + - 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 + 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; + + + - 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 + workflow.add_role( + workflow_key => :workflow_key, + role_key => :role_key, + role_name => :role_name, + sort_order => :sort_order + ); + end; + - + - begin - workflow_case.set_attribute_value( - journal_id => :journal_id, - attribute_name => :attribute_name, - value => :value - ); - end; - + begin + workflow.move_role_up( + workflow_key => :workflow_key, + role_key => :role_key + ); + end; + - + + - - begin - workflow_case.clear_manual_assignments( - case_id => :case_id, - transition_key => :transition_key - ); - end; - + + begin + workflow.move_role_down( + workflow_key => :workflow_key, + role_key => :role_key + ); + end; + - + + - begin - workflow_case.add_manual_assignment( - case_id => :case_id, - transition_key => :transition_key, - party_id => :party_id - ); - end; - + begin + workflow.delete_role( + workflow_key => :workflow_key, + role_key => :role_key + ); + end; + - + + + begin - workflow_case.end_task_action( - journal_id => :journal_id, - action => :action, - task_id => :task_id - ); - end; - + 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_case.fire_message_transition( - task_id => :task_id + workflow.delete_transition( + workflow_key => :workflow_key, + transition_key => :transition_key ); - end; + end; - + begin - workflow_case.suspend( - case_id => :case_id, - user_id => :user_id, - ip_address => :ip_address, - msg => :msg + 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; + end; - + begin - workflow_case.resume( - case_id => :case_id, - user_id => :user_id, - ip_address => :ip_address, - msg => :msg + 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; + end; - + begin - workflow_case.cancel( - case_id => :case_id, - user_id => :user_id, - ip_address => :ip_address, - msg => :msg + workflow.add_arc( + workflow_key => :workflow_key, + transition_key => :to_transition_key, + place_key => :from_place_key ); - end; + 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]' + 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; / @@ -324,66 +712,138 @@ - - -declare - v_attribute_id acs_attributes.attribute_id%TYPE; + + 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 + + - 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]' - ); - + + +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 - - - insert into wf_transition_attribute_map - (workflow_key, - transition_key, - attribute_id, - sort_order) - values - ('[db_quote $new_workflow_key]', - '[db_quote $transition_key]', - v_attribute_id, - [ad_decode $sort_order "" "null" $sort_order]); + + +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 number; +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; +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 - - -commit; + + +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/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs-postgresql.xql,v diff -u -N -r1.6 -r1.7 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs-postgresql.xql 16 May 2001 00:40:41 -0000 1.6 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs-postgresql.xql 19 Nov 2001 18:25:09 -0000 1.7 @@ -3,303 +3,637 @@ postgresql7.1 + + + + select case_id, + acs_object__name(object_id) as object_name, + + state + from wf_cases + where case_id = :case_id + + + + + + + + + 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 - current_timestamp as days_till_deadline, + tr.estimated_minutes, + current_timestamp + from wf_tasks t left outer join parties p + on p.party_id = t.holding_user, + wf_cases c, + wf_transition_info tr, + acs_objects o, + acs_object_types ot + 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 + + + + + + + + + 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 + + + + + + + + + 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 left outer join parties p + on p.party_id = o.creation_user + where j.object_id = :case_id + and o.object_id = j.journal_id + order by o.creation_date $sql_order + + + + + + + select workflow_case__begin_task_action ( + :task_id, + :action, + :modifying_ip, + :user_id, + :msg); + + + - select workflow_case__begin_task_action( - :task_id, - :action, - :modifying_ip, - :user_id, - :msg); - + + + + + select workflow_case__set_attribute_value ( + :journal_id, + :attribute_name, + :value + ); + - + + select workflow_case__clear_manual_assignments ( + :case_id, + :role_key + ); + + + - select workflow_case__new(:case_id, - :workflow_key, - :context_key, - :object_id, - now(), - :user_id, - :creation_ip - ) + + + + select workflow_case__add_manual_assignment ( + :case_id, + :role_key, + :party_id + ); + + + + + select workflow_case__end_task_action ( + :journal_id, + :action, + :task_id + ); + + + + + + + + + select workflow_case__fire_message_transition ( + :task_id + ); + + + + + + + + select workflow_case__new ( + :case_id, + :workflow_key, + :context_key, + :object_id, + now(), + :user_id, + :creation_ip + ); + + + + + select workflow_case__start_case ( + :case_id, + :user_id, + :creation_ip, + null + ); - select workflow_case__start_case(:case_id, - :user_id, - :creation_ip, - null - ) + + + + + + + select workflow_case__suspend ( + :case_id, + :user_id, + :ip_address, + :msg + ); + + + + + select workflow_case__resume ( + :case_id, + :user_id, + :ip_address, + :msg + ); + + + + + + + + + select workflow_case__cancel ( + :case_id, + :user_id, + :ip_address, + :msg + ); + + + + + - select journal_entry__new( + select journal_entry__new ( null, - :case_id, - 'comment', + :case_id, + 'comment', null, now(), - :user_id, - :ip_address, - :msg + :user_id, + :ip_address, + :msg ) - + + select workflow_case__add_manual_assignment ( + :case_id, + :role_key, + :party_id + ); + + + - select workflow__simple_p(:workflow_key); + + + + select workflow_case__remove_manual_assignment ( + :case_id, + :role_key, + :party_id + ); + - + + - - select case_id, - acs_object__name(object_id) as object_name, - state - from wf_cases - where case_id = :case_id + + select workflow_case__clear_manual_assignments ( + :case_id, + :role_key + ); - + + - 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, - 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 - now() as days_till_deadline, - tr.estimated_minutes, - tr.access_privilege, - now() - from wf_tasks t left outer join parties p - on p.party_id = t.holding_user, - wf_cases c, - wf_transition_info tr, - acs_objects o, - acs_object_types ot - 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 + select workflow_case__add_task_assignment ( + :task_id, + :party_id, + :permanent_value + ); - + + - - select a.attribute_id, - a.attribute_name, - a.pretty_name, - a.datatype, - acs_object__get_attribute(c.case_id, a.attribute_name) as value, - wfai.wf_datatype, - '' as attribute_widget - from acs_attributes a, wf_transition_attribute_map m, wf_tasks t, wf_cases c, wf_attribute_info wfai - where t.task_id = :task_id - and c.case_id = t.case_id - and m.workflow_key = c.workflow_key - and m.transition_key = t.transition_key - and a.attribute_id = m.attribute_id - and wfai.attribute_id = a.attribute_id - order by m.sort_order + + select workflow_case__remove_task_assignment ( + :task_id, + :party_id, + :permanent_value + ); - + + - - 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 + + select workflow_case__clear_task_assignments ( + :task_id, + :permanent_value + ); - + + + - 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 left outer join parties p - on p.party_id = o.creation_user - where j.object_id = :case_id - and o.object_id = j.journal_id - order by o.creation_date $sql_order + select workflow_case__set_case_deadline ( + :case_id, + :transition_key, + :deadline + ); - + + - - select workflow_case__set_attribute_value( - :journal_id, - :attribute_name, - :value - ); - + + select workflow_case__remove_case_deadline ( + :case_id, + :transition_key + ); + - + + - - select workflow_case__clear_manual_assignments( - :case_id, - :transition_key - ); - + + select workflow__add_place ( + :workflow_key, + :place_key, + :place_name, + :sort_order + ); + - + + - - select workflow_case__add_manual_assignment( - :case_id, - :transition_key, - :party_id - ); - + + select workflow__delete_place ( + :workflow_key, + :place_key + ); + - + + - - select workflow_case__end_task_action( - :journal_id, - :action, - :task_id - ); - + + select workflow__add_role ( + :workflow_key, + :role_key, + :role_name, + :sort_order + ); + - + - - select workflow_case__fire_message_transition( - :task_id + + select workflow__move_role_up ( + :workflow_key, + :role_key ); - + - - select workflow_case__suspend( - :case_id, - :user_id, - :ip_address, - :msg + + select workflow__move_role_down ( + :workflow_key, + :role_key ); - + - - select workflow_case__resume( - :case_id, - :user_id, - :ip_address, - :msg + + select workflow__delete_role ( + :workflow_key, + :role_key ); - + - - select workflow_case__cancel( - :case_id, - :user_id, - :ip_address, - :msg + + select workflow__add_transition ( + :workflow_key, + :transition_key, + :transition_name, + :role_key, + :sort_order, + :trigger_type + ); + + + + + + + + + select workflow__delete_transition ( + :workflow_key, + :transition_key ); + + + + + select workflow__add_arc ( + :workflow_key, + :transition_key, + :place_key, + :direction, + :guard_callback, + :guard_custom_arg, + :guard_description + ); + + + + + + + + + select workflow__add_arc ( + :workflow_key, + :from_transition_key, + :to_place_key, + :guard_callback, + :guard_custom_arg, + :guard_description + ); + + + + + + + + + select workflow__add_arc ( + :workflow_key, + :from_place_key, + :to_transition_key + ); + + + + + + + + + select workflow__delete_arc ( + :workflow_key, + :transition_key, + :place_key, + :direction + ); + + + + + + + + + select workflow__add_trans_attribute_map ( + :workflow_key, + :transition_key, + :attribute_id, + :sort_order + ); + + + + + + + + + select workflow__add_trans_attribute_map ( + :workflow_key, + :transition_key, + :attribute_name, + :sort_order + ); + + + + + + + + + select workflow__delete_trans_attribute_map ( + :workflow_key, + :transition_key, + :attribute_id + ); + + + + + + + + + select workflow__add_trans_role_assign_map ( + :workflow_key, + :transition_key, + :assign_role_key + ); + + + + + + + + + select workflow__delete_trans_role_assign_map ( + :workflow_key, + :transition_key, + :assign_role_key + ); + + + + + + + + select workflow__simple_p(:workflow_key); + + + + create function inline_0 () returns integer as ' begin - PERFORM workflow__create_workflow( - ''[db_quote [db_quote $new_workflow_key]]'', - ''[db_quote [db_quote $new_workflow_pretty_name]]'', - ''[db_quote [db_quote $new_workflow_pretty_plural]]'', - ''[db_quote [db_quote $description]]'', - ''[db_quote [db_quote $new_table_name]]'', + PERFORM workflow__create_workflow ( + ''[db_quote [db_quote $new_workflow_key]]'', + ''[db_quote [db_quote $new_workflow_pretty_name]]'', + ''[db_quote [db_quote $new_workflow_pretty_plural]]'', + ''[db_quote [db_quote $description]]'', + ''[db_quote [db_quote $new_table_name]]'', ''case_id'' ); @@ -313,69 +647,130 @@ - + + -create function inline_1 () returns integer as ' -declare - v_attribute_id acs_attributes.attribute_id%TYPE; -begin + select workflow__add_place( + '[db_quote $new_workflow_key]', + '[db_quote $place_key]', + '[db_quote $place_name]', + [ad_decode $sort_order "" "null" $sort_order] + ); - + - v_attribute_id := workflow__create_attribute( - ''[db_quote [db_quote $new_workflow_key]]'', - ''[db_quote [db_quote $attribute_name]]'', - ''[db_quote [db_quote $datatype]]'', - ''[db_quote [db_quote $pretty_name]]'', - null, - null, - null, - ''[db_quote [db_quote $default_value]]'', - 1, - 1, - null, - ''generic'', - ''none'' - ); + select workflow__add_role ( + '[db_quote $new_workflow_key]', + '[db_quote $role_key]', + '[db_quote $role_name]', + [ad_decode $sort_order "" "null" $sort_order] + ); - + + - insert into wf_transition_attribute_map - (workflow_key, - transition_key, - attribute_id, - sort_order) - values - (''[db_quote [db_quote $new_workflow_key]]'', - ''[db_quote [db_quote $transition_key]]'', - v_attribute_id, - [ad_decode $sort_order "" "null" $sort_order]); + select workflow__add_transition ( + '[db_quote $new_workflow_key]', + '[db_quote $transition_key]', + '[db_quote $transition_name]', + [ad_decode $role_key "" null '[db_quote $role_key]'], + [ad_decode $sort_order "" "null" $sort_order], + '[db_quote $trigger_type]' + ); + + + + + + + select workflow__add_arc ( + '[db_quote $new_workflow_key]', + '[db_quote $transition_key]', + '[db_quote $place_key]', + '[db_quote $direction]', + '[db_quote $guard_callback]', + '[db_quote $guard_custom_arg]', + '[db_quote $guard_description]' + ); + - + + - return null; + select workflow__create_attribute( + '[db_quote $new_workflow_key]', + '[db_quote $attribute_name]', + '[db_quote $datatype]', + '[db_quote $pretty_name]', + null, + null, + null, + '[db_quote $default_value]', + 1, + 1, + null, + 'generic' + ); -end;' language 'plpgsql'; + + -select inline_1 (); -drop function inline_1 (); + + + + + select workflow__add_trans_attribute_map( + '[db_quote $new_workflow_key]', + '[db_quote $transition_key]', + '[db_quote $attribute_name]', + [ad_decode $sort_order "" "null" $sort_order] + ); + - + + + + + + select workflow__add_trans_role_assign_map( + '[db_quote $new_workflow_key]', + '[db_quote $transition_key]', + '[db_quote $assign_role_key]' + ); + + + + + + + + + + + + + + + + + + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.tcl 16 May 2001 00:40:41 -0000 1.4 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.tcl 19 Nov 2001 18:25:09 -0000 1.5 @@ -51,61 +51,61 @@ @creation-date 10 July, 2000 } { if { ![string equal $type enabled] && ![string equal $type own] } { - return -code error "Unrecognized type: Type can be 'enabled' or 'own'" + return -code error "Unrecognized type: Type can be 'enabled' or 'own'" } if { [empty_string_p $user_id] } { - set user_id [ad_get_user_id] - if { $user_id == 0 } { - return {} - } + set user_id [ad_get_user_id] + if { $user_id == 0 } { + return {} + } } set select { - {t.task_id} - {t.case_id} - {t.transition_key} - {t.transition_name as task_name} - {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.deadline} - {to_char(t.deadline, :date_format) as deadline_pretty} - {t.deadline - sysdate as days_till_deadline} - {t.state} - {c.object_id} - {ot.object_type as object_type} - {ot.pretty_name as object_type_pretty} - {acs_object.name(c.object_id) as object_name} - {t.estimated_minutes} - {c.workflow_key} - {wft.pretty_name as workflow_name} - {sysdate} + {t.task_id} + {t.case_id} + {t.transition_key} + {t.transition_name as task_name} + {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.deadline} + {to_char(t.deadline, :date_format) as deadline_pretty} + {t.deadline - sysdate as days_till_deadline} + {t.state} + {c.object_id} + {ot.object_type as object_type} + {ot.pretty_name as object_type_pretty} + {acs_object.name(c.object_id) as object_name} + {t.estimated_minutes} + {c.workflow_key} + {wft.pretty_name as workflow_name} + {sysdate} } set from { - {wf_user_tasks t} - {wf_cases c} - {acs_objects o} - {acs_object_types ot} - {acs_object_types wft} + {wf_user_tasks t} + {wf_cases c} + {acs_objects o} + {acs_object_types ot} + {acs_object_types wft} } set where { - {t.user_id = :user_id} - {c.case_id = t.case_id} - {c.object_id = o.object_id} - {ot.object_type = o.object_type} - {wft.object_type = c.workflow_key} + {t.user_id = :user_id} + {c.case_id = t.case_id} + {c.object_id = o.object_id} + {ot.object_type = o.object_type} + {wft.object_type = c.workflow_key} } switch $type { - enabled { - lappend where {t.state = 'enabled'} - } - own { - lappend from {users u} - lappend where {t.state = 'started'} {t.holding_user = t.user_id} {u.user_id = t.user_id} - } + enabled { + lappend where {t.state = 'enabled'} + } + own { + lappend from {users u} + lappend where {t.state = 'started'} {t.holding_user = t.user_id} {u.user_id = t.user_id} + } } set sql " @@ -114,9 +114,9 @@ where [join $where "\n and "]" db_foreach user_tasks $sql -column_array row { - lappend result [array get row] + lappend result [array get row] } if_no_rows { - set result [list] + set result [list] } return $result } @@ -133,14 +133,14 @@ @creation-date 10 July, 2000 } { db_1row case { - select case_id, - acs_object.name(object_id) as object_name, - - state - from wf_cases - where case_id = :case_id + select case_id, + acs_object.name(object_id) as object_name, + + state + from wf_cases + where case_id = :case_id } -column_array case - + return [array get case] } @@ -160,8 +160,8 @@ canceled_date, canceled_date_pretty, finished_date, finished_date_pretty, overridden_date, overridden_date_pretty, holding_user, holding_user_name, holding_user_email, hold_timeout, hold_timeout_pretty, deadline, deadline_pretty, days_till_deadline - estimated_minutes, access_privilege, sysdate, journal, attributes_to_set, assigned_users, - this_user_is_assigned_p, transitions_to_assign. + estimated_minutes, instructions, sysdate, journal, attributes_to_set, assigned_users, + this_user_is_assigned_p, roles_to_assign.

@@ -193,121 +193,107 @@ @creation-date 10 July, 2000 } { db_1row task { - select t.task_id, - t.case_id, - c.object_id, - acs_object.name(c.object_id) as object_name, + 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, + 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, - tr.access_privilege, - 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 + 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 } -column_array task set task(state_pretty) [wf_task_state_pretty $task(state)] db_multirow task_attributes_to_set task_attributes_to_set { - select a.attribute_id, - a.attribute_name, - a.pretty_name, - a.datatype, - acs_object.get_attribute(c.case_id, a.attribute_name) as value, - wfai.wf_datatype, - '' as attribute_widget - from acs_attributes a, wf_transition_attribute_map m, wf_tasks t, wf_cases c, wf_attribute_info wfai - where t.task_id = :task_id - and c.case_id = t.case_id - and m.workflow_key = c.workflow_key - and m.transition_key = t.transition_key - and a.attribute_id = m.attribute_id - and wfai.attribute_id = a.attribute_id - order by m.sort_order + 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 } { - set attribute_widget [wf_attribute_widget \ - [list attribute_id $attribute_id \ - attribute_name $attribute_name \ - pretty_name $pretty_name \ - datatype $datatype \ - value $value \ - wf_datatype $wf_datatype]] + set attribute_widget [wf_attribute_widget \ + [list attribute_id $attribute_id \ + attribute_name $attribute_name \ + pretty_name $pretty_name \ + datatype $datatype \ + value $value]] } - db_multirow task_transitions_to_assign task_transitions_to_assign { - select tr.transition_key, - tr.transition_name, - tr.trigger_type, - '' as assignment_widget - from wf_transition_assignment_map tam, wf_transitions tr, wf_tasks t, wf_cases c - where t.task_id = :task_id - and c.case_id = t.case_id - and tam.workflow_key = c.workflow_key - and tam.transition_key = t.transition_key - and tr.workflow_key = tam.workflow_key - and tr.transition_key = tam.assign_transition_key - and tr.trigger_type = 'user' - order by tr.sort_order + db_multirow task_roles_to_assign task_roles_to_assign { + select r.role_key, + r.role_name, + '' as assignment_widget + from wf_tasks t, wf_transition_role_assign_map tram, wf_roles r + where t.task_id = :task_id + and tram.workflow_key = t.workflow_key and tram.transition_key = t.transition_key + and r.workflow_key = tram.workflow_key and r.role_key = tram.assign_role_key + order by r.sort_order } { - set assignment_widget [wf_assignment_widget \ - [list transition_key $transition_key \ - transition_name $transition_name \ - trigger_type $trigger_type]] + set assignment_widget [wf_assignment_widget -case_id $task(case_id) $role_key] } db_multirow task_assigned_users task_assigned_users { - 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 + 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 } set user_id [ad_get_user_id] if { [string equal $task(state) enabled] } { - set task(this_user_is_assigned_p) [db_string this_user_is_assigned_p { - select count(*) from wf_user_tasks where task_id = :task_id and user_id = :user_id - }] + set task(this_user_is_assigned_p) [db_string this_user_is_assigned_p { + select count(*) from wf_user_tasks where task_id = :task_id and user_id = :user_id + }] } else { - if { ![empty_string_p $task(holding_user)] && $user_id == $task(holding_user) } { - set task(this_user_is_assigned_p) 1 - } else { - set task(this_user_is_assigned_p) 0 - } + if { ![empty_string_p $task(holding_user)] && $user_id == $task(holding_user) } { + set task(this_user_is_assigned_p) 1 + } else { + set task(this_user_is_assigned_p) 0 + } } return [array get task] @@ -344,55 +330,53 @@ } { switch -- $order { - latest_first { - set sql_order "desc" - } - latest_last { - set sql_order "asc" - } - default { - return -code error "Order must be latest_first or latest_last" - } + latest_first { + set sql_order "desc" + } + latest_last { + set sql_order "asc" + } + default { + return -code error "Order must be latest_first or latest_last" + } } set entries [list] db_foreach journal " - select j.journal_id, + 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, + 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 + 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 " -column_array entry { - - set entry(attributes) [list] - - set journal_id $entry(journal_id) - db_foreach attributes { - select a.attribute_name as name, - a.pretty_name, - a.datatype, - ai.wf_datatype, - v.attr_value as value - from wf_attribute_value_audit v, acs_attributes a, wf_attribute_info ai - where v.journal_id = :journal_id - and a.attribute_id = v.attribute_id - and ai.attribute_id = v.attribute_id - } -column_array attribute { - lappend entry(attributes) [array get attribute] - } - set entry(attributes_html) [join $entry(attributes) "
"] - - lappend entries [array get entry] + + set entry(attributes) [list] + + set journal_id $entry(journal_id) + db_foreach attributes { + select a.attribute_name as name, + a.pretty_name, + a.datatype, + v.attr_value as value + from wf_attribute_value_audit v, acs_attributes a + where v.journal_id = :journal_id + and a.attribute_id = v.attribute_id + } -column_array attribute { + lappend entry(attributes) [array get attribute] + } + set entry(attributes_html) [join $entry(attributes) "
"] + + lappend entries [array get entry] } return [list case_id $case_id entries $entries] @@ -422,37 +406,37 @@ @creation-date 10 July, 2000 } { db_1row workflow { - select t.pretty_name, - w.description - from wf_workflows w, acs_object_types t - where w.workflow_key = :workflow_key - and t.object_type = w.workflow_key + select t.pretty_name, + w.description + from wf_workflows w, acs_object_types t + where w.workflow_key = :workflow_key + and t.object_type = w.workflow_key } -column_array workflow_info - + set workflow_info(transitions) [list] db_foreach transitions { - select transition_key, transition_name, sort_order - from wf_transitions - where workflow_key = :workflow_key - and trigger_type = 'user' - order by sort_order asc + select transition_key, transition_name, sort_order + from wf_transitions + where workflow_key = :workflow_key + and trigger_type = 'user' + order by sort_order asc } -column_array transition_info { - - set attributes [list] - set transition_key $transition_info(transition_key) - db_foreach attributes { - select a.attribute_name - from wf_transition_attribute_map m, acs_attributes a - where m.workflow_key = :workflow_key - and m.transition_key = :transition_key - and a.attribute_id = m.attribute_id - } -column_array attribute_info { - lappend attributes [array get attribute_info] - } - - set transition_info(attributes) $attributes - lappend workflow_info(transitions) [array get transition_info] + + set attributes [list] + set transition_key $transition_info(transition_key) + db_foreach attributes { + select a.attribute_name + from wf_transition_attribute_map m, acs_attributes a + where m.workflow_key = :workflow_key + and m.transition_key = :transition_key + and a.attribute_id = m.attribute_id + } -column_array attribute_info { + lappend attributes [array get attribute_info] + } + + set transition_info(attributes) $attributes + lappend workflow_info(transitions) [array get transition_info] } @@ -482,91 +466,89 @@ @param attributes an [array get] representation of workflow attribute values to set. + @param assignments an [array get] representation of role assignments + made by this task for this case. + @return journal_id of the newly created journal entry. @author Lars Pind (lars@pinds.com) @creation-date 10 July, 2000 } { if { ![info exists user_id] } { - set user_id [ad_get_user_id] + set user_id [ad_get_user_id] } set modifying_ip [ad_conn peeraddr] db_transaction { - - set journal_id [db_exec_plsql begin_task_action { - begin - :1 := workflow_case.begin_task_action( - task_id => :task_id, - action => :action, - action_ip => :modifying_ip, - user_id => :user_id, - msg => :msg); - end; - }] + + set journal_id [db_exec_plsql begin_task_action { + begin + :1 := workflow_case.begin_task_action( + task_id => :task_id, + action => :action, + action_ip => :modifying_ip, + user_id => :user_id, + msg => :msg); + end; + }] - if { [info exists attributes] } { - array set attr $attributes - foreach attribute_name [array names attr] { - db_exec_plsql set_attribute_value { - begin - workflow_case.set_attribute_value( - journal_id => :journal_id, - attribute_name => :attribute_name, - value => :value - ); - end; - } -bind [list journal_id $journal_id \ - attribute_name $attribute_name \ - value $attr($attribute_name) ] - } - } + if { [info exists attributes] } { + array set attr $attributes + foreach attribute_name [array names attr] { + db_exec_plsql set_attribute_value { + begin + workflow_case.set_attribute_value( + journal_id => :journal_id, + attribute_name => :attribute_name, + value => :value + ); + end; + } -bind [list journal_id $journal_id \ + attribute_name $attribute_name \ + value $attr($attribute_name) ] + } + } - if { [info exists assignments] } { - array set asgn $assignments - - set case_id [db_string case_id_from_task { select case_id from wf_tasks where task_id = :task_id}] + if { [info exists assignments] } { + array set asgn $assignments + + set case_id [db_string case_id_from_task { select case_id from wf_tasks where task_id = :task_id}] - foreach transition_key [array names asgn] { - ns_log Notice "Assigning $transition_key" - - db_exec_plsql clear_assignments { - begin - workflow_case.clear_manual_assignments( - case_id => :case_id, - transition_key => :transition_key - ); - end; - } - - foreach party_id $asgn($transition_key) { - ns_log Notice "Adding $party_id to $transition_key" - db_exec_plsql add_manual_assignment { - begin - workflow_case.add_manual_assignment( - case_id => :case_id, - transition_key => :transition_key, - party_id => :party_id - ); - end; - } - } - } - } + foreach role_key [array names asgn] { + db_exec_plsql clear_assignments { + begin + workflow_case.clear_manual_assignments( + case_id => :case_id, + role_key => :role_key + ); + end; + } + + foreach party_id $asgn($role_key) { + db_exec_plsql add_manual_assignment { + begin + workflow_case.add_manual_assignment( + case_id => :case_id, + role_key => :role_key, + party_id => :party_id + ); + end; + } + } + } + } - db_exec_plsql end_task_action { - begin - workflow_case.end_task_action( - journal_id => :journal_id, - action => :action, - task_id => :task_id + db_exec_plsql end_task_action { + begin + workflow_case.end_task_action( + journal_id => :journal_id, + action => :action, + task_id => :task_id ); end; } - } on_error { - ns_log Notice "error in transaction" - } + } return $journal_id } @@ -583,15 +565,21 @@ @creation-date 10 July, 2000 } { db_exec_plsql transition_fire { - begin - workflow_case.fire_message_transition( - task_id => :task_id + begin + workflow_case.fire_message_transition( + task_id => :task_id ); - end; + end; } } +##### +# +# WORKFLOW CASE API +# +##### + ad_proc -public wf_case_new { -case_id workflow_key @@ -611,9 +599,10 @@ set user_id [ad_get_user_id] set creation_ip [ad_conn peeraddr] + if { ![info exists case_id] } { set case_id "" - } + } set case_id [db_exec_plsql workflow_case_new ""] @@ -637,13 +626,13 @@ db_exec_plsql case_suspend { begin - workflow_case.suspend( - case_id => :case_id, - user_id => :user_id, - ip_address => :ip_address, - msg => :msg + workflow_case.suspend( + case_id => :case_id, + user_id => :user_id, + ip_address => :ip_address, + msg => :msg ); - end; + end; } } @@ -662,13 +651,13 @@ db_exec_plsql case_resume { begin - workflow_case.resume( - case_id => :case_id, - user_id => :user_id, - ip_address => :ip_address, - msg => :msg + workflow_case.resume( + case_id => :case_id, + user_id => :user_id, + ip_address => :ip_address, + msg => :msg ); - end; + end; } } @@ -687,13 +676,13 @@ db_exec_plsql case_cancel { begin - workflow_case.cancel( - case_id => :case_id, - user_id => :user_id, - ip_address => :ip_address, - msg => :msg + workflow_case.cancel( + case_id => :case_id, + user_id => :user_id, + ip_address => :ip_address, + msg => :msg ); - end; + end; } } @@ -711,19 +700,523 @@ set ip_address [ad_conn peeraddr] set journal_id [db_exec_plsql case_comment { - begin - :1 := journal_entry.new( - object_id => :case_id, - action => 'comment', - creation_user => :user_id, - creation_ip => :ip_address, - msg => :msg + begin + :1 := journal_entry.new( + object_id => :case_id, + action => 'comment', + creation_user => :user_id, + creation_ip => :ip_address, + msg => :msg ); end; }] +} +ad_proc -public wf_case_add_manual_assignment { + -case_id:required + -role_key:required + -party_id:required +} { + db_exec_plsql add_manual_assignment { + begin + workflow_case.add_manual_assignment( + case_id => :case_id, + role_key => :role_key, + party_id => :party_id + ); + end; + } } +ad_proc -public wf_case_remove_manual_assignment { + -case_id:required + -role_key:required + -party_id:required +} { + db_exec_plsql remove_manual_assignment { + begin + workflow_case.remove_manual_assignment( + case_id => :case_id, + role_key => :role_key, + party_id => :party_id + ); + end; + } +} + +ad_proc -public wf_case_clear_manual_assignments { + -case_id:required + -role_key:required +} { + db_exec_plsql clear_manual_assignments { + begin + workflow_case.clear_manual_assignments( + case_id => :case_id, + role_key => :role_key + ); + end; + } +} + +ad_proc -public wf_case_set_manual_assignments { + -case_id:required + -role_key:required + -party_id_list:required +} { + db_transaction { + wf_case_clear_manual_assignments -case_id $case_id -role_key $role_key + foreach party_id $party_id_list { + wf_case_add_manual_assignment -case_id $case_id -role_key $role_key -party_id $party_id + } + } +} + + +ad_proc -public wf_case_add_task_assignment { + -task_id:required + -party_id:required + -permanent:boolean +} { + set permanent_value [ad_decode $permanent_p 1 "t" 0 "f"] + db_exec_plsql add_task_assignment { + begin + workflow_case.add_task_assignment( + task_id => :task_id, + party_id => :party_id, + permanent_p => :permanent_value + ); + end; + } +} + +ad_proc -public wf_case_remove_task_assignment { + -task_id:required + -party_id:required + -permanent:boolean +} { + set permanent_value [ad_decode $permanent_p 1 "t" 0 "f"] + db_exec_plsql remove_task_assignment { + begin + workflow_case.remove_task_assignment( + task_id => :task_id, + party_id => :party_id, + permanent_p => :permanent_value + ); + end; + } +} + +ad_proc -public wf_case_clear_task_assignments { + -task_id:required + -permanent:boolean +} { + set permanent_value [ad_decode $permanent_p 1 "t" 0 "f"] + db_exec_plsql clear_task_assignments { + begin + workflow_case.clear_task_assignments( + task_id => :task_id, + permanent_p => :permanent_value + ); + end; + } +} + +ad_proc -public wf_case_set_task_assignments { + -task_id:required + -party_id_list:required + -permanent:boolean +} { + db_transaction { + wf_case_clear_task_assignments -task_id $task_id -permanent=$permanent_p + foreach party_id $party_id_list { + wf_case_add_task_assignment -task_id $task_id -party_id $party_id -permanent=$permanent_p + } + } +} + + +ad_proc -public wf_case_set_case_deadline { + -case_id:required + -transition_key:required + -deadline:required +} { + db_exec_plsql set_case_deadline { + begin + workflow_case.set_case_deadline( + case_id => :case_id, + transition_key => :transition_key, + deadline => :deadline + ); + end; + } +} + +ad_proc -public wf_case_remove_case_deadline { + -case_id:required + -transition_key:required +} { + db_exec_plsql remove_case_deadline { + begin + workflow_case.remove_case_deadline( + case_id => :case_id, + transition_key => :transition_key + ); + end; + } +} + + + + +##### +# +# WORKFLOW API +# +##### + +ad_proc -public wf_add_place { + -workflow_key:required + -place_key + -place_name:required + {-sort_order ""} +} { + if { ![info exists place_key] } { + set place_key [wf_make_unique -maxlen 100 \ + -taken_names [db_list place_keys {select place_key from wf_places where workflow_key = :workflow_key}] \ + [wf_name_to_key $place_name]] + } + + db_exec_plsql wf_add_place { + begin + workflow.add_place( + workflow_key => :workflow_key, + place_key => :place_key, + place_name => :place_name, + sort_order => :sort_order + ); + end; + } + wf_workflow_changed $workflow_key + return $place_key +} + +ad_proc -public wf_delete_place { + -workflow_key:required + -place_key:required +} { + db_exec_plsql wf_delete_place { + begin + workflow.delete_place( + workflow_key => :workflow_key, + place_key => :place_key + ); + end; + } + wf_workflow_changed $workflow_key +} + +ad_proc -public wf_add_role { + -workflow_key:required + -role_key + -role_name:required + {-sort_order ""} +} { + if { ![info exists role_key] } { + set role_key [wf_make_unique -maxlen 100 \ + -taken_names [db_list role_keys {select role_key from wf_roles where workflow_key = :workflow_key}] \ + [wf_name_to_key $role_name]] + } + + db_exec_plsql wf_add_role { + begin + workflow.add_role( + workflow_key => :workflow_key, + role_key => :role_key, + role_name => :role_name, + sort_order => :sort_order + ); + end; + } + wf_workflow_changed $workflow_key + return $role_key +} + +ad_proc -public wf_move_role_up { + -workflow_key:required + -role_key:required +} { + db_exec_plsql move_role_up { + begin + workflow.move_role_up( + workflow_key => :workflow_key, + role_key => :role_key + ); + end; + } +} + +ad_proc -public wf_move_role_down { + -workflow_key:required + -role_key:required +} { + db_exec_plsql move_role_down { + begin + workflow.move_role_down( + workflow_key => :workflow_key, + role_key => :role_key + ); + end; + } +} + +ad_proc -public wf_delete_role { + -workflow_key:required + -role_key:required +} { + db_exec_plsql wf_delete_role { + begin + workflow.delete_role( + workflow_key => :workflow_key, + role_key => :role_key + ); + end; + } + wf_workflow_changed $workflow_key +} + + +ad_proc -public wf_add_transition { + -workflow_key:required + -transition_key + -transition_name:required + {-role_key ""} + {-sort_order ""} + {-trigger_type "user"} + {-instructions ""} + {-estimated_minutes ""} + {-context_key "default"} +} { + if { ![info exists transition_key] } { + set transition_key [wf_make_unique -maxlen 100 \ + -taken_names [db_list transition_keys {select transition_key from wf_transitions where workflow_key = :workflow_key}] \ + [wf_name_to_key $transition_name]] + } + + db_transaction { + + db_exec_plsql wf_add_transition { + 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; + } + + if { ![empty_string_p $estimated_minutes] || ![empty_string_p $instructions] } { + db_dml estimated_minutes_and_instructions { + insert into wf_context_transition_info + (context_key, workflow_key, transition_key, estimated_minutes, instructions) + values (:context_key, :workflow_key, :transition_key, :estimated_minutes, :instructions) + } + } + } + + wf_workflow_changed $workflow_key + return $transition_key +} + +ad_proc -public wf_delete_transition { + -workflow_key:required + -transition_key:required +} { + db_exec_plsql wf_delete_transition { + begin + workflow.delete_transition( + workflow_key => :workflow_key, + transition_key => :transition_key + ); + end; + } + wf_workflow_changed $workflow_key +} + + + + +ad_proc -public wf_add_arc { + -workflow_key:required + -transition_key:required + -place_key:required + -direction:required + {-guard_callback ""} + {-guard_custom_arg ""} + {-guard_description ""} +} { + db_exec_plsql wf_add_arc { + 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; + } + wf_workflow_changed $workflow_key +} + +ad_proc -public wf_add_arc_out { + -workflow_key:required + -from_transition_key:required + -to_place_key:required + {-guard_callback ""} + {-guard_custom_arg ""} + {-guard_description ""} +} { + db_exec_plsql wf_add_arc { + begin + workflow.add_arc( + workflow_key => :workflow_key, + from_transition_key => :from_transition_key, + to_place_key => :to_place_key, + guard_callback => :guard_callback, + guard_custom_arg => :guard_custom_arg, + guard_description => :guard_description + ); + end; + } + wf_workflow_changed $workflow_key +} + +ad_proc -public wf_add_arc_in { + -workflow_key:required + -from_place_key:required + -to_transition_key:required +} { + db_exec_plsql wf_add_arc { + begin + workflow.add_arc( + workflow_key => :workflow_key, + from_place_key => :from_place_key, + to_transition_key => :to_transition_key + ); + end; + } + wf_workflow_changed $workflow_key +} + +ad_proc -public wf_delete_arc { + -workflow_key:required + -transition_key:required + -place_key:required + -direction:required +} { + db_exec_plsql wf_delete_arc { + begin + workflow.delete_arc( + workflow_key => :workflow_key, + transition_key => :transition_key, + place_key => :place_key, + direction => :direction + ); + end; + } + wf_workflow_changed $workflow_key +} + +ad_proc -public wf_add_trans_attribute_map { + -workflow_key:required + -transition_key:required + -attribute_id + -attribute_name + {-sort_order ""} +} { + if { ![info exists attribute_id] && ![info exists attribute_name] } { + return -code error "Either attribute_id or attribute_name must be supplied" + } + + if { [info exists attribute_id] } { + db_exec_plsql add_trans_attribute_map_attribute_id { + begin + workflow.add_trans_attribute_map( + workflow_key => :workflow_key, + transition_key => :transition_key, + attribute_id => :attribute_id, + sort_order => :sort_order + ); + end; + } + } else { + db_exec_plsql add_trans_attribute_map_attribute_name { + begin + workflow.add_trans_attribute_map( + workflow_key => :workflow_key, + transition_key => :transition_key, + attribute_name => :attribute_name, + sort_order => :sort_order + ); + end; + } + } +} + +ad_proc -public wf_delete_trans_attribute_map { + -workflow_key:required + -transition_key:required + -attribute_id:required +} { + db_exec_plsql delete_trans_attribute_map { + begin + workflow.delete_trans_attribute_map( + workflow_key => :workflow_key, + transition_key => :transition_key, + attribute_id => :attribute_id + ); + end; + } +} + +ad_proc -public wf_add_trans_role_assign_map { + -workflow_key:required + -transition_key:required + -assign_role_key:required +} { + db_exec_plsql add_trans_role_assign_map { + begin + workflow.add_trans_role_assign_map( + workflow_key => :workflow_key, + transition_key => :transition_key, + assign_role_key => :assign_role_key + ); + end; + } +} + +ad_proc -public wf_delete_trans_role_assign_map { + -workflow_key:required + -transition_key:required + -assign_role_key:required +} { + db_exec_plsql delete_trans_role_assign_map { + begin + workflow.delete_trans_role_assign_map( + workflow_key => :workflow_key, + transition_key => :transition_key, + assign_role_key => :assign_role_key + ); + end; + } +} + + ad_proc -public wf_task_state_pretty { task_state } { @@ -733,10 +1226,10 @@ @creation-date 10 July, 2000 } { array set pretty { - enabled Waiting - started Active - canceled Canceled - finished Finished + enabled Waiting + started Active + canceled Canceled + finished Finished overridden Overriden } return $pretty($task_state) @@ -752,15 +1245,15 @@ @creation-date 10 July, 2000 } { switch -- $task_state { - enabled { - return [list start] - } - started { - return [list finish cancel] - } - default { - return [list] - } + enabled { + return [list start] + } + started { + return [list finish cancel] + } + default { + return [list] + } } } @@ -773,10 +1266,10 @@ @creation-date 10 July, 2000 } { array set pretty { - start Start - finish Finish - cancel Cancel - comment Comment + start Start + finish Finish + cancel Cancel + comment Comment } return $pretty($action) } @@ -798,6 +1291,11 @@ +##### +# +# EXPORT +# +##### ad_proc wf_export_workflow { {-context_key "default"} @@ -811,7 +1309,7 @@ } { if { ![info exists new_workflow_key] } { - set new_workflow_key $workflow_key + set new_workflow_key $workflow_key } ##### @@ -821,26 +1319,26 @@ ##### db_1row workflow_info { - select wf.description, - ot.pretty_name, - ot.pretty_plural, - ot.table_name - from wf_workflows wf, - acs_object_types ot - where wf.workflow_key = :workflow_key - and ot.object_type = wf.workflow_key + select wf.description, + ot.pretty_name, + ot.pretty_plural, + ot.table_name + from wf_workflows wf, + acs_object_types ot + where wf.workflow_key = :workflow_key + and ot.object_type = wf.workflow_key } if { ![info exists new_table_name] } { - set new_table_name $table_name + set new_table_name $table_name } if { ![info exists new_workflow_pretty_name] } { - set new_workflow_pretty_name $pretty_name + set new_workflow_pretty_name $pretty_name } if { ![info exists new_workflow_pretty_plural] } { - set new_workflow_pretty_plural $pretty_plural + set new_workflow_pretty_plural $pretty_plural } @@ -849,7 +1347,7 @@ /* * Business Process Definition: $pretty_name ($new_workflow_key[ad_decode $workflow_key $new_workflow_key "" ", copy of $workflow_key"]) * - * Auto-generated by ACS Workflow Export, version 4.0.2 + * Auto-generated by ACS Workflow Export, version 4.3 * * Context: $context_key */ @@ -859,8 +1357,8 @@ * Cases table */ create table $new_table_name ( - case_id integer primary key - references wf_cases on delete cascade + case_id integer primary key + references wf_cases on delete cascade ); /* @@ -877,34 +1375,46 @@ ##### append sql " -/* +/***** * Places - */ - + *****/ " db_foreach places { select place_key, place_name, sort_order - from wf_places - where workflow_key = :workflow_key - order by sort_order asc + from wf_places + where workflow_key = :workflow_key + order by sort_order asc } { - append sql "insert into wf_places -(place_key, - place_name, - workflow_key, - sort_order) -values -('[db_quote $place_key]', - '[db_quote $place_name]', - '[db_quote $new_workflow_key]', - [ad_decode $sort_order "" "null" $sort_order]); + append sql "[db_map add_place]" + } + ##### + # + # Roles + # + ##### + + append sql " +/***** + * Roles + *****/ + " + + db_foreach roles { + select role_key, + role_name, + sort_order + from wf_roles + where workflow_key = :workflow_key + } { + append sql "[db_map add_role]" } + ##### # # Transitions @@ -913,35 +1423,23 @@ append sql " -/* +/***** * Transitions - */ + *****/ " db_foreach transitions { - select transition_key, - transition_name, - sort_order, - trigger_type - from wf_transitions - where workflow_key = :workflow_key - order by sort_order asc + select transition_key, + transition_name, + role_key, + sort_order, + trigger_type + from wf_transitions + where workflow_key = :workflow_key + order by sort_order asc } { - append sql "insert into wf_transitions -(transition_key, - transition_name, - workflow_key, - sort_order, - trigger_type) -values -('[db_quote $transition_key]', - '[db_quote $transition_name]', - '[db_quote $new_workflow_key]', - [ad_decode $sort_order "" "null" $sort_order], - '[db_quote $trigger_type]'); - -" + append sql "[db_map add_transition]" } @@ -955,41 +1453,24 @@ append sql " -/* +/***** * Arcs - */ + *****/ " db_foreach arcs { - select transition_key, - place_key, - direction, - guard_callback, - guard_custom_arg, - guard_description - from wf_arcs - where workflow_key = :workflow_key - order by transition_key asc + select transition_key, + place_key, + direction, + guard_callback, + guard_custom_arg, + guard_description + from wf_arcs + where workflow_key = :workflow_key + order by transition_key asc } { - append sql "insert into wf_arcs -(workflow_key, - transition_key, - place_key, - direction, - guard_callback, - guard_custom_arg, - guard_description) -values -('[db_quote $new_workflow_key]', - '[db_quote $transition_key]', - '[db_quote $place_key]', - '[db_quote $direction]', - '[db_quote $guard_callback]', - '[db_quote $guard_custom_arg]', - '[db_quote $guard_description]'); - -" + append sql "[db_map add_arc]" } @@ -1001,75 +1482,58 @@ append sql " -/* +/***** * Attributes - */ + *****/ -[db_map declare_attr_id] - " db_foreach attributes { - select attribute_id, - attribute_name, - datatype, - pretty_name, - default_value - from acs_attributes - where object_type = :workflow_key + select attribute_id, + attribute_name, + datatype, + pretty_name, + default_value + from acs_attributes + where object_type = :workflow_key } { - append sql [db_map create_attribute] - db_foreach transition_attribute_map { - select transition_key, - sort_order - from wf_transition_attribute_map - where workflow_key = :workflow_key - and attribute_id = :attribute_id - } { - - append sql [db_map transition_attribute] - } + db_foreach transition_attribute_map { + select transition_key, + sort_order + from wf_transition_attribute_map + where workflow_key = :workflow_key + and attribute_id = :attribute_id + } { + append sql [db_map add_trans_attribute_map] + } } - - append sql "[db_map end_attribute] -" - ##### # - # Transition-assignment map + # Transition-role-assignment map # ##### append sql " -/* - * Transition-assignment-map - */ +/***** + * Transition-role-assignment-map + *****/ " - db_foreach transition_assignment_map { - select transition_key, - assign_transition_key - from wf_transition_assignment_map - where workflow_key = :workflow_key - order by transition_key + db_foreach transition_role_assign_map { + select transition_key, + assign_role_key + from wf_transition_role_assign_map + where workflow_key = :workflow_key + order by transition_key } { - append sql "insert into wf_transition_assignment_map -(workflow_key, - transition_key, - assign_transition_key) -values -('[db_quote $new_workflow_key]', - '[db_quote $transition_key]', - '[db_quote $assign_transition_key]'); - -" + append sql [db_map add_trans_role_assign_map] } @@ -1089,39 +1553,38 @@ " db_foreach context_transition_info { - select transition_key, - estimated_minutes, - enable_callback, - enable_custom_arg, - fire_callback, - fire_custom_arg, - assignment_callback, - assignment_custom_arg, - time_callback, - time_custom_arg, - deadline_callback, - deadline_custom_arg, - deadline_attribute_name, - hold_timeout_callback, - hold_timeout_custom_arg, - notification_callback, - notification_custom_arg, - access_privilege - from wf_context_transition_info - where workflow_key = :workflow_key - and context_key = :context_key + select transition_key, + estimated_minutes, + instructions, + enable_callback, + enable_custom_arg, + fire_callback, + fire_custom_arg, + time_callback, + time_custom_arg, + deadline_callback, + deadline_custom_arg, + deadline_attribute_name, + hold_timeout_callback, + hold_timeout_custom_arg, + notification_callback, + notification_custom_arg, + unassigned_callback, + unassigned_custom_arg + from wf_context_transition_info + where workflow_key = :workflow_key + and context_key = :context_key } { - append sql "insert into wf_context_transition_info + append sql "insert into wf_context_transition_info (context_key, workflow_key, transition_key, estimated_minutes, + instructions, enable_callback, enable_custom_arg, fire_callback, fire_custom_arg, - assignment_callback, - assignment_custom_arg, time_callback, time_custom_arg, deadline_callback, @@ -1131,18 +1594,18 @@ hold_timeout_custom_arg, notification_callback, notification_custom_arg, - access_privilege) + unassigned_callback, + unassigned_custom_arg) values ('[db_quote $context_key]', '[db_quote $new_workflow_key]', '[db_quote $transition_key]', [ad_decode $estimated_minutes "" "null" $estimated_minutes], + '[db_quote $instructions]', '[db_quote $enable_callback]', '[db_quote $enable_custom_arg]', '[db_quote $fire_callback]', '[db_quote $fire_custom_arg]', - '[db_quote $assignment_callback]', - '[db_quote $assignment_custom_arg]', '[db_quote $time_callback]', '[db_quote $time_custom_arg]', '[db_quote $deadline_callback]', @@ -1152,14 +1615,55 @@ '[db_quote $hold_timeout_custom_arg]', '[db_quote $notification_callback]', '[db_quote $notification_custom_arg]', - '[db_quote $access_privilege]'); + '[db_quote $unassigned_callback]', + '[db_quote $unassigned_custom_arg]'); " } ##### # + # Context-Role info + # + ##### + + append sql " + +/* + * Context/Role info + * (for context = $context_key) + */ + +" + + db_foreach context_role_info { + select role_key, + assignment_callback, + assignment_custom_arg + from wf_context_role_info + where workflow_key = :workflow_key + and context_key = :context_key + } { + append sql "insert into wf_context_role_info +(context_key, + workflow_key, + role_key, + assignment_callback, + assignment_custom_arg) +values +('[db_quote $context_key]', + '[db_quote $new_workflow_key]', + '[db_quote $role_key]', + '[db_quote $assignment_callback]', + '[db_quote $assignment_custom_arg]'); + +" + } + + + ##### + # # Context Task Panels # ##### @@ -1168,40 +1672,69 @@ /* * Context Task Panels + * (for context = $context_key) */ " db_foreach context_task_panels { - select transition_key, - sort_key, - header, - template_url - from wf_context_task_panels - where context_key = :context_key - and workflow_key = :workflow_key - order by transition_key asc, sort_key asc + select transition_key, + sort_order, + header, + template_url, + overrides_action_p, + only_display_when_started_p + from wf_context_task_panels + where context_key = :context_key + and workflow_key = :workflow_key + order by transition_key asc, sort_order asc } { - append sql "insert into wf_context_task_panels + append sql "insert into wf_context_task_panels (context_key, workflow_key, transition_key, - sort_key, + sort_order, header, - template_url) + template_url, + overrides_action_p, + only_display_when_started_p) values ('[db_quote $context_key]', '[db_quote $new_workflow_key]', '[db_quote $transition_key]', - [ad_decode $sort_key "" "null" $sort_key], + [ad_decode $sort_order "" "null" $sort_order], '[db_quote $header]', - '[db_quote $template_url]'); + '[db_quote $template_url]', +:overrides_action_p, +:only_display_when_started_p); " } - append sql [db_map commit] + append sql " +commit; +" return $sql } +ad_proc wf_split_query_url_to_arg_spec { query_url } { + Splits a URL including query arguments (e.g., /foo/bar?baz=greble&yank=zazz) + up into a list of lists of name/value pairs, that can be passed as an argument + to export_vars. +

+ Useful for pages that receive a return_url argument, but wants to + execute the actual return using a form submit button. + + @author Lars Pind (lars@pinds.com) + @creation-date Feb 26, 2001 +} { + set arg_spec {} + foreach arg [split [lindex [split $query_url "?"] 1] "&"] { + set argv [split $arg "="] + set name [ns_urldecode [lindex $argv 0]] + set value [ns_urldecode [lindex $argv 1]] + lappend arg_spec [list $name $value] + } + return $arg_spec +} Index: openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.xql 19 Nov 2001 18:25:09 -0000 1.2 @@ -1,60 +1,54 @@ - - + + - select tr.transition_key, - tr.transition_name, - tr.trigger_type, - '' as assignment_widget - from wf_transition_assignment_map tam, wf_transitions tr, wf_tasks t, wf_cases c - where t.task_id = :task_id - and c.case_id = t.case_id - and tam.workflow_key = c.workflow_key - and tam.transition_key = t.transition_key - and tr.workflow_key = tam.workflow_key - and tr.transition_key = tam.assign_transition_key - and tr.trigger_type = 'user' - order by tr.sort_order + select r.role_key, + r.role_name, + '' as assignment_widget + from wf_tasks t, wf_transition_role_assign_map tram, wf_roles r + where t.task_id = :task_id + and tram.workflow_key = t.workflow_key and tram.transition_key = t.transition_key + and r.workflow_key = tram.workflow_key and r.role_key = tram.assign_role_key + order by r.sort_order - + - select count(*) from wf_user_tasks where task_id = :task_id and user_id = :user_id - + select count(*) from wf_user_tasks where task_id = :task_id and user_id = :user_id + + - select a.attribute_name as name, - a.pretty_name, - a.datatype, - ai.wf_datatype, - v.attr_value as value - from wf_attribute_value_audit v, acs_attributes a, wf_attribute_info ai - where v.journal_id = :journal_id - and a.attribute_id = v.attribute_id - and ai.attribute_id = v.attribute_id - + select a.attribute_name as name, + a.pretty_name, + a.datatype, + v.attr_value as value + from wf_attribute_value_audit v, acs_attributes a + where v.journal_id = :journal_id + and a.attribute_id = v.attribute_id + - select t.pretty_name, - w.description - from wf_workflows w, acs_object_types t - where w.workflow_key = :workflow_key - and t.object_type = w.workflow_key + select t.pretty_name, + w.description + from wf_workflows w, acs_object_types t + where w.workflow_key = :workflow_key + and t.object_type = w.workflow_key @@ -63,11 +57,11 @@ - select transition_key, transition_name, sort_order - from wf_transitions - where workflow_key = :workflow_key - and trigger_type = 'user' - order by sort_order asc + select transition_key, transition_name, sort_order + from wf_transitions + where workflow_key = :workflow_key + and trigger_type = 'user' + order by sort_order asc @@ -76,38 +70,68 @@ - select a.attribute_name as name, - a.pretty_name, - a.datatype, - ai.wf_datatype, - v.attr_value as value - from wf_attribute_value_audit v, acs_attributes a, wf_attribute_info ai - where v.journal_id = :journal_id - and a.attribute_id = v.attribute_id - and ai.attribute_id = v.attribute_id - + select a.attribute_name as name, + a.pretty_name, + a.datatype, + v.attr_value as value + from wf_attribute_value_audit v, acs_attributes a + where v.journal_id = :journal_id + and a.attribute_id = v.attribute_id + + select case_id from wf_tasks where task_id = :task_id + + + + select place_key from wf_places where workflow_key = :workflow_key + + + + + select role_key from wf_roles where workflow_key = :workflow_key + + + + + + + select transition_key from wf_transitions where workflow_key = :workflow_key + + + + + + + + insert into wf_context_transition_info + (context_key, workflow_key, transition_key, estimated_minutes, instructions) + values (:context_key, :workflow_key, :transition_key, :estimated_minutes, :instructions) + + + + + - select wf.description, - ot.pretty_name, - ot.pretty_plural, - ot.table_name - from wf_workflows wf, - acs_object_types ot - where wf.workflow_key = :workflow_key - and ot.object_type = wf.workflow_key + select wf.description, + ot.pretty_name, + ot.pretty_plural, + ot.table_name + from wf_workflows wf, + acs_object_types ot + where wf.workflow_key = :workflow_key + and ot.object_type = wf.workflow_key @@ -119,9 +143,22 @@ select place_key, place_name, sort_order - from wf_places + from wf_places + where workflow_key = :workflow_key + order by sort_order asc + + + + + + + + + select role_key, + role_name, + sort_order + from wf_roles where workflow_key = :workflow_key - order by sort_order asc @@ -130,11 +167,11 @@ - select transition_key, transition_name, sort_order - from wf_transitions - where workflow_key = :workflow_key - and trigger_type = 'user' - order by sort_order asc + select transition_key, transition_name, sort_order + from wf_transitions + where workflow_key = :workflow_key + and trigger_type = 'user' + order by sort_order asc @@ -143,15 +180,15 @@ - select transition_key, - place_key, - direction, - guard_callback, - guard_custom_arg, - guard_description - from wf_arcs - where workflow_key = :workflow_key - order by transition_key asc + select transition_key, + place_key, + direction, + guard_callback, + guard_custom_arg, + guard_description + from wf_arcs + where workflow_key = :workflow_key + order by transition_key asc @@ -160,39 +197,39 @@ - select attribute_id, - attribute_name, - datatype, - pretty_name, - default_value - from acs_attributes - where object_type = :workflow_key - + select a.attribute_name as name, + a.pretty_name, + a.datatype, + v.attr_value as value + from wf_attribute_value_audit v, acs_attributes a + where v.journal_id = :journal_id + and a.attribute_id = v.attribute_id + - select transition_key, - sort_order - from wf_transition_attribute_map - where workflow_key = :workflow_key - and attribute_id = :attribute_id - + select transition_key, + sort_order + from wf_transition_attribute_map + where workflow_key = :workflow_key + and attribute_id = :attribute_id + - + - select transition_key, - assign_transition_key - from wf_transition_assignment_map - where workflow_key = :workflow_key - order by transition_key + select transition_key, + assign_role_key + from wf_transition_role_assign_map + where workflow_key = :workflow_key + order by transition_key @@ -201,25 +238,39 @@ - select transition_key, - estimated_minutes, - enable_callback, - enable_custom_arg, - fire_callback, - fire_custom_arg, + select transition_key, + estimated_minutes, + instructions, + enable_callback, + enable_custom_arg, + fire_callback, + fire_custom_arg, + time_callback, + time_custom_arg, + deadline_callback, + deadline_custom_arg, + deadline_attribute_name, + hold_timeout_callback, + hold_timeout_custom_arg, + notification_callback, + notification_custom_arg, + unassigned_callback, + unassigned_custom_arg + from wf_context_transition_info + where workflow_key = :workflow_key + and context_key = :context_key + + + + + + + + + select role_key, assignment_callback, - assignment_custom_arg, - time_callback, - time_custom_arg, - deadline_callback, - deadline_custom_arg, - deadline_attribute_name, - hold_timeout_callback, - hold_timeout_custom_arg, - notification_callback, - notification_custom_arg, - access_privilege - from wf_context_transition_info + assignment_custom_arg + from wf_context_role_info where workflow_key = :workflow_key and context_key = :context_key @@ -230,14 +281,16 @@ - select transition_key, - sort_key, - header, - template_url - from wf_context_task_panels - where context_key = :context_key - and workflow_key = :workflow_key - order by transition_key asc, sort_key asc + select transition_key, + sort_order, + header, + template_url, + overrides_action_p, + only_display_when_started_p + from wf_context_task_panels + where context_key = :context_key + and workflow_key = :workflow_key + order by transition_key asc, sort_order asc Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/assign-yourself.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/assign-yourself.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/assign-yourself.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/assign-yourself.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -15,85 +15,15 @@ } set user_id [ad_conn user_id] -if ![db_0or1row task_info { - select t.case_id, - t.workflow_key, - t.transition_key, - c.object_id, - wcti.access_privilege - from wf_tasks t, wf_cases c, wf_context_transition_info wcti - where wcti.context_key = c.context_key - and wcti.workflow_key = t.workflow_key - and wcti.transition_key = t.transition_key - and c.case_id = t.case_id - and t.task_id = :task_id -}] { - ad_return_complaint 1 "Called for a nonexistent task." - ad_script_abort -} -if ![empty_string_p $access_privilege] { - ad_require_permission $object_id $access_privilege -} +wf_case_add_task_assignment \ + -task_id $task_id \ + -party_id $user_id \ + -permanent -db_transaction { - -# First we've got to ensure that any existing assignees are in -# wf_case_assignments, so they stay assigned - -db_dml move_assignees { - insert into wf_case_assignments - (case_id, transition_key, workflow_key, party_id) - select :case_id, :transition_key, :workflow_key, ta.party_id - from wf_task_assignments ta - where task_id = :task_id - and not exists (select 1 from wf_case_assignments ca - where ca.party_id = ta.party_id - and ca.workflow_key = :workflow_key - and ca.case_id = :case_id - and ca.transition_key = :transition_key) -} - -# A dumb way to do this, but add_manual_assignment doesn't do any -# error checking - -db_dml delete_self_case { - delete from wf_case_assignments - where workflow_key = :workflow_key - and case_id = :case_id - and transition_key = :transition_key - and party_id = :user_id -} - -db_exec_plsql add_self_case { - begin - workflow_case.add_manual_assignment ( - case_id => :case_id, - transition_key => :transition_key, - party_id => :user_id - ); - end; -} - -db_dml delete_self_task { - delete from wf_task_assignments - where party_id = :user_id - and task_id = :task_id -} - -db_exec_plsql add_self_task { - begin - workflow_case.add_task_assignment ( - task_id => :task_id, - party_id => :user_id - ); - end; +if [empty_string_p return_url] { + ad_returnredirect task?task_id=$task_id + return } -} on_error { - - ad_return_complaint 1 "

$errmsg
" - ad_script_abort -} - -ad_returnredirect "task?[export_url_vars task_id return_url]" +ad_returnredirect $return_url \ No newline at end of file Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-2.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-2.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-2.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -5,69 +5,10 @@ party_id:integer {return_url "task?[export_url_vars task_id]"} } +wf_case_add_task_assignment \ + -task_id $task_id \ + -party_id $party_id \ + -permanent -set user_id [ad_conn user_id] - -if ![db_0or1row task_info { - select t.case_id, - t.workflow_key, - t.transition_key, - c.object_id, - wcti.access_privilege - from wf_tasks t, wf_cases c, wf_context_transition_info wcti - where wcti.context_key = c.context_key - and wcti.workflow_key = t.workflow_key - and wcti.transition_key = t.transition_key - and c.case_id = t.case_id - and t.task_id = :task_id -}] { - ad_return_complaint 1 "Called for a nonexistent task." - ad_script_abort -} - -set this_user_is_assigned_p [db_string this_user_is_assigned_p { - select count(*) from wf_user_tasks where task_id = :task_id and user_id = :user_id -}] - -if { ! $this_user_is_assigned_p && ![empty_string_p $access_privilege] } { - ad_require_permission $object_id $access_privilege -} - -db_transaction { - set num_rows [db_string already_assigned_task " - select count(*) from wf_task_assignments - where task_id = :task_id and party_id = :party_id"] - - if { $num_rows == 0 } { - db_exec_plsql add_assignee_task { - begin - workflow_case.add_task_assignment ( - task_id => :task_id, - party_id => :party_id - ); - end; - } - } - - set num_rows [db_string already_assigned_case " - select count(*) from wf_case_assignments - where workflow_key = :workflow_key - and case_id = :case_id - and transition_key = :transition_key - and party_id = :party_id"] - - if { $num_rows == 0 } { - db_exec_plsql add_assignee_case { - begin - workflow_case.add_manual_assignment ( - case_id => :case_id, - transition_key => :transition_key, - party_id => :party_id - ); - end; - } - } -} - ad_returnredirect $return_url Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-oracle.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-oracle.xql 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,4 +1,5 @@ + oracle8.1.6 @@ -8,9 +9,14 @@ select p.party_id, acs_object.name(p.party_id) as name, p.email - from parties p - where not exists (select 1 from wf_task_assignments ta where ta.task_id = :task_id and ta.party_id = p.party_id) + from parties p + where not exists (select 1 from wf_task_assignments ta where ta.task_id = :task_id and ta.party_id = p.party_id) + and 0 < (select count(*) + from users u, party_approved_member_map m + where m.party_id = p.party_id + and u.user_id = m.member_id) +
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-postgresql.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-postgresql.xql 14 May 2001 23:16:08 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add-postgresql.xql 19 Nov 2001 18:27:40 -0000 1.3 @@ -1,4 +1,5 @@ + postgresql7.1 @@ -8,9 +9,14 @@ select p.party_id, acs_object__name(p.party_id) as name, p.email - from parties p - where not exists (select 1 from wf_task_assignments ta where ta.task_id = :task_id and ta.party_id = p.party_id) + from parties p + where not exists (select 1 from wf_task_assignments ta where ta.task_id = :task_id and ta.party_id = p.party_id) + and 0 < (select count(*) + from users u, party_approved_member_map m + where m.party_id = p.party_id + and u.user_id = m.member_id) +
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add.adp 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,17 +1,35 @@ Add Assignee -assign.paprty_id +@focus@

Add Assignee

@context_bar@
-
-@export_vars@ - - - -
Party to assign@party_widget@
-
+ +
+ Every possible assignee is already assigned +

+

+
+
-
\ No newline at end of file + +
+ @export_vars@ + + + + + +
+ Party to assign + + @party_widget@ +
+
+
+ + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-add.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -7,32 +7,42 @@ context_bar export_vars party_widget + return_url + focus } array set task [wf_task_info $task_id] -# if the user is assigned, they can always view the task. -# if they aren't assigned and there is an access_privilege, we check it -if { ! $task(this_user_is_assigned_p) && ![empty_string_p $task(access_privilege)]} { - ad_require_permission $task(object_id) $task(access_privilege) -} +set context_bar [ad_context_bar [list "case?[export_vars -url {{case_id $task(case_id)}}]" "$task(object_name) case"] [list "task?[export_vars -url {task_id}]" "$task(task_name)"] "Add assignee"] -set context_bar [ad_context_bar [list "case?case_idf=$task(case_id)" "Case \"$task(object_name)\""] [list "task?[export_url_vars task_id]" "Task \"$task(task_name)\""] "Add assignee"] +set export_vars [export_vars -form {task_id return_url}] -set export_vars [export_form_vars task_id return_url] +set focus "assign.party_id" set party_widget "" +if { $count == 0 } { + set party_widget "" + set focus "" +} + ad_return_template Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-remove-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-remove-2.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-remove-2.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/assignee-remove-2.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -3,53 +3,15 @@ } { task_id:integer party_id:integer - {return_url "task-assignees?[export_url_vars task_id]"} + {return_url "task-assignees?[export_vars -url {task_id}]"} } # should add some check that you aren't deleting an assignment # if the person has actually started the task. -set user_id [ad_conn user_id] +wf_case_remove_task_assignment \ + -task_id $task_id \ + -party_id $party_id \ + -permanent -if ![db_0or1row task_info { - select t.case_id, - t.transition_key, - c.object_id, - wcti.access_privilege - from wf_tasks t, wf_cases c, wf_context_transition_info wcti - where wcti.context_key = c.context_key - and wcti.workflow_key = t.workflow_key - and wcti.transition_key = t.transition_key - and c.case_id = t.case_id - and t.task_id = :task_id -}] { - ad_return_complaint 1 "Called for a nonexistent task." - ad_script_abort -} - -set this_user_is_assigned_p [db_string this_user_is_assigned_p { - select count(*) from wf_user_tasks where task_id = :task_id and user_id = :user_id -}] - -if { ! $this_user_is_assigned_p && ![empty_string_p $access_privilege]} { - ad_require_permission $object_id $access_privilege -} - -db_transaction { - db_exec_plsql remove_assignee_task { - begin - workflow_case.remove_task_assignment ( - task_id => :task_id, - party_id => :party_id - ); - - workflow_case.remove_manual_assignment ( - case_id => :case_id, - transition_key => :transition_key, - party_id => :party_id - ); - end; - } -} - ad_returnredirect $return_url Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/case-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/case-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/case-oracle.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/case-oracle.xql 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,4 +1,5 @@ + oracle8.1.6 @@ -15,24 +16,5 @@ - - - - - - select tok.token_id, - tok.place_key, - tok.locked_task_id, - ta.transition_key - from wf_tokens tok, - wf_tasks ta - where tok.case_id = :case_id - and ta.task_id (+) = tok.locked_task_id - and tok.state in ('free', 'locked') - - - - - Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/case-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/case-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/case-postgresql.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/case-postgresql.xql 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,4 +1,5 @@ + postgresql7.1 @@ -14,21 +15,6 @@ - - - - select tok.token_id, - tok.place_key, - tok.locked_task_id, - ta.transition_key - from wf_tokens tok left outer join - wf_tasks ta on ta.task_id = tok.locked_task_id - where tok.case_id = :case_id - and tok.state in ('free', 'locked') - - - - Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/case.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/case.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/case.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/case.adp 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,87 +1,195 @@ -Case: @case.object_name@ (@case.state@) -

Case: @case.object_name@ (@case.state@)

+@case.object_name@ case +

@case.object_name@ case

@context_bar@
- +
- - - - - -
- Actions: - - (@actions.title@) - -
- (debug case) -
+ - -

Process

-
- @workflow_img_tag@ -
-
+ -

Currently Enabled Tasks

+ + + + + +
+ + + + + + + +
+ This case is currently @case.state@ +
+ + + + + +
+ + Change state: + + (@actions.title@) + + + + (debug case) +
+
+
- - - - -
- - - - - +

+ + +

Task NameStateEnabled Date
+ + - - - - - - - - - -
+ + + + + + + +
+ Active Tasks +
+ +
+
@current_tasks.transition_name@@current_tasks.state@@current_tasks.enabled_date_pretty@
no current_tasks
+ +

+ + + + + + +
+ + + + + + + +
+ Manual Assignments +
+ +
+
+ +

+ + + + + + +
+ + + + + + + +
+ Deadlines +
+ +
+
+ +

+ + + + + + +
+ + + + + + + +
+ Past Tasks +
+ +
+
+ +

+ + + + + + +
+ + + + + + + +
+ Attributes +
+ +
+
+

+ -

All Tasks So Far

+ - - - -
- - - - - + +
Task NameStateEnabled Date
+ + - - - - - - - - - -
+ + + + + + + +
+ Process State +
+ +
+
@old_tasks.transition_name@@old_tasks.state@@old_tasks.enabled_date_pretty@
no old_tasks
+
+ -

Journal

+ - + + + + +
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/case.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/case.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/case.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/case.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -10,9 +10,11 @@ case:onerow context_bar actions:multirow - workflow_img_tag + return_url } +set return_url "[ns_conn url]?[export_vars -url {case_id}]" + db_1row case_info { select case_id, acs_object.name(object_id) as object_name, @@ -30,8 +32,8 @@ template::multirow create actions url title switch $case(state) { active { - template::multirow append actions "case-state-change?[export_url_vars case_id]&action=suspend" "suspend" - template::multirow append actions "case-state-change?[export_url_vars case_id]&action=cancel" "cancel" + template::multirow append actions "case-state-change?[export_vars -url {case_id {action suspend}}]" "suspend" + template::multirow append actions "case-state-change?[export_vars -url {case_id {action cancel}}]" "cancel" } suspended { template::multirow append actions "case-state-change?[export_url_vars case_id]&action=resume" "resume" @@ -42,116 +44,13 @@ } } -set workflow_info [wf_get_workflow_net $case(workflow_key)] -array set workflow $workflow_info -wf_decorate_workflow workflow +ad_return_template -set date_format "Mon fmDDfm, YYYY HH24:MI:SS" -db_multirow current_tasks current_tasks { - select t.task_id, - t.transition_key, - t.state, - t.case_id, - tr.transition_name, - to_char(t.enabled_date, :date_format) as enabled_date_pretty - from wf_tasks t, wf_transitions tr - where t.case_id = :case_id - and t.state in ('enabled', 'started') - and tr.workflow_key = t.workflow_key - and tr.transition_key = t.transition_key - order by t.enabled_date desc -} -db_multirow old_tasks old_tasks { - select t.task_id, - t.transition_key, - t.state, - t.case_id, - tr.transition_name, - to_char(t.enabled_date, :date_format) as enabled_date_pretty - from wf_tasks t, wf_transitions tr - where t.case_id = :case_id - and t.state not in ('enabled', 'started') - and tr.workflow_key = t.workflow_key - and tr.transition_key = t.transition_key - order by t.enabled_date desc -} -##### -# -# Add marking to the graph -# -##### -foreach place_key $workflow(places) { - set workflow(place,$place_key,num_tokens) 0 -} -foreach transition_key $workflow(transitions) { - set workflow(transition,$transition_key,num_tokens) 0 -} -db_foreach tokens { - select tok.token_id, - tok.place_key, - tok.locked_task_id, - ta.transition_key - from wf_tokens tok, - wf_tasks ta - where tok.case_id = :case_id - and ta.task_id (+) = tok.locked_task_id - and tok.state in ('free', 'locked') -} { - if { [empty_string_p $transition_key] } { - incr workflow(place,$place_key,num_tokens) - } else { - incr workflow(transition,$transition_key,num_tokens) - } -} -foreach place_key $workflow(places) { - if { $workflow(place,$place_key,num_tokens) > 0 } { - append workflow(place,$place_key,place_name) "\\n[string repeat "*" $workflow(place,$place_key,num_tokens)]" - lappend workflow(selected_place_key) $place_key - } -} -foreach transition_key $workflow(transitions) { - if { $workflow(transition,$transition_key,num_tokens) > 0 } { - append workflow(transition,$transition_key,transition_name) "\\n[string repeat "*" $workflow(transition,$transition_key,num_tokens)]" - lappend workflow(selected_transition_key) $transition_key - } -} - - -db_release_unused_handles - -##### -# -# Create the workflow gif -# -##### - -if { [wf_graphviz_installed_p] } { - - set dot_text [wf_generate_dot_representation workflow] - - set tmpfile [wf_graphviz_dot_exec -to_file -output gif $dot_text] - - set width_and_height "" - if { ![catch { set image_size [ns_gifsize $tmpfile] } error] } { - if { ![empty_string_p $image_size] } { - set width_and_height "width=[lindex $image_size 0] height=[lindex $image_size 1]" - } - } - - ad_set_client_property wf wf_net_tmpfile $tmpfile - - set workflow_img_tag "\"Graphical" -} else { - set workflow_img_tag "" -} - - -ad_return_template \ No newline at end of file Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/comment-add-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/comment-add-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/comment-add-oracle.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/comment-add-oracle.xql 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,4 +1,5 @@ + oracle8.1.6 Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/comment-add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/comment-add-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/comment-add-postgresql.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/comment-add-postgresql.xql 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,4 +1,5 @@ + postgresql7.1 Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/comment-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/comment-add.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/comment-add.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/comment-add.adp 19 Nov 2001 18:27:40 -0000 1.2 @@ -7,7 +7,7 @@
- +
Comment
Comment
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/index.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/index.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/index.adp 19 Nov 2001 18:27:40 -0000 1.2 @@ -4,9 +4,10 @@ @context_bar@
-(Administer) + + (Administer)

+ -

Tasks You Are Currently Working On

@@ -17,8 +18,10 @@ -

Unassigned Tasks

- + +

Unassigned Tasks

+ +
\ No newline at end of file Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/index.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/index.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/index.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -6,8 +6,11 @@ @cvs-id $Id$ } -properties { context_bar + admin_p } +set admin_p [ad_permission_p [ad_conn package_id] "admin"] + set context_bar [ad_context_bar] ad_return_template \ No newline at end of file Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/journal-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/journal-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/journal-oracle.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/journal-oracle.xql 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,10 +1,11 @@ + oracle8.1.6 - + select j.journal_id, j.action, j.action_pretty, @@ -18,16 +19,14 @@ a.attribute_name as attribute_name, a.pretty_name as attribute_pretty_name, a.datatype as attribute_datatype, - ai.wf_datatype as attribute_wf_datatype, v.attr_value as attribute_value from journal_entries j, acs_objects o, parties p, - wf_attribute_value_audit v, acs_attributes a, wf_attribute_info ai + wf_attribute_value_audit v, acs_attributes a where j.object_id = :case_id and o.object_id = j.journal_id and p.party_id (+) = o.creation_user and v.journal_id (+) = j.journal_id and a.attribute_id (+) = v.attribute_id - and ai.attribute_id (+) = v.attribute_id order by o.creation_date $sql_order, j.journal_id $sql_order Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/journal-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/journal-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/journal-postgresql.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/journal-postgresql.xql 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,4 +1,5 @@ + postgresql7.1 @@ -18,14 +19,11 @@ a.attribute_name as attribute_name, a.pretty_name as attribute_pretty_name, a.datatype as attribute_datatype, - ai.wf_datatype as attribute_wf_datatype, v.attr_value as attribute_value - from ((journal_entries j LEFT OUTER JOIN wf_attribute_value_audit v - on v.journal_id = j.journal_id) LEFT OUTER JOIN acs_attributes a - on a.attribute_id = v.attribute_id) LEFT OUTER JOIN - wf_attribute_info ai on ai.attribute_id = v.attribute_id, - acs_objects o left outer join parties p - on p.party_id = o.creation_user + from (journal_entries j LEFT OUTER JOIN wf_attribute_value_audit v + on (j.journal_id = v.journal_id)) LEFT OUTER JOIN acs_attributes a + on (v.attribute_id = a.attribute_id), + acs_objects o left outer join parties p on (o.creation_user = p.party_id) where j.object_id = :case_id and o.object_id = j.journal_id order by o.creation_date $sql_order, j.journal_id $sql_order Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/journal.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/journal.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/journal.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/journal.adp 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,61 +1,58 @@ - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
 Journal - [ comment ] -   + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
 Journal + [ comment ] +   +
+
+ No actions yet. +
ActionDateUserOutputComment
@journal.action_pretty@@journal.creation_date_pretty@@journal.creation_user_name@ +   + + + @journal.attribute_pretty_name@: @journal.attribute_value@
+
+
+
+   + @journal.msg@ +
- -
No actions yet.
ActionDateUserOutputComment
@journal.action_pretty@@journal.creation_date_pretty@@journal.creation_user_name@ -   - - - @journal.attribute_pretty_name@: @journal.attribute_value@
-
-
-
-   - @journal.msg@ -
- -
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/journal.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/journal.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/journal.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/journal.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -40,16 +40,14 @@ a.attribute_name as attribute_name, a.pretty_name as attribute_pretty_name, a.datatype as attribute_datatype, - ai.wf_datatype as attribute_wf_datatype, v.attr_value as attribute_value from journal_entries j, acs_objects o, parties p, - wf_attribute_value_audit v, acs_attributes a, wf_attribute_info ai + wf_attribute_value_audit v, acs_attributes a where j.object_id = :case_id and o.object_id = j.journal_id and p.party_id (+) = o.creation_user and v.journal_id (+) = j.journal_id and a.attribute_id (+) = v.attribute_id - and ai.attribute_id (+) = v.attribute_id order by o.creation_date $sql_order, j.journal_id $sql_order " Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task-action.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task-action.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task-action.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task-action.adp 19 Nov 2001 18:27:40 -0000 1.2 @@ -60,10 +60,10 @@ @export_form_vars@ - + - - + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task-action.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task-action.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task-action.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task-action.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -2,7 +2,7 @@ # task:onerow # task_attributes_to_set:multirow # task_assigned_users:multirow -# task_transitions_to_assign:multirow +# task_roles_to_assign:multirow set user_id [ad_conn user_id] Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees-oracle.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees-oracle.xql 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,4 +1,5 @@ + oracle8.1.6 @@ -8,11 +9,14 @@ select p.party_id, acs_object.name(p.party_id) as name, p.email, - '' as remove_url + '' as remove_url, + o.object_type from wf_task_assignments ta, - parties p + parties p, + acs_objects o where ta.task_id = :task_id and p.party_id = ta.party_id + and o.object_id = p.party_id Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees-postgresql.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees-postgresql.xql 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,4 +1,5 @@ + postgresql7.1 @@ -8,11 +9,14 @@ select p.party_id, acs_object__name(p.party_id) as name, p.email, - '' as remove_url + '' as remove_url, + o.object_type from wf_task_assignments ta, - parties p + parties p, + acs_objects o where ta.task_id = :task_id and p.party_id = ta.party_id + and o.object_id = p.party_id Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees.adp 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,18 +1,25 @@ -Remove Assignees +Reassign Task -

Remove Assignees

+

Reassign Task

@context_bar@
-

Assignees

+

Current Assignees

Assign user to @task_transitions_to_assign.transition_name@@task_transitions_to_assign.assignment_widget@Assign @task_roles_to_assign.role_name@@task_roles_to_assign.assignment_widget@
- -@done_export_vars@ - - + + @done_export_vars@ + + + +
- -
+ +
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task-assignees.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -2,46 +2,45 @@ Remove one or more assignees for a task. } { task_id:integer - {return_url "task?[export_url_vars task_id]"} + {return_url ""} } -properties { context_bar task:onerow assignees:multirow effective_assignees:multirow + done_action_url done_export_vars } array set task [wf_task_info $task_id] -# if the user is assigned, they can always view the task. -# if they aren't assigned and there is an access_privilege, we check it -if { ! $task(this_user_is_assigned_p) && ![empty_string_p $task(access_privilege)]} { - ad_require_permission $task(object_id) $task(access_privilege) -} - - set party_id [ad_conn user_id] -set orig_return_url $return_url -set return_url "task-assignees?[export_url_vars task_id return_url]" -set task(add_assignee_url) "assignee-add?[export_url_vars task_id return_url]" -set task(assign_yourself_url) "assignee-add-2?[export_url_vars task_id party_id return_url]" +set sub_return_url "[ns_conn url]?[export_vars -url {task_id return_url}]" +set task(add_assignee_url) "assignee-add?[export_vars -url {task_id {return_url $sub_return_url}}]" +set task(assign_yourself_url) "assignee-add-2?[export_vars -url {task_id party_id {return_url $sub_return_url}}]" -set context_bar [ad_context_bar [list "case?case_id=$task(case_id)" "$task(object_name) case"] [list "task?[export_url_vars task_id]" "$task(task_name)"] "Assignees"] +set context_bar [ad_context_bar [list "case?[export_vars -url {{case_id $task(case_id)}}]" "$task(object_name) case"] [list "task?[export_vars -url {task_id}]" "$task(task_name)"] "Assignees"] db_multirow assignees assignees { select p.party_id, acs_object.name(p.party_id) as name, p.email, - '' as remove_url + '' as remove_url, + o.object_type from wf_task_assignments ta, - parties p + parties p, + acs_objects o where ta.task_id = :task_id and p.party_id = ta.party_id + and o.object_id = p.party_id } { - set remove_url "assignee-remove-2?[export_url_vars task_id party_id return_url]" + set remove_url "assignee-remove-2?[export_vars -url {task_id party_id {return_url $sub_return_url}}]" + if { [string equal $object_type "user"] } { + set url "/shared/community-member?[export_vars -url {{user_id $party_id}}]" + } } - +set __i 0 db_multirow effective_assignees effective_assignees { select distinct u.user_id, acs_object.name(u.user_id) as name, @@ -54,10 +53,17 @@ and m.party_id = ta.party_id and p.party_id = m.member_id and u.user_id = p.party_id +} { + incr __i + set effective_assignees:${__i}(url) "/shared/community-member?[export_vars -url {user_id}]" } -set return_url $orig_return_url -set done_export_vars [export_form_vars task_id return_url] +if { [empty_string_p $return_url] } { + set return_url "task?[export_vars -url {task_id}]" +} +set done_export_vars [export_vars -form [wf_split_query_url_to_arg_spec $return_url]] +set done_action_url [lindex [split $return_url "?"] 0] ad_return_template + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task-default-info.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task-default-info.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task-default-info.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task-default-info.adp 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,13 +1,10 @@ - - - - - - - - - - - + + + + + + + +
Object Type@task.object_type_pretty@
Object@task.object_name@
Object Type@task.object_type_pretty@
Object@task.object_name@
\ No newline at end of file Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task-default-info.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task-default-info.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task-default-info.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task-default-info.tcl 19 Nov 2001 18:27:40 -0000 1.2 @@ -1,8 +1,5 @@ # This template expects the following properties: # task:onerow -# task_attributes_to_set:multirow -# task_assigned_users:multirow -# task_transitions_to_assign:multirow ad_return_template Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list-oracle.xql 14 May 2001 03:55:24 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list-oracle.xql 19 Nov 2001 18:27:40 -0000 1.2 @@ -30,13 +30,5 @@ - - - - - decode(wcti.access_privilege,'','t',acs_permission.permission_p(c.object_id, :user_id, wcti.access_privilege)) = 't' - - -
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list-postgresql.xql 14 May 2001 03:55:24 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list-postgresql.xql 19 Nov 2001 18:27:40 -0000 1.2 @@ -6,7 +6,7 @@ - "t.task_id, + "t.task_id, t.case_id, t.transition_key, t.enabled_date, @@ -29,13 +29,5 @@ - - - - - (case when wcti.access_privilege = '' then 't' else acs_permission__permission_p(c.object_id, :user_id, wcti.access_privilege) end) = 't' - - -
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list.adp 19 Nov 2001 18:27:40 -0000 1.2 @@ -22,7 +22,7 @@ - @task_list.task_name@ + @task_list.task_name@ Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list.tcl 14 May 2001 03:55:24 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task-list.tcl 19 Nov 2001 18:27:40 -0000 1.3 @@ -11,7 +11,18 @@ set type enabled } +if { ![info exists object_id] || [empty_string_p $object_id] } { + set object_id "" +} +if { ![info exists package_url] || [empty_string_p $package_url] } { + set package_url [ad_conn package_url] +} + +if { ![info exists return_url] || [empty_string_p $return_url] } { + set return_url "" +} + if { ![string equal $type "enabled"] && ![string equal $type "own"] \ && ![string equal $type "unassigned"] } { ad_return_error "Bad type" "Unrecognized type: Type can be 'enabled' or 'own'" @@ -21,6 +32,7 @@ set user_id [ad_get_user_id] set select [db_map select_list] + set from { {wf_cases c} {acs_objects o} @@ -34,36 +46,35 @@ {wft.object_type = c.workflow_key} } +if { ![empty_string_p $object_id] } { + lappend where {o.object_id = :object_id} +} + switch $type { unassigned { - lappend select {tr.transition_name as task_name} - lappend from {wf_tasks t} - lappend from {wf_transitions tr} - lappend from {wf_context_transition_info wcti} - lappend where {tr.workflow_key = t.workflow_key} - lappend where {tr.transition_key = t.transition_key} - lappend where {not exists (select 1 from wf_task_assignments tas where tas.task_id = t.task_id)} - lappend where {t.state = 'enabled'} - lappend where {c.state = 'active'} - lappend where [db_map decode_privilege] - lappend where {wcti.context_key = c.context_key} - lappend where {wcti.workflow_key = tr.workflow_key} - lappend where {wcti.transition_key = tr.transition_key} + lappend select {tr.transition_name as task_name} + lappend from {wf_tasks t} + lappend from {wf_transitions tr} + lappend where {tr.workflow_key = t.workflow_key} + lappend where {tr.transition_key = t.transition_key} + lappend where {not exists (select 1 from wf_task_assignments tas where tas.task_id = t.task_id)} + lappend where {t.state = 'enabled'} + lappend where {c.state = 'active'} } default { - lappend select {t.transition_name as task_name} - lappend from {wf_user_tasks t} - lappend where {t.user_id = :user_id} + lappend select {t.transition_name as task_name} + lappend from {wf_user_tasks t} + lappend where {t.user_id = :user_id} } } switch $type { own { - lappend from {users u} - lappend where {t.state = 'started'} {t.holding_user = t.user_id} {u.user_id = t.user_id} + lappend from {users u} + lappend where {t.state = 'started'} {t.holding_user = t.user_id} {u.user_id = t.user_id} } enabled { - lappend where {t.state = 'enabled'} + lappend where {t.state = 'enabled'} } } @@ -73,5 +84,5 @@ where [join $where "\n and "]" db_multirow task_list started_tasks_select $sql { - set task_url "task?[export_vars -url {task_id}]" + set task_url "task?[export_vars -url {task_id return_url}]" } Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task.adp 18 May 2001 00:35:44 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task.adp 19 Nov 2001 18:27:40 -0000 1.3 @@ -25,7 +25,7 @@ - + @@ -37,23 +37,23 @@

- +
- Extreme actions: (@extreme_actions.title@) -
+

+ Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task.tcl 18 May 2001 00:35:44 -0000 1.3 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task.tcl 19 Nov 2001 18:27:40 -0000 1.4 @@ -20,6 +20,7 @@ user_id return_url export_form_vars + extreme_p } set user_id [ad_get_user_id] @@ -60,14 +61,7 @@ array set task [wf_task_info $task_id] -ns_log Notice "task array = [join [array get task] ","]" -# if the user is assigned, they can always view the task. -# if they aren't assigned and there is an access_privilege, we check it -if { ! $task(this_user_is_assigned_p) && ![empty_string_p $task(access_privilege)]} { - ad_require_permission $task(object_id) $task(access_privilege) -} - set task(add_assignee_url) "assignee-add?[export_url_vars task_id]" set task(assign_yourself_url) "assign-yourself?[export_vars -url {task_id return_url}]" set task(manage_assignments_url) "task-assignees?[export_vars -url {task_id return_url}]" @@ -79,44 +73,85 @@ template::multirow create panels header template_url bgcolor +set this_user_is_assigned_p $task(this_user_is_assigned_p) + db_multirow panels panels { select tp.header, tp.template_url, '' as bgcolor - from wf_context_task_panels tp, + from wf_context_task_panels tp, wf_cases c, wf_tasks t - where t.task_id = :task_id - and c.case_id = t.case_id - and tp.context_key = c.context_key - and tp.workflow_key = c.workflow_key - and tp.transition_key = t.transition_key - order by sort_key + where t.task_id = :task_id + and c.case_id = t.case_id + and tp.context_key = c.context_key + and tp.workflow_key = c.workflow_key + and tp.transition_key = t.transition_key + and (tp.only_display_when_started_p = 'f' or (t.state = 'started' and :this_user_is_assigned_p = 1)) + and tp.overrides_action_p = 'f' + order by tp.sort_order } { set bgcolor $panel_color } +# Only display the default-info-panel when we have nothing better if { ${panels:rowcount} == 0 } { template::multirow append panels "Case" "task-default-info" $panel_color } -template::multirow append panels "Action" "task-action" "#ffffff" +# Display instructions, if any +if { [db_string instruction_check " + select count(*) + from wf_transition_info ti, wf_tasks t + where t.task_id = :task_id + and t.transition_key = ti.transition_key + and t.workflow_key = ti.workflow_key + and instructions is not null +"] } { + template::multirow append panels "Instructions" "task-instructions" $panel_color +} -set panel_width [expr {100/(${panels:rowcount})}] +# Now for action panels -- these are always displayed at the far right -set case_id $task(case_id) +set override_action 0 +db_foreach action_panels { + select tp.header, + tp.template_url + from wf_context_task_panels tp, + wf_cases c, + wf_tasks t + where t.task_id = :task_id + and c.case_id = t.case_id + and tp.context_key = c.context_key + and tp.workflow_key = c.workflow_key + and tp.transition_key = t.transition_key + and (tp.only_display_when_started_p = 'f' or (t.state = 'started' and :this_user_is_assigned_p = 1)) + and tp.overrides_action_p = 't' + order by tp.sort_order +} { + set override_action 1 + template::multirow append panels $header $template_url "#ffffff" +} -set case_finished_p [db_string case_finished "select count(*) from wf_cases where case_id = (select distinct case_id from wf_tasks where task_id = :task_id) and state = 'finished'"] +if { $override_action == 0 } { + template::multirow append panels "Action" "task-action" "#ffffff" +} -template::multirow create extreme_actions url title -template::multirow append extreme_actions "case-state-change?[export_url_vars case_id]&action=suspend" "suspend case" -template::multirow append extreme_actions "case-state-change?[export_url_vars case_id]&action=cancel" "cancel case" +set panel_width [expr {100/(${panels:rowcount})}] -set export_form_vars [export_vars -form {task_id return_url}] +set case_id $task(case_id) -ad_return_template +set case_state [db_string case_state "select state from wf_cases where case_id = :case_id"] +set extreme_p 0 +if {[string compare $case_state "active"] == 0} { + set extreme_p 1 + template::multirow create extreme_actions url title + template::multirow append extreme_actions "case-state-change?[export_url_vars case_id]&action=suspend" "suspend case" + template::multirow append extreme_actions "case-state-change?[export_url_vars case_id]&action=cancel" "cancel case" +} +set export_form_vars [export_vars -form {task_id return_url}] - +ad_return_template Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/task.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/task.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/task.xql 25 Apr 2001 04:52:44 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/task.xql 19 Nov 2001 18:27:40 -0000 1.2 @@ -7,18 +7,62 @@ select tp.header, tp.template_url, '' as bgcolor - from wf_context_task_panels tp, + from wf_context_task_panels tp, wf_cases c, wf_tasks t - where t.task_id = :task_id - and c.case_id = t.case_id - and tp.context_key = c.context_key - and tp.workflow_key = c.workflow_key - and tp.transition_key = t.transition_key - order by sort_key + where t.task_id = :task_id + and c.case_id = t.case_id + and tp.context_key = c.context_key + and tp.workflow_key = c.workflow_key + and tp.transition_key = t.transition_key + and (tp.only_display_when_started_p = 'f' or (t.state = 'started' and :this_user_is_assigned_p = 1)) + and tp.overrides_action_p = 'f' + order by tp.sort_order + + + + select count(*) + from wf_transition_info ti, wf_tasks t + where t.task_id = :task_id + and t.transition_key = ti.transition_key + and t.workflow_key = ti.workflow_key + and instructions is not null + + + + + + + + + select tp.header, + tp.template_url + from wf_context_task_panels tp, + wf_cases c, + wf_tasks t + where t.task_id = :task_id + and c.case_id = t.case_id + and tp.context_key = c.context_key + and tp.workflow_key = c.workflow_key + and tp.transition_key = t.transition_key + and (tp.only_display_when_started_p = 'f' or (t.state = 'started' and :this_user_is_assigned_p = 1)) + and tp.overrides_action_p = 't' + order by tp.sort_order + + + + + + + + select state from wf_cases where case_id = :case_id + + + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/arc-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/arc-delete.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/arc-delete.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/arc-delete.tcl 19 Nov 2001 18:29:28 -0000 1.2 @@ -12,14 +12,10 @@ {return_url "define?[export_url_vars workflow_key transition_key]"} } -db_dml delete_arc { - delete from wf_arcs - where workflow_key = :workflow_key - and transition_key = :transition_key - and place_key = :place_key - and direction = :direction -} +wf_delete_arc \ + -workflow_key $workflow_key \ + -transition_key $transition_key \ + -place_key $place_key \ + -direction $direction -wf_workflow_changed $workflow_key - ad_returnredirect $return_url Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/arc-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/arc-edit.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/arc-edit.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/arc-edit.adp 19 Nov 2001 18:29:28 -0000 1.2 @@ -46,5 +46,5 @@ - + \ No newline at end of file Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add-2-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add-2-oracle.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add-2-oracle.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -1,4 +1,5 @@ + oracle8.1.6 Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add-2-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add-2-postgresql.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add-2-postgresql.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -1,25 +1,25 @@ + postgresql7.1 - select workflow__create_attribute( + select workflow__create_attribute( :workflow_key, :attribute_name, :datatype, :pretty_name, - null, - null, - null, + null, + null, + null, :default_value, - 1, - 1, - null, - 'generic', - 'none' - ) + 1, + 1, + null, + 'generic' + ); Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add-2.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add-2.tcl 18 May 2001 12:15:10 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add-2.tcl 19 Nov 2001 18:29:28 -0000 1.3 @@ -10,6 +10,7 @@ pretty_name datatype default_value + {return_url "attributes?[export_vars -url {workflow_key}]"} } db_exec_plsql create_attribute { @@ -26,4 +27,4 @@ end; } -ad_returnredirect "attributes?[export_vars -url {workflow_key}]" +ad_returnredirect $return_url Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-add.tcl 19 Nov 2001 18:29:28 -0000 1.2 @@ -6,6 +6,7 @@ @cvs-id $Id$ } { workflow_key + return_url:optional } -properties { context_bar workflow_name @@ -19,9 +20,9 @@ where ot.object_type = :workflow_key } -set context_bar [ad_context_bar [list "workflow?[export_url_vars workflow_key]" "$workflow_name"] [list "attributes?[export_vars -url {workflow_key}]" "Attributes"] "Add attribute"] +set context_bar [ad_context_bar [list "workflow?[export_vars -url {workflow_key}]" "$workflow_name"] [list "attributes?[export_vars -url {workflow_key}]" "Attributes"] "Add attribute"] -set export_vars [export_vars -form { workflow_key }] +set export_vars [export_vars -form {workflow_key return_url}] db_multirow datatypes datatype { select datatype Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete-oracle.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete-oracle.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -1,7 +1,8 @@ + oracle8.1.6 - + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete-postgresql.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete-postgresql.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -1,11 +1,12 @@ + postgresql7.1 - - select workflow__drop_attribute( + + select workflow__drop_attribute( :workflow_key, :attribute_name ); Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete.tcl 18 May 2001 12:15:10 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete.tcl 19 Nov 2001 18:29:28 -0000 1.3 @@ -7,6 +7,7 @@ } { workflow_key attribute_id + {return_url "attributes?[export_vars -url {workflow_key}]"} } db_transaction { @@ -34,5 +35,5 @@ } } -ad_returnredirect "attributes?[export_vars -url {workflow_key}]" +ad_returnredirect $return_url Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attribute-delete.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -12,18 +12,4 @@ - - - - begin - workflow.drop_attribute( - workflow_key => :workflow_key, - attribute_name => :attribute_name - ); - end; - - - - - Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attributes.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attributes.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attributes.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attributes.adp 19 Nov 2001 18:29:28 -0000 1.2 @@ -11,70 +11,21 @@   - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
No.Attribute nameDatatypeUsedAction
- No attributes -
@attributes.sort_order@.@attributes.pretty_name@@attributes.datatype@ - Yes - No - - - (edit) - - - (delete) - -
-
+     - -   - (add attribute) - - -   -

- - - - - - + + + + + +
- \ No newline at end of file + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attributes.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attributes.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attributes.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attributes.tcl 19 Nov 2001 18:29:28 -0000 1.2 @@ -1,5 +1,5 @@ ad_page_contract { - Manage workflow task panels. + Manage workflow attributes. @author Lars Pind (lars@pinds.com) @creation-date December 15, 2000 @@ -17,8 +17,6 @@ } -properties { workflow_key context_bar - attributes:multirow - add_url } db_1row workflow_name { @@ -29,25 +27,6 @@ set context_bar [ad_context_bar [list "workflow?[export_url_vars workflow_key]" "$workflow_name"] "Attributes"] -db_multirow attributes attributes { - select a.attribute_id, - a.sort_order, - a.attribute_name, - a.pretty_name, - a.datatype, - '' as delete_url, - (select count(*) from wf_transition_attribute_map m - where m.workflow_key = a.object_type - and m.attribute_id = a.attribute_id) as used_p - from acs_attributes a - where a.object_type = :workflow_key - order by sort_order -} { - set delete_url "attribute-delete?[export_vars -url {workflow_key attribute_id}]" -} - -set add_url "attribute-add?[export_vars -url {workflow_key}]" - ad_return_template Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attributes.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attributes.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attributes.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/attributes.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -21,24 +21,4 @@ - - - - select a.attribute_id, - a.sort_order, - a.attribute_name, - a.pretty_name, - a.datatype, - '' as delete_url, - (select count(*) from wf_transition_attribute_map m - where m.workflow_key = a.object_type - and m.attribute_id = a.attribute_id) as used_p - from acs_attributes a - where a.object_type = :workflow_key - order by sort_order - - - - -
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/case-debug-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/case-debug-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/case-debug-oracle.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/case-debug-oracle.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -1,4 +1,5 @@ + oracle8.1.6 @@ -22,4 +23,21 @@ + + + + + select token_id, place_key, case_id, state, locked_task_id, + to_char(produced_date, 'YYYY-MM-DD HH24:MI:SS') as produced_date_pretty, + to_char(locked_date, 'YYYY-MM-DD HH24:MI:SS') as locked_date_pretty, + to_char(consumed_date, 'YYYY-MM-DD HH24:MI:SS') as consumed_date_pretty, + to_char(canceled_date, 'YYYY-MM-DD HH24:MI:SS') as canceled_date_pretty + from wf_tokens + where case_id = :case_id + and state in ('consumed', 'canceled') + + + + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/case-debug-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/case-debug-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/case-debug-postgresql.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/case-debug-postgresql.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -1,4 +1,5 @@ + postgresql7.1 @@ -22,4 +23,21 @@ + + + + + select token_id, place_key, case_id, state, locked_task_id, + to_char(produced_date, 'YYYY-MM-DD HH24:MI:SS') as produced_date_pretty, + to_char(locked_date, 'YYYY-MM-DD HH24:MI:SS') as locked_date_pretty, + to_char(consumed_date, 'YYYY-MM-DD HH24:MI:SS') as consumed_date_pretty, + to_char(canceled_date, 'YYYY-MM-DD HH24:MI:SS') as canceled_date_pretty + from wf_tokens + where case_id = :case_id + and state in ('consumed', 'canceled') + + + + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/case-debug.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/case-debug.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/case-debug.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/case-debug.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -1,13 +1,13 @@ - + select task_id, transition_key, state, case_id from wf_tasks where case_id = :case_id - order by case when state = 'started' then 1 when state = 'enabled' then 2 when state = 'finished' then 3 else 4 end + order by case when state = 'started' then 1 when state = 'enabled' then 2 when state = 'finished' then 3 else 4 end @@ -25,22 +25,6 @@ - - - - select token_id, place_key, case_id, state, locked_task_id, - to_char(produced_date, 'YYYY-MM-DD HH24:MI:SS') as produced_date_pretty, - to_char(locked_date, 'YYYY-MM-DD HH24:MI:SS') as locked_date_pretty, - to_char(consumed_date, 'YYYY-MM-DD HH24:MI:SS') as consumed_date_pretty, - to_char(canceled_date, 'YYYY-MM-DD HH24:MI:SS') as canceled_date_pretty - from wf_tokens - where case_id = :case_id - and state in ('consumed', 'canceled') - - - - - Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases.tcl 14 May 2001 23:16:08 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/cases.tcl 19 Nov 2001 18:29:28 -0000 1.3 @@ -105,6 +105,7 @@ { action "" "" "(debug)" } } + set table_html [ad_table -Torderby $orderby -Tmissing_text $missing_text "cases_table" "" $table_def] db_release_unused_handles Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-place-info.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-place-info.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-place-info.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-place-info.adp 19 Nov 2001 18:29:28 -0000 1.2 @@ -1,72 +1,89 @@ - + -
+
+ + + - - - - - +
- - - - - - - - - - + + + + + + + - + + + + + + +
- - - - - - -
  - Place: @place.place_name@ - (edit) - - (delete place) -
-
Producing TransitionsConsuming Transitions
-
- + + + + + + +
  + Place: @place.place_name@ + (edit) + + + (delete place) + + +   + +
+ +
Producing TransitionsConsuming Transitions
+
+
- @producing_transitions.transition_name@ - - [ @producing_transitions.guard_pretty@ ] - + @producing_transitions.transition_name@ + + [ @producing_transitions.guard_pretty@ ] +
- - (edit guard) - (delete guard) - - - (add guard) - + + (edit guard) + (delete guard) + + + (add guard) + + (delete arc) +
-
-
-
-
- + +
+
+
+
- @consuming_transitions.transition_name@ + @consuming_transitions.transition_name@
+ (delete arc) +
-
-
+ + +
  +   + + (add arc) + + + (delete arc) + +   +
  - (add arc) - (delete arc) -
-
- Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-place-info.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-place-info.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-place-info.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-place-info.tcl 19 Nov 2001 18:29:28 -0000 1.2 @@ -9,6 +9,7 @@ # mode # format # return_url +# modifiable_p (optional) # Returns: # workflow_key # place:onerow(place_key, place_name, edit_url, delete_url, arc_add_url, arc_delete_url) @@ -18,14 +19,24 @@ set workflow_key $workflow(workflow_key) +if { ![info exists modifiable_p] } { + set modifiable_p 1 +} + # place:onerow(place_key, place_name, edit_url, delete_url) set place(place_key) $place_key set place(place_name) $workflow(place,$place_key,place_name) set place(edit_url) "place-edit?[export_url_vars workflow_key place_key return_url]" -set place(delete_url) "place-delete?[export_url_vars workflow_key place_key return_url]" -set place(arc_add_url) "define?[export_ns_set_vars {url} {mode}]&mode=arcadd" -set place(arc_delete_url) "define?[export_ns_set_vars {url} {mode}]&mode=arcdelete" +if { $modifiable_p } { + set place(delete_url) "place-delete?[export_url_vars workflow_key place_key return_url]" + set place(arc_add_url) "define?[export_ns_set_vars {url} {mode}]&mode=arcadd" + set place(arc_delete_url) "define?[export_ns_set_vars {url} {mode}]&mode=arcdelete" +} else { + set place(delete_url) "" + set place(arc_add_url) "" + set place(arc_delete_url) "" +} # producing_transitions:multirow(transition_key, transition_name, url, arc_delete_url # guard_pretty, guard_edit_url, guard_delete_url, guard_add_url) @@ -36,7 +47,11 @@ set direction "out" foreach loop_transition_key $workflow(arcs,place,$place_key,out) { set url "define?[export_url_vars workflow_key transition_key=[ns_urlencode $loop_transition_key] format]" - set arc_delete_url "arc-delete?[export_url_vars workflow_key transition_key=[ns_urlencode $loop_transition_key] place_key direction return_url]" + if { $modifiable_p } { + set arc_delete_url "arc-delete?[export_url_vars workflow_key transition_key=[ns_urlencode $loop_transition_key] place_key direction return_url]" + } else { + set arc_delete_url "" + } set guard_pretty [ad_decode $workflow(arc,$loop_transition_key,$place_key,out,guard_description) \ "" $workflow(arc,$loop_transition_key,$place_key,out,guard_callback) \ $workflow(arc,$loop_transition_key,$place_key,out,guard_description)] @@ -56,8 +71,11 @@ set direction "in" foreach loop_transition_key $workflow(arcs,place,$place_key,in) { set url "define?[export_url_vars workflow_key transition_key=[ns_urlencode $loop_transition_key] format]" - set arc_delete_url "arc-delete?[export_url_vars workflow_key transition_key=[ns_urlencode $loop_transition_key] place_key direction return_url]" - + if { $modifiable_p } { + set arc_delete_url "arc-delete?[export_url_vars workflow_key transition_key=[ns_urlencode $loop_transition_key] place_key direction return_url]" + } else { + set arc_delete_url "" + } template::multirow append consuming_transitions $loop_transition_key \ $workflow(transition,$loop_transition_key,transition_name) $url $arc_delete_url } Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-transition-info.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-transition-info.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-transition-info.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-transition-info.adp 19 Nov 2001 18:29:28 -0000 1.2 @@ -2,75 +2,90 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + +
- - - - - - -
- (panels) - (assignment) - (attributes) - (actions) - - Task: @transition.transition_name@ - (edit) - - (delete task) -
-
Input PlacesOutput Places
-
- -
- @input_places.place_name@ -
-
- (delete arc) -
-
-
-
-
- -
- @output_places.place_name@ - [ @output_places.guard_pretty@ ] -
-
- - (edit guard) - (delete guard) - - - (add guard) - - (delete arc) -
-
-
-
  - (add arc) - (delete arc) - -
+ + + + + + +
+ + (assignment) + (attributes) + (actions) + + Task: @transition.transition_name@ + (edit) + + + (delete task) + + +   + +
+
Input PlacesOutput Places
+
+ +
+ @input_places.place_name@ +
+
+ + (delete arc) + +
+
+
+
+
+ +
+ @output_places.place_name@ + [ @output_places.guard_pretty@ ] +
+
+ + (edit guard) + (delete guard) + + + (add guard) + + + (delete arc) + +
+
+
+
  +   + + (add arc) + + + (delete arc) + +   + +
- + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-transition-info.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-transition-info.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-transition-info.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define-transition-info.tcl 19 Nov 2001 18:29:28 -0000 1.2 @@ -9,6 +9,7 @@ # mode # format # return_url +# modifiable_p (optional) # Returns: # workflow_key # transition:onerow(transition_key, transition_name, arc_add_url, arc_delete_url, edit_url, delete_url) @@ -18,16 +19,25 @@ set workflow_key $workflow(workflow_key) +if { ![info exists modifiable_p] } { + set modifiable_p 1 +} # transition:onerow(transition_key, transition_name, arc_add_url, arc_delete_url, edit_url, delete_url) set transition(transition_key) $transition_key set transition(transition_name) $workflow(transition,$transition_key,transition_name) -set transition(arc_add_url) "define?[export_ns_set_vars {url} {mode}]&mode=arcadd" -set transition(arc_delete_url) "define?[export_ns_set_vars {url} {mode}]&mode=arcdelete" set transition(edit_url) "task-edit?[export_url_vars workflow_key transition_key return_url]" -set transition(delete_url) "task-delete?[export_url_vars workflow_key transition_key return_url]" -set transition(panels_url) "task-panels?[export_vars -url {workflow_key transition_key return_url}]" +if { $modifiable_p } { + set transition(delete_url) "task-delete?[export_url_vars workflow_key transition_key return_url]" + set transition(arc_add_url) "define?[export_ns_set_vars {url} {mode}]&mode=arcadd" + set transition(arc_delete_url) "define?[export_ns_set_vars {url} {mode}]&mode=arcdelete" +} else { + set transition(delete_url) "" + set transition(arc_add_url) "" + set transition(arc_delete_url) "" +} +#set transition(panels_url) "task-panels?[export_vars -url {workflow_key transition_key return_url}]" set transition(assignment_url) "task-assignment?[export_vars -url {workflow_key transition_key return_url}]" set transition(attributes_url) "task-attributes?[export_vars -url {workflow_key transition_key return_url}]" set transition(actions_url) "task-actions?[export_vars -url {workflow_key transition_key return_url}]" @@ -39,7 +49,11 @@ set direction "in" foreach loop_place_key $workflow(arcs,transition,$transition_key,in) { set url "define?[export_url_vars workflow_key place_key=[ns_urlencode $loop_place_key] format]" - set arc_delete_url "arc-delete?[export_url_vars workflow_key transition_key place_key=[ns_urlencode $loop_place_key] direction return_url]" + if { $modifiable_p } { + set arc_delete_url "arc-delete?[export_url_vars workflow_key transition_key place_key=[ns_urlencode $loop_place_key] direction return_url]" + } else { + set arc_delete_url "" + } template::multirow append input_places $loop_place_key $workflow(place,$loop_place_key,place_name) $url $arc_delete_url } @@ -52,7 +66,11 @@ set direction "out" foreach loop_place_key $workflow(arcs,transition,$transition_key,out) { set url "define?[export_url_vars workflow_key place_key=[ns_urlencode $loop_place_key] format]" - set arc_delete_url "arc-delete?[export_url_vars workflow_key transition_key place_key=[ns_urlencode $loop_place_key] direction return_url]" + if { $modifiable_p } { + set arc_delete_url "arc-delete?[export_url_vars workflow_key transition_key place_key=[ns_urlencode $loop_place_key] direction return_url]" + } else { + set arc_delete_url "" + } set guard_pretty [ad_decode $workflow(arc,$transition_key,$loop_place_key,out,guard_description) \ "" $workflow(arc,$transition_key,$loop_place_key,out,guard_callback) \ $workflow(arc,$transition_key,$loop_place_key,out,guard_description)] Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define.adp 19 Nov 2001 18:29:28 -0000 1.2 @@ -32,11 +32,11 @@

- +

- +

@@ -48,7 +48,7 @@

- + @header_stuff@ Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define.tcl 19 Nov 2001 18:29:28 -0000 1.2 @@ -48,6 +48,7 @@ place:onerow producing_transitions:multirow consuming_transitions:multirow + modifiable_p } @@ -59,9 +60,18 @@ set workflow_info [wf_get_workflow_net $workflow_key] array set workflow $workflow_info +db_1row num_cases { + select count(*) as num_cases from wf_cases where workflow_key = :workflow_key +} db_release_unused_handles +if { $num_cases > 0 } { + set modifiable_p 0 +} else { + set modifiable_p 1 +} + ##### # # Make sure the selected transtion or place exists Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/define.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -8,4 +8,13 @@ + + + + select count(*) as num_cases from wf_cases where workflow_key = :workflow_key + + + + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/export-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/export-2-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/export-2-postgresql.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/export-2-postgresql.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -5,9 +5,7 @@ - - select package_id from apm_packages where package_key='acs-workflow' limit 1 - + select package_id from apm_packages where package_key='acs-workflow' limit 1 Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/index-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/index-oracle.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/index-oracle.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -1,10 +1,11 @@ + oracle8.1.6 - + select w.workflow_key, t.pretty_name, w.description, Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/init-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/init-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/init-oracle.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/init-oracle.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -1,6 +1,7 @@ + - oracle8.1.6 + oracle8.1.6 @@ -9,5 +10,6 @@ + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/init-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/init-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/init-postgresql.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/init-postgresql.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -1,6 +1,7 @@ + - postgresql7.1 + postgresql7.1 @@ -9,5 +10,6 @@ + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/init.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/init.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/init.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/init.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -12,15 +12,6 @@ - - - - select object_id, acs_object.name(object_id) as name from acs_objects order by name - - - - - select pretty_name from acs_object_types where object_type = :workflow_key Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/place-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/place-add.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/place-add.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/place-add.xql 19 Nov 2001 18:29:28 -0000 1.2 @@ -14,7 +14,7 @@ - + select case when count(*) = 0 then 0 else 1 end from wf_places where workflow_key = :workflow_key and place_key = 'start' @@ -25,7 +25,7 @@ - + select case when count(*) = 0 then 0 else 1 end from wf_places where workflow_key = :workflow_key and place_key = 'start' Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/place-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/place-display.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/place-display.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/place-display.adp 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,5 +1,5 @@ - + (@place.num@) @place.place_name@ Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-add.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-add.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-add.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,17 +1,18 @@ ad_page_contract {} { workflow_key context_key - transition_key + role_key party_id:integer + return_url } -errors { party_id:integer "Please select someone to assign" } db_dml static_assignment_add { insert into wf_context_assignments - (workflow_key, context_key, transition_key, party_id) + (workflow_key, context_key, role_key, party_id) values - (:workflow_key, :context_key, :transition_key, :party_id) + (:workflow_key, :context_key, :role_key, :party_id) } -ad_returnredirect "static-assignments?[export_url_vars workflow_key context_key]" +ad_returnredirect $return_url Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-add.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-add.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-add.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -5,9 +5,9 @@ insert into wf_context_assignments - (workflow_key, context_key, transition_key, party_id) + (workflow_key, context_key, role_key, party_id) values - (:workflow_key, :context_key, :transition_key, :party_id) + (:workflow_key, :context_key, :role_key, :party_id) Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-delete.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-delete.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-delete.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,18 +1,19 @@ ad_page_contract {} { workflow_key context_key - transition_key + role_key party_id + return_url } db_dml static_assignment_delete { delete from wf_context_assignments where workflow_key = :workflow_key and context_key = :context_key - and transition_key = :transition_key + and role_key = :role_key and party_id = :party_id } -ad_returnredirect "static-assignments?[export_url_vars workflow_key context_key]" +ad_returnredirect $return_url Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-delete.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-delete.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-delete.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/static-assignment-delete.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -8,7 +8,7 @@ from wf_context_assignments where workflow_key = :workflow_key and context_key = :context_key - and transition_key = :transition_key + and role_key = :role_key and party_id = :party_id Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions-2.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions-2.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions-2.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -13,8 +13,6 @@ enable_custom_arg fire_callback fire_custom_arg - assignment_callback - assignment_custom_arg time_callback time_custom_arg deadline_callback @@ -26,7 +24,6 @@ notification_custom_arg unassigned_callback unassigned_custom_arg - access_privilege } @@ -42,8 +39,6 @@ enable_custom_arg, fire_callback, fire_custom_arg, - assignment_callback, - assignment_custom_arg, time_callback, time_custom_arg, deadline_callback, @@ -54,8 +49,7 @@ notification_callback, notification_custom_arg, unassigned_callback, - unassigned_custom_arg, - access_privilege) + unassigned_custom_arg) values (:workflow_key, :transition_key, @@ -64,8 +58,6 @@ :enable_custom_arg, :fire_callback, :fire_custom_arg, - :assignment_callback, - :assignment_custom_arg, :time_callback, :time_custom_arg, :deadline_callback, @@ -76,8 +68,7 @@ :notification_callback, :notification_custom_arg, :unassigned_callback, - :unassigned_custom_arg, - :access_privilege) + :unassigned_custom_arg) } } else { db_dml update_actions { @@ -86,8 +77,6 @@ enable_custom_arg = :enable_custom_arg, fire_callback = :fire_callback, fire_custom_arg = :fire_custom_arg, - assignment_callback = :assignment_callback, - assignment_custom_arg = :assignment_custom_arg, time_callback = :time_callback, time_custom_arg = :time_custom_arg, deadline_callback = :deadline_callback, @@ -98,8 +87,7 @@ notification_callback = :notification_callback, notification_custom_arg = :notification_custom_arg, unassigned_callback = :unassigned_callback, - unassigned_custom_arg = :unassigned_custom_arg, - access_privilege = :access_privilege + unassigned_custom_arg = :unassigned_custom_arg where workflow_key = :workflow_key and transition_key = :transition_key and context_key = :context_key } } Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions-2.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions-2.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions-2.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -3,9 +3,7 @@ - select count(*) from wf_context_transition_info where workflow_key = :workflow_key and transition_key = :transition_key and context_key = :context_key - @@ -21,8 +19,6 @@ enable_custom_arg, fire_callback, fire_custom_arg, - assignment_callback, - assignment_custom_arg, time_callback, time_custom_arg, deadline_callback, @@ -33,8 +29,7 @@ notification_callback, notification_custom_arg, unassigned_callback, - unassigned_custom_arg, - access_privilege) + unassigned_custom_arg) values (:workflow_key, :transition_key, @@ -43,8 +38,6 @@ :enable_custom_arg, :fire_callback, :fire_custom_arg, - :assignment_callback, - :assignment_custom_arg, :time_callback, :time_custom_arg, :deadline_callback, @@ -55,8 +48,7 @@ :notification_callback, :notification_custom_arg, :unassigned_callback, - :unassigned_custom_arg, - :access_privilege) + :unassigned_custom_arg) @@ -70,8 +62,6 @@ enable_custom_arg = :enable_custom_arg, fire_callback = :fire_callback, fire_custom_arg = :fire_custom_arg, - assignment_callback = :assignment_callback, - assignment_custom_arg = :assignment_custom_arg, time_callback = :time_callback, time_custom_arg = :time_custom_arg, deadline_callback = :deadline_callback, @@ -82,8 +72,7 @@ notification_callback = :notification_callback, notification_custom_arg = :notification_custom_arg, unassigned_callback = :unassigned_callback, - unassigned_custom_arg = :unassigned_custom_arg, - access_privilege = :access_privilege + unassigned_custom_arg = :unassigned_custom_arg where workflow_key = :workflow_key and transition_key = :transition_key and context_key = :context_key Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions.adp 19 Nov 2001 18:29:29 -0000 1.2 @@ -13,7 +13,7 @@ - + @@ -44,18 +44,6 @@ - - - - - - - - - - - - @@ -123,14 +111,6 @@ - - - - - - - - Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -38,8 +38,6 @@ enable_custom_arg, fire_callback, fire_custom_arg, - assignment_callback, - assignment_custom_arg, time_callback, time_custom_arg, deadline_callback, @@ -50,8 +48,7 @@ notification_callback, notification_custom_arg, unassigned_callback, - unassigned_custom_arg, - access_privilege + unassigned_custom_arg from wf_context_transition_info where workflow_key = :workflow_key and transition_key = :transition_key @@ -76,8 +73,7 @@ notification_callback notification_custom_arg unassigned_callback - unassigned_custom_arg - access_privilege + unassigned_custom_arg } { set $var "" } Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-actions.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -6,7 +6,6 @@ select 1 from wf_workflows where workflow_key = :workflow_key - Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add-2.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add-2.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add-2.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -3,9 +3,13 @@ } { workflow_key:notnull transition_name:notnull + role_key:allhtml trigger_type:notnull - estimated_minutes:optional,integer + {estimated_minutes:integer ""} + {instructions ""} {context_key "default"} + {return_url ""} + cancel:optional } -validate { transition_name_unique -requires { workflow_key:notnull transition_name:notnull } { set num_rows [db_string num_transitions { @@ -28,30 +32,35 @@ } } - -set transition_key [wf_make_unique -maxlen 100 \ - -taken_names [db_list transition_keys {select transition_key from wf_transitions where workflow_key = :workflow_key}] \ - [wf_name_to_key $transition_name]] - -db_transaction { - - db_dml transition_add { - insert into wf_transitions (transition_key, transition_name, workflow_key, trigger_type) - values (:transition_key, :transition_name, :workflow_key, :trigger_type) +if { [info exists cancel] && ![empty_string_p $cancel] } { + # User hit cancel + if { [empty_string_p $return_url] } { + set return_url "define?[export_vars -url {workflow_key}]" } + ad_returnredirect $return_url + return +} - if { [info exists estimated_minutes] && ![empty_string_p $estimated_minutes] } { - db_dml estimated_minutes { - insert into wf_context_transition_info - (context_key, workflow_key, transition_key, estimated_minutes) - values (:context_key, :workflow_key, :transition_key, :estimated_minutes) - } - } +set create_new_role_p 0 +if { [string equal $role_key ""] } { + set role_key "" + set create_new_role_p 1 } - -wf_workflow_changed $workflow_key -ad_returnredirect "define?[export_url_vars workflow_key transition_key]" +set transition_key [wf_add_transition \ + -workflow_key $workflow_key \ + -transition_name $transition_name \ + -role_key $role_key \ + -trigger_type $trigger_type \ + -estimated_minutes $estimated_minutes \ + -instructions $instructions] +if { [empty_string_p $return_url] } { + set return_url "define?[export_vars -url {workflow_key transition_key}]" +} - +if { $create_new_role_p } { + set return_url "task-edit?[export_vars -url {workflow_key transition_key context_key return_url {new_role_p 1}}]" +} + +ad_returnredirect $return_url \ No newline at end of file Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add-2.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add-2.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add-2.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -13,34 +13,4 @@ - - - - select transition_key from wf_transitions where workflow_key = :workflow_key - - - - - - - - - insert into wf_transitions (transition_key, transition_name, workflow_key, trigger_type) - values (:transition_key, :transition_name, :workflow_key, :trigger_type) - - - - - - - - - insert into wf_context_transition_info - (context_key, workflow_key, transition_key, estimated_minutes) - values (:context_key, :workflow_key, :transition_key, :estimated_minutes) - - - - - Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add.adp 19 Nov 2001 18:29:29 -0000 1.2 @@ -16,15 +16,39 @@ - + + + + + - + + + + +
Action Type Value
AssignmentPL/SQL proc
Custom argument
Time PL/SQL proc
Access PrivilegePrivilege name
Trigger type@trigger_type_widget@ + +
Role + +
Time estimate minutes
Instructions
+ +       + +
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -2,10 +2,11 @@ Add task } { workflow_key:notnull + return_url:optional } -properties { context_bar export_vars - trigger_type_widget + trigger_types:multirow } db_1row workflow_info { @@ -15,14 +16,29 @@ } -set context_bar [ad_context_bar [list "workflow?[export_url_vars workflow_key]" "$workflow_name"] [list "define?[export_url_vars workflow_key]" "Edit process"] "Add task"] +set context_bar [ad_context_bar [list "workflow?[export_vars -url {workflow_key}]" "$workflow_name"] [list "define?[export_url_vars workflow_key]" "Edit process"] "Add task"] -set export_vars [export_form_vars workflow_key] -set trigger_type_widget "" +set export_vars [export_vars -form {workflow_key return_url}] +template::multirow create trigger_types value text selected_string +foreach option { + { user User } + { automatic Automatic } + { message Message } + { time Time } +} { + template::multirow append trigger_types [lindex $option 0] [lindex $option 1] "" +} + +template::multirow create roles role_key role_name +db_multirow roles roles { + select r.role_key, + r.role_name + from wf_roles r + where r.workflow_key = :workflow_key + order by r.sort_order +} +template::multirow append roles "" "-- None --" +template::multirow append roles "" "-- Create new role --" + ad_return_template Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-add.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -12,4 +12,17 @@ + + + + select r.role_key, + r.role_name + from wf_roles r + where r.workflow_key = :workflow_key + order by r.sort_order + + + + +
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-add.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-add.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-add.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -7,17 +7,23 @@ } { workflow_key transition_key - assign_transition_key + role_key {return_url ""} } db_transaction { - set num_rows [db_string num_rows {select count(*) from wf_transition_assignment_map where workflow_key = :workflow_key and transition_key = :transition_key and assign_transition_key = :assign_transition_key}] + db_1row num_rows { + select count(*) as num_rows + from wf_transition_role_assign_map + where workflow_key = :workflow_key + and transition_key = :transition_key + and assign_role_key = :role_key + } if { $num_rows == 0 } { db_dml make_manual { - insert into wf_transition_assignment_map (workflow_key, transition_key, assign_transition_key) - values (:workflow_key, :transition_key, :assign_transition_key) + insert into wf_transition_role_assign_map (workflow_key, transition_key, assign_role_key) + values (:workflow_key, :transition_key, :role_key) } } } Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-add.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-add.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-add.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -3,16 +3,22 @@ - select count(*) from wf_transition_assignment_map where workflow_key = :workflow_key and transition_key = :transition_key and assign_transition_key = :assign_transition_key + + select count(*) as num_rows + from wf_transition_role_assign_map + where workflow_key = :workflow_key + and transition_key = :transition_key + and assign_role_key = :role_key + - insert into wf_transition_assignment_map (workflow_key, transition_key, assign_transition_key) - values (:workflow_key, :transition_key, :assign_transition_key) + insert into wf_transition_role_assign_map (workflow_key, transition_key, assign_role_key) + values (:workflow_key, :transition_key, :role_key) Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-delete.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-delete.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-delete.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -7,16 +7,16 @@ } { workflow_key transition_key - assign_transition_key + role_key {return_url ""} } db_transaction { db_dml assignment_delete { - delete from wf_transition_assignment_map - where workflow_key = :workflow_key - and transition_key = :transition_key - and assign_transition_key = :assign_transition_key + delete from wf_transition_role_assign_map + where workflow_key = :workflow_key + and transition_key = :transition_key + and assign_role_key = :role_key } } Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-delete.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-delete.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-delete.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment-delete.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -4,10 +4,10 @@ - delete from wf_transition_assignment_map - where workflow_key = :workflow_key - and transition_key = :transition_key - and assign_transition_key = :assign_transition_key + delete from wf_transition_role_assign_map + where workflow_key = :workflow_key + and transition_key = :transition_key + and assign_role_key = :role_key Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment.adp 19 Nov 2001 18:29:29 -0000 1.2 @@ -7,6 +7,10 @@

+The user performing the task @transition_name@ will be asked to assign the following roles: + +

+ @@ -16,20 +20,20 @@ - + + + + + + + + +
  - + - + @@ -53,9 +57,9 @@ @assign_export_vars@ Assign this: - - + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -41,35 +41,35 @@ set context_bar [ad_context_bar [list "workflow?[export_url_vars workflow_key]" "$workflow_name"] [list "define?[export_vars -url {workflow_key transition_key}]" "Edit process"] "Assignments by $transition_name"] db_multirow assigned_by_this assigned_by_this { - select t.transition_name as assign_transition_name, - m.assign_transition_key, + select r.role_name, + r.role_key, '' as delete_url - from wf_transition_assignment_map m, - wf_transitions t + from wf_transition_role_assign_map m, + wf_roles r where m.workflow_key = :workflow_key and m.transition_key = :transition_key - and t.workflow_key = m.workflow_key - and t.transition_key = m.assign_transition_key + and r.workflow_key = m.workflow_key + and r.role_key = m.assign_role_key } { set vars { workflow_key transition_key - assign_transition_key + role_key {return_url "task-assignment?[export_vars -url {workflow_key transition_key return_url}]"} } set delete_url "task-assignment-delete?[export_vars -url $vars]" } db_multirow to_be_assigned_by_this to_be_assigned_by_this { - select t.transition_name as assign_transition_name, - t.transition_key as assign_transition_key - from wf_transitions t - where t.workflow_key = :workflow_key - and t.transition_key != :transition_key - and not exists (select 1 from wf_transition_assignment_map m + select r.role_name, + r.role_key + from wf_roles r + where r.workflow_key = :workflow_key + and r.role_key != (select role_key from wf_transitions t where workflow_key = :workflow_key and transition_key = :transition_key) + and not exists (select 1 from wf_transition_role_assign_map m where m.workflow_key = :workflow_key and m.transition_key = :transition_key - and m.assign_transition_key = t.transition_key) + and m.assign_role_key = r.role_key) } set assign_url "task-assignment-add" Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-assignment.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -28,15 +28,15 @@ - select t.transition_name as assign_transition_name, - m.assign_transition_key, + select r.role_name, + r.role_key, '' as delete_url - from wf_transition_assignment_map m, - wf_transitions t + from wf_transition_role_assign_map m, + wf_roles r where m.workflow_key = :workflow_key and m.transition_key = :transition_key - and t.workflow_key = m.workflow_key - and t.transition_key = m.assign_transition_key + and r.workflow_key = m.workflow_key + and r.role_key = m.assign_role_key @@ -45,15 +45,15 @@ - select t.transition_name as assign_transition_name, - t.transition_key as assign_transition_key - from wf_transitions t - where t.workflow_key = :workflow_key - and t.transition_key != :transition_key - and not exists (select 1 from wf_transition_assignment_map m + select r.role_name, + r.role_key + from wf_roles r + where r.workflow_key = :workflow_key + and r.role_key != (select role_key from wf_transitions t where workflow_key = :workflow_key and transition_key = :transition_key) + and not exists (select 1 from wf_transition_role_assign_map m where m.workflow_key = :workflow_key and m.transition_key = :transition_key - and m.assign_transition_key = t.transition_key) + and m.assign_role_key = r.role_key) Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-attributes.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-attributes.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-attributes.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-attributes.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -6,7 +6,6 @@ select 1 from wf_workflows where workflow_key = :workflow_key - Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-delete.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-delete.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-delete.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,53 +1,18 @@ ad_page_contract { Delete task. + + @author Lars Pind (lars@pinds.com) + @creation-date Sep 2000 + @cvs-id $Id$ } { workflow_key transition_key {return_url "define?[export_url_vars workflow_key]"} } +wf_delete_transition \ + -workflow_key $workflow_key \ + -transition_key $transition_key -# Since we've now added on delete cascade constraints, this long list of deletes should no longer be necessary. - -db_transaction { - db_dml arcs_delete { - delete from wf_arcs - where workflow_key = :workflow_key - and transition_key = :transition_key - } - - db_dml transition_attribute_map_delete { - delete from wf_transition_attribute_map - where workflow_key = :workflow_key - and transition_key = :transition_key - } - - db_dml transition_assignment_map_delete { - delete from wf_transition_assignment_map - where workflow_key = :workflow_key - and transition_key = :transition_key - } - - db_dml wf_context_assignments_delete { - delete from wf_context_assignments - where workflow_key = :workflow_key - and transition_key = :transition_key - } - - db_dml wf_context_transition_info_delete { - delete from wf_context_transition_info - where workflow_key = :workflow_key - and transition_key = :transition_key - } - - db_dml transition_delete { - delete from wf_transitions - where workflow_key = :workflow_key - and transition_key = :transition_key - } -} - -wf_workflow_changed $workflow_key - ad_returnredirect $return_url Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit-2.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit-2.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit-2.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,40 +1,78 @@ ad_page_contract { Edit task. } { - workflow_key - transition_key - transition_name - trigger_type + workflow_key:notnull + transition_key:notnull + transition_name:notnull + trigger_type:notnull + role_key:allhtml,optional + role_name:optional estimated_minutes:integer,optional - {return_url "define?[export_url_vars workflow_key transition_key]"} + instructions:optional + {return_url "define?[export_vars -url {workflow_key transition_key}]"} + cancel:optional + {context_key "default"} } -db_dml transition_update { - update wf_transitions - set transition_name = :transition_name, - trigger_type = :trigger_type - where workflow_key = :workflow_key - and transition_key = :transition_key +if { [info exists cancel] && ![empty_string_p $cancel] } { + # User hit cancel + ad_returnredirect $return_url + return } -if { [info exists estimated_minutes] } { - set num_rows [db_string num_rows "select count(*) from wf_context_transition_info where workflow_key = :workflow_key and transition_key = :transition_key and context_key = 'default'"] - - if { $num_rows == 0 } { - db_dml insert_estimated_minmutes { - insert into wf_context_transition_info - (workflow_key, transition_key, context_key, estimated_minutes) - values (:workflow_key, :transition_key, 'default', :estimated_minutes) +db_transaction { + if { ![info exists role_key] } { + set role_key [wf_add_role -workflow_key $workflow_key -role_name $role_name] + } + + if { ![string equal $role_key ""] } { + db_dml transition_update { + update wf_transitions + set transition_name = :transition_name, + trigger_type = :trigger_type, + role_key = :role_key + where workflow_key = :workflow_key + and transition_key = :transition_key } } else { - db_dml update_estimated_minutes { - update wf_context_transition_info set estimated_minutes = :estimated_minutes - where workflow_key = :workflow_key and transition_key = :transition_key and context_key = 'default' + db_dml transition_update { + update wf_transitions + set transition_name = :transition_name, + trigger_type = :trigger_type + where workflow_key = :workflow_key + and transition_key = :transition_key } } + + if { [info exists estimated_minutes] || [info exists instructions] } { + set num_rows [db_string num_rows "select count(*) from wf_context_transition_info where workflow_key = :workflow_key and transition_key = :transition_key and context_key = 'default'"] + + if { $num_rows == 0 } { + db_dml insert_estimated_minmutes { + insert into wf_context_transition_info + (workflow_key, transition_key, context_key, estimated_minutes, instructions) + values (:workflow_key, :transition_key, 'default', :estimated_minutes, :instructions) + } + } else { + db_dml update_estimated_minutes { + update wf_context_transition_info + set estimated_minutes = :estimated_minutes, + instructions = :instructions + where workflow_key = :workflow_key + and transition_key = :transition_key + and context_key = 'default' + } + } + } } wf_workflow_changed $workflow_key +if { [string equal $role_key ""] } { + set return_url "task-edit?[export_vars -url {workflow_key transition_key context_key return_url {new_role_p 1}}]" +} + + + ad_returnredirect $return_url Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit-2.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit-2.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit-2.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -4,12 +4,27 @@ - update wf_transitions - set transition_name = :transition_name, - trigger_type = :trigger_type - where workflow_key = :workflow_key - and transition_key = :transition_key + update wf_transitions + set transition_name = :transition_name, + trigger_type = :trigger_type, + role_key = :role_key + where workflow_key = :workflow_key + and transition_key = :transition_key + + + + + + + + update wf_transitions + set transition_name = :transition_name, + trigger_type = :trigger_type, + role_key = :role_key + where workflow_key = :workflow_key + and transition_key = :transition_key + @@ -24,20 +39,24 @@ - insert into wf_context_transition_info - (workflow_key, transition_key, context_key, estimated_minutes) - values (:workflow_key, :transition_key, 'default', :estimated_minutes) - + insert into wf_context_transition_info + (workflow_key, transition_key, context_key, estimated_minutes, instructions) + values (:workflow_key, :transition_key, 'default', :estimated_minutes, :instructions) + - update wf_context_transition_info set estimated_minutes = :estimated_minutes - where workflow_key = :workflow_key and transition_key = :transition_key and context_key = 'default' - + update wf_context_transition_info + set estimated_minutes = :estimated_minutes, + instructions = :instructions + where workflow_key = :workflow_key + and transition_key = :transition_key + and context_key = 'default' + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit.adp 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,6 +1,6 @@ Task @transition_name@ -task.transition_name +@focus@

Task @transition_name@

@context_bar@ @@ -12,19 +12,51 @@
TaskRole To Assign Action
- No tasks to assign here. + No roles to be assigned by this task.
@assigned_by_this.assign_transition_name@@assigned_by_this.role_name@ (remove)
- + - + + + + + - + + + + +
Task name + +
Trigger type@trigger_type_widget@ + +
Role + + Please type a name for the new role
+ +
+ + + +
Time estimate minutes
Instructions
+ +       + +
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,38 +1,83 @@ ad_page_contract { Edit task. + + @author Lars Pind (lars@pinds.com) + @creation-date September 2000 + @cvs-id $Id$ } { workflow_key transition_key return_url:optional + {context_key "default"} + {new_role_p:boolean 0} } -properties { transition_name context_bar export_vars - trigger_type_widget + trigger_types:multirow + roles:multirow + estimated_minutes + instructions + new_role_p + focus } -db_1row task_info { - select t.transition_name, - ot.pretty_name as workflow_name, - t.trigger_type - from wf_transitions t, acs_object_types ot - where t.transition_key = :transition_key - and t.workflow_key = :workflow_key - and ot.object_type = t.workflow_key +db_1row workflow_info { + select pretty_name as workflow_name + from acs_object_types + where object_type = :workflow_key } -set transition_name [ad_quotehtml $transition_name] +set context_bar [ad_context_bar [list "workflow?[export_vars -url {workflow_key}]" "$workflow_name"] "Edit task"] +set export_vars [export_vars -form {workflow_key transition_key return_url context_key}] -set trigger_type_widget "" -set context_bar [ad_context_bar [list "workflow?[export_url_vars workflow_key]" "$workflow_name"] [list "define?[export_url_vars workflow_key]" "Edit process"] "Edit task"] -set export_vars [export_form_vars workflow_key transition_key return_url] +template::multirow create trigger_types value text selected_string +foreach option { + { user User } + { automatic Automatic } + { message Message } + { time Time } +} { + template::multirow append trigger_types [lindex $option 0] [lindex $option 1] [ad_decode $trigger_type [lindex $option 0] "SELECTED" ""] +} -set estimated_minutes [db_string estimated_minutes "select estimated_minutes from wf_context_transition_info where workflow_key = :workflow_key and transition_key = :transition_key and context_key = 'default'" -default ""] +template::multirow create roles role_key role_name selected_string +db_multirow roles roles { + select r.role_key, + r.role_name, + decode(role_key, :selected_role_key, 'SELECTED', '') as selected_string + from wf_roles r + where r.workflow_key = :workflow_key + order by r.sort_order +} +template::multirow append roles "" "-- None --" [ad_decode $selected_role_key "" "SELECTED" ""] +template::multirow append roles "" "-- Create new role --" "" + +set estimated_minutes {} +set instructions {} + +db_0or1row transition_context_info { + select estimated_minutes, instructions + from wf_context_transition_info + where workflow_key = :workflow_key + and transition_key = :transition_key + and context_key = :context_key +} + +set focus "task.transition_name" +if { $new_role_p } { + set focus "task.role_name" +} + ad_return_template + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-edit.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,26 +1,56 @@ - + - select t.transition_name, - ot.pretty_name as workflow_name, - t.trigger_type - from wf_transitions t, acs_object_types ot - where t.transition_key = :transition_key - and t.workflow_key = :workflow_key - and ot.object_type = t.workflow_key + select pretty_name as workflow_name + from acs_object_types + where object_type = :workflow_key - + - select estimated_minutes from wf_context_transition_info where workflow_key = :workflow_key and transition_key = :transition_key and context_key = 'default' + + select transition_name, + trigger_type, + role_key as selected_role_key + from wf_transitions + where transition_key = :transition_key + and workflow_key = :workflow_key + + + + + select r.role_key, + r.role_name, + case when role_key = :selected_role_key then 'SELECTED' else '' end as selected_string + from wf_roles r + where r.workflow_key = :workflow_key + order by r.sort_order + + + + + + + + + select estimated_minutes, instructions + from wf_context_transition_info + where workflow_key = :workflow_key + and transition_key = :transition_key + and context_key = :context_key + + + + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add-2.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add-2.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add-2.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -5,21 +5,37 @@ @creation-date December 12, 2000 @cvs-id $Id$ } { - workflow_key - transition_key - context_key + workflow_key:notnull + transition_key:notnull + {context_key "default"} header template_url -} + only_display_when_started_p:boolean + overrides_action_p:boolean + {return_url "task-panels?[export_vars -url { workflow_key transition_key context_key }]"} + cancel:optional +} -validate { + header_and_template_url -requires { header template_url } { + if { ![info exists cancel] || [empty_string_p $cancel] } { + if { [empty_string_p $header] || [empty_string_p $template_url] } { + ad_complain "You must specify both a header and a template URL" + } + } + } +} -db_dml panel_add { - insert into wf_context_task_panels - (workflow_key, transition_key, context_key, sort_key, header, template_url) - select :workflow_key, :transition_key, :context_key, nvl(max(sort_key)+1,1), :header, :template_url - from wf_context_task_panels - where workflow_key = :workflow_key - and transition_key = :transition_key - and context_key = :context_key + +if { ![info exists cancel] || [empty_string_p $cancel] } { + + db_dml panel_add { + insert into wf_context_task_panels + (workflow_key, transition_key, context_key, sort_order, header, template_url) + select :workflow_key, :transition_key, :context_key, nvl(max(sort_order)+1,1), :header, :template_url + from wf_context_task_panels + where workflow_key = :workflow_key + and transition_key = :transition_key + and context_key = :context_key + } } -ad_returnredirect "task-panels?[export_vars -url { workflow_key transition_key context_key }]" +ad_returnredirect $return_url Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add-2.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add-2.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add-2.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -4,14 +4,14 @@ - insert into wf_context_task_panels - (workflow_key, transition_key, context_key, sort_key, header, template_url) - select :workflow_key, :transition_key, :context_key, coalesce(max(sort_key)+1,1), :header, :template_url - from wf_context_task_panels - where workflow_key = :workflow_key - and transition_key = :transition_key - and context_key = :context_key - + insert into wf_context_task_panels + (workflow_key, transition_key, context_key, sort_order, header, template_url) + select :workflow_key, :transition_key, :context_key, coalesce(max(sort_order)+1,1), :header, :template_url + from wf_context_task_panels + where workflow_key = :workflow_key + and transition_key = :transition_key + and context_key = :context_key + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add.adp 19 Nov 2001 18:29:29 -0000 1.2 @@ -23,8 +23,26 @@
Override default Action panel? + Yes + No +
Only display when task is stared? + Yes + No +
+ +       + +
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-add.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -5,9 +5,10 @@ @creation-date December 12, 2000 @cvs-id $Id$ } { - workflow_key - transition_key - context_key + workflow_key:notnull + transition_key:notnull + {context_key "default"} + return_url:optional } -properties { context_bar transition_name @@ -25,9 +26,9 @@ and t.transition_key = :transition_key } -set context_bar [ad_context_bar [list "workflow?[export_url_vars workflow_key]" "$workflow_name"] [list "task-panels?[export_vars -url { workflow_key transition_key context_key }]"] "Add panel"] +set context_bar [ad_context_bar [list "workflow?[export_vars -url {workflow_key}]" "$workflow_name"] "Add panel"] -set export_vars [export_vars -form { workflow_key transition_key context_key }] +set export_vars [export_vars -form { workflow_key transition_key context_key return_url}] ad_return_template Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-delete.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-delete.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-delete.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -5,18 +5,19 @@ @creation-date December 12, 2000 @cvs-id $Id$ } { - workflow_key - transition_key - context_key - sort_key + workflow_key:notnull + transition_key:notnull + context_key:notnull + sort_order:notnull,integer + {return_url "task-panels?[export_vars -url { workflow_key transition_key context_key }]"} } db_dml panel_delete { delete from wf_context_task_panels where workflow_key = :workflow_key and transition_key = :transition_key and context_key = :context_key - and sort_key = :sort_key + and sort_order = :sort_order } -ad_returnredirect "task-panels?[export_vars -url { workflow_key transition_key context_key }]" +ad_returnredirect $return_url Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-delete.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-delete.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-delete.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-delete.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -8,7 +8,7 @@ where workflow_key = :workflow_key and transition_key = :transition_key and context_key = :context_key - and sort_key = :sort_key + and sort_order = :sort_order Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit-2.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit-2.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit-2.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -5,22 +5,31 @@ @creation-date December 12, 2000 @cvs-id $Id$ } { - workflow_key - transition_key - context_key - sort_key - header - template_url + workflow_key:notnull + transition_key:notnull + {context_key "default"} + sort_order:notnull,integer + header:notnull + template_url:notnull + overrides_action_p:notnull,boolean + only_display_when_started_p:notnull,boolean + {return_url "task-panels?[export_vars -url { workflow_key transition_key context_key }]"} + cancel:optional } -db_dml panel_update { - update wf_context_task_panels - set header = :header, - template_url = :template_url - where workflow_key = :workflow_key - and transition_key = :transition_key - and context_key = :context_key - and sort_key = :sort_key +if { ![info exists cancel] || [empty_string_p $cancel] } { + + db_dml panel_update { + update wf_context_task_panels + set header = :header, + template_url = :template_url, + overrides_action_p = :overrides_action_p, + only_display_when_started_p = :only_display_when_started_p + where workflow_key = :workflow_key + and transition_key = :transition_key + and context_key = :context_key + and sort_order = :sort_order + } } -ad_returnredirect "task-panels?[export_vars -url { workflow_key transition_key context_key }]" +ad_returnredirect $return_url Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit-2.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit-2.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit-2.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -4,14 +4,16 @@ - update wf_context_task_panels - set header = :header, - template_url = :template_url - where workflow_key = :workflow_key - and transition_key = :transition_key - and context_key = :context_key - and sort_key = :sort_key - + update wf_context_task_panels + set header = :header, + template_url = :template_url, + overrides_action_p = :overrides_action_p, + only_display_when_started_p = :only_display_when_started_p + where workflow_key = :workflow_key + and transition_key = :transition_key + and context_key = :context_key + and sort_order = :sort_order + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit.adp 19 Nov 2001 18:29:29 -0000 1.2 @@ -22,8 +22,26 @@ - + Override default Action panel? + + >Yes + >No + + + Only display when task is stared? + + >Yes + >No + + + + + +       + + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -5,10 +5,11 @@ @creation-date December 12, 2000 @cvs-id $Id$ } { - workflow_key - transition_key - context_key - sort_key + workflow_key:notnull + transition_key:notnull + {context_key "default"} + sort_order:notnull,integer + return_url:optional } -properties { context_bar transition_name @@ -26,19 +27,21 @@ and t.transition_key = :transition_key } -set context_bar [ad_context_bar [list "workflow?[export_url_vars workflow_key]" "$workflow_name"] [list "task-panels?[export_vars -url { workflow_key transition_key context_key }]"] "Edit panel"] +set context_bar [ad_context_bar [list "workflow?[export_url_vars workflow_key]" "$workflow_name"] "Edit panel"] db_1row panel { select p.header, - p.template_url + p.template_url, + p.overrides_action_p, + p.only_display_when_started_p from wf_context_task_panels p where p.workflow_key = :workflow_key and p.transition_key = :transition_key and p.context_key = :context_key - and p.sort_key = :sort_key + and p.sort_order = :sort_order } -column_array panel -set panel(export_vars) [export_vars -form { workflow_key transition_key context_key sort_key }] +set panel(export_vars) [export_vars -form { workflow_key transition_key context_key sort_order return_url }] ad_return_template Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panel-edit.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -20,12 +20,14 @@ select p.header, - p.template_url + p.template_url, + p.overrides_action_p, + p.only_display_when_started_p from wf_context_task_panels p where p.workflow_key = :workflow_key and p.transition_key = :transition_key and p.context_key = :context_key - and p.sort_key = :sort_key + and p.sort_order = :sort_order Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panels.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panels.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panels.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panels.adp 19 Nov 2001 18:29:29 -0000 1.2 @@ -42,7 +42,7 @@ - @panels.sort_key@. + @panels.sort_order@. @panels.header@ @panels.template_url@ @@ -87,4 +87,4 @@ - \ No newline at end of file + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panels.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panels.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panels.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panels.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -56,7 +56,7 @@ set count 0 db_multirow panels panels { - select tp.sort_key, + select tp.sort_order, tp.header, tp.template_url, '' as edit_url, @@ -66,13 +66,13 @@ where tp.context_key = :context_key and tp.workflow_key = :workflow_key and tp.transition_key = :transition_key - order by sort_key + order by sort_order } { incr count - set edit_url "task-panel-edit?[export_vars -url { workflow_key transition_key context_key sort_key } ]" - set delete_url "task-panel-delete?[export_vars -url { workflow_key transition_key context_key sort_key } ]" + set edit_url "task-panel-edit?[export_vars -url { workflow_key transition_key context_key sort_order } ]" + set delete_url "task-panel-delete?[export_vars -url { workflow_key transition_key context_key sort_order } ]" if { $count > 1 } { - set move_up_url "task-panel-move-up?[export_vars -url { workflow_key transition_key context_key sort_key } ]" + set move_up_url "task-panel-move-up?[export_vars -url { workflow_key transition_key context_key sort_order } ]" } } Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panels.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panels.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panels.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/task-panels.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -42,7 +42,7 @@ - select tp.sort_key, + select tp.sort_order, tp.header, tp.template_url, '' as edit_url, @@ -52,7 +52,7 @@ where tp.context_key = :context_key and tp.workflow_key = :workflow_key and tp.transition_key = :transition_key - order by sort_key + order by sort_order Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/transition-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/transition-display.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/transition-display.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/transition-display.adp 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,7 +1,7 @@ - + (@table.input_place_num@) @table.input_place_name@ @@ -15,11 +15,11 @@ - + - +      @@ -36,7 +36,7 @@ - + @table.output_place_name@ @table.output_place_name@ Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-oracle.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-oracle.xql 14 May 2001 23:16:08 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-oracle.xql 19 Nov 2001 18:29:29 -0000 1.3 @@ -1,14 +1,15 @@ + - oracle8.1.6 + oracle8.1.6 select ta.task_id, ta.case_id, ta.workflow_key, - ta.transition_key, + ta.transition_key, tr.transition_name, ta.enabled_date, to_char(ta.enabled_date, :date_format) as enabled_date_pretty, Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-postgresql.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-postgresql.xql 14 May 2001 23:16:08 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks-postgresql.xql 19 Nov 2001 18:29:29 -0000 1.3 @@ -1,6 +1,7 @@ + - postgresql7.1 + postgresql7.1 Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/unassigned-tasks.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -12,5 +12,5 @@ - + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-add-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-add-2-oracle.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-add-2-oracle.xql 16 May 2001 00:40:41 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-add-2-oracle.xql 19 Nov 2001 18:29:29 -0000 1.3 @@ -21,10 +21,5 @@ - - - select constraint_name from user_constraints - - Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-add-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-add-2-postgresql.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-add-2-postgresql.xql 16 May 2001 00:40:41 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-add-2-postgresql.xql 19 Nov 2001 18:29:29 -0000 1.3 @@ -6,24 +6,25 @@ - select workflow__create_workflow( + select workflow__create_workflow( :workflow_key, :workflow_name, :workflow_name, :description, :workflow_cases_table, - 'case_id' + 'case_id' ); - + + select tgconstrname::text from pg_trigger - + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-add-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-add-2.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-add-2.xql 16 May 2001 00:40:41 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-add-2.xql 19 Nov 2001 18:29:29 -0000 1.3 @@ -3,7 +3,7 @@ - + select case when count(*) = 0 then 0 else 1 end from acs_object_types where pretty_name = :workflow_name @@ -16,7 +16,14 @@ - + + + + select constraint_name from user_constraints + + + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-cases-delete-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-cases-delete-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-cases-delete-oracle.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-cases-delete-oracle.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,7 +1,8 @@ + oracle8.1.6 - + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-cases-delete-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-cases-delete-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-cases-delete-postgresql.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-cases-delete-postgresql.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,12 +1,13 @@ + postgresql7.1 - + - - select workflow__delete_cases(:workflow_key) + select workflow__delete_cases(:workflow_key); + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-cases-delete.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-cases-delete.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-cases-delete.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-cases-delete.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -6,8 +6,8 @@ select 1 from wf_workflows where workflow_key = :workflow_key - + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-copy-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-copy-2-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-copy-2-postgresql.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-copy-2-postgresql.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -5,7 +5,7 @@ - select package_id from apm_packages where package_key='acs-workflow' limit 1 + select package_id from apm_packages where package_key='acs-workflow' limit 1 Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-copy.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-copy.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-copy.tcl 16 May 2001 00:40:41 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-copy.tcl 19 Nov 2001 18:29:29 -0000 1.3 @@ -25,7 +25,7 @@ set context_bar [ad_context_bar [list "workflow?[export_url_vars workflow_key]" "$workflow_name"] "Copy process"] -db_1row pretty_name { +db_1row pretty_names { select pretty_name, pretty_plural from acs_object_types where object_type = :workflow_key Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-copy.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-copy.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-copy.xql 16 May 2001 00:40:41 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-copy.xql 19 Nov 2001 18:29:29 -0000 1.3 @@ -12,7 +12,7 @@ - + select pretty_name, pretty_plural @@ -30,7 +30,7 @@ - + select pretty_name from acs_object_types Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete-oracle.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete-oracle.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,16 +1,18 @@ + oracle8.1.6 - + - begin - workflow.delete_cases(workflow_key => :workflow_key); - end; - + begin + workflow.delete_cases(workflow_key => :workflow_key); + end; + + @@ -21,5 +23,6 @@ + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete-postgresql.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete-postgresql.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,21 +1,24 @@ + postgresql7.1 - + - - select workflow__delete_cases(:workflow_key); + select workflow__delete_cases(:workflow_key); + + - - select workflow__drop_workflow(:workflow_key); + select workflow__drop_workflow(:workflow_key); + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete.tcl 16 May 2001 00:40:41 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete.tcl 19 Nov 2001 18:29:29 -0000 1.3 @@ -20,16 +20,21 @@ set cases_table [db_string cases_table { select table_name from acs_object_types where object_type = :workflow_key }] -db_exec_plsql delete_cases { - begin - workflow.delete_cases(workflow_key => :workflow_key); - end; +# If the table does not exist, it's probably because it was already deleted in a faulty attempt to delete the process. +# At least, let us not prevent the guy from trying to delete the process again. + +if { [db_table_exists $cases_table] } { + db_exec_plsql delete_cases { + begin + workflow.delete_cases(workflow_key => :workflow_key); + end; + } + + db_dml drop_cases_table " + drop table $cases_table + " } -db_dml drop_cases_table " - drop table $cases_table -" - db_exec_plsql delete_workflow { begin workflow.drop_workflow(workflow_key => :workflow_key); Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-delete.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -16,12 +16,14 @@ + - drop table $cases_table - + drop table $cases_table + + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-oracle.xql 3 May 2001 01:14:21 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow-oracle.xql 19 Nov 2001 18:29:29 -0000 1.2 @@ -1,10 +1,11 @@ + oracle8.1.6 - + select w.workflow_key, t.pretty_name, w.description, @@ -21,4 +22,5 @@ + Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow.adp 16 May 2001 00:40:41 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow.adp 19 Nov 2001 18:29:29 -0000 1.3 @@ -6,145 +6,324 @@


- + + + +
- - -
- - - - - - - -
- - - - - - -
 @workflow.pretty_name@ - (edit name) -
-
@workflow.description@
-
+ -

+ - - - - -
- - - - - - - -
PerformanceAdoption
- - Note! - - @workflow.num_unassigned_tasks@ - unassigned tasks - - -

- -

- - No active cases - - - 1 active case - - - @workflow.num_active_cases@ active cases - -

- - No old cases - - - 1 case total - - - @workflow.num_cases@ cases total - -

- (start new case) -

- (edit static assignments) -
-
+ -

+ + + + + + + + +
+ + + + + + + +
+ @workflow.pretty_name@ +
+ @workflow.description@ + +
+
+ +

+ + + + + + + +
+ + + + + + + +
+ Actions +
+ (graphic process editor) + (export process) + + (make a copy) + +
+
+ +

+ + + + + + + +
+ + + + + + + +
Cases
+ + Note! + + @workflow.num_unassigned_tasks@ + unassigned tasks + + +

+ +

+ + No active cases + + + 1 active case + + + @workflow.num_active_cases@ active cases + +

+ + No old cases + + + 1 case total + + + @workflow.num_cases@ cases total + +

+ (start new case) +

+
- - - - -
- - - - - - - -
- - - - - - -
- (export process) - - Process Definition - - - (edit attributes) - - - (edit process) - - - (make a copy) - -
-
- @workflow_img_tag@ -
+

+ + + + + + + +
+ + + + + + + +
Extreme Actions
+ + (delete all cases)   + + (delete process entirely) +
+
+ + + + + + + + + + + + + +
+ + + + + + + +
+ Transitions +
+ +
+
+ + +
+ + + + + + + + + + +
+ + + + + + + +
+ Attributes +
+ +
+
+ + +
+ + + + + + + + + + +
+ + + + + + + +
+ Roles +
+ +
+
+ + +
+ + + + + + + + + + + + + + + +
+ + + + + + + +
+ Transition Panels +
+ +
+
+ + +
+ + + + + + + + +
+ + + + + + + +
+ Static Assignments +
+ +
+
+ + +
+ + +

+ + + -

+ + + + + +
+ + + + + + + +
+ Process +
+ +
+
+ - + + -
- - - - - - - -
Extreme Actions
- - (delete all cases)   - - (delete process entirely) -
+ + + +
+
Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/workflow.tcl 19 Nov 2001 18:29:29 -0000 1.2 @@ -6,14 +6,17 @@ @cvs-id $Id$ } { workflow_key:notnull + {tab home} } -properties { workflow:onerow context_bar - workflow_img_tag edit_process_url export_process_url edit_attributes_url copy_process_url + return_url + tab + modifiable_p } -validate { workflow_exists -requires {workflow_key} { if { 0 == [db_string workflow_exists " @@ -24,6 +27,8 @@ } } +set return_url "[ns_conn url]?[export_vars -url {workflow_key tab}]" + db_1row workflow { select w.workflow_key, t.pretty_name, @@ -39,6 +44,12 @@ group by w.workflow_key, t.pretty_name, w.description } -column_array workflow +if { $workflow(num_cases) > 0 } { + set modifiable_p 0 +} else { + set modifiable_p 1 +} + set workflow(num_unassigned_tasks) [db_string num_unassigned_tasks { select count(*) from wf_tasks t, @@ -59,39 +70,17 @@ set context_bar [ad_context_bar "$workflow(pretty_name)"] - -# GIF - -set workflow_info [wf_get_workflow_net $workflow_key] -array set workflow $workflow_info -db_release_unused_handles - -wf_decorate_workflow workflow - -set dot_text [wf_generate_dot_representation workflow] - -set tmpfile [wf_graphviz_dot_exec -to_file -output gif $dot_text] - -set width_and_height "" -if { ![catch { set image_size [ns_gifsize $tmpfile] } error] } { - if { ![empty_string_p $image_size] } { - set width_and_height "width=[lindex $image_size 0] height=[lindex $image_size 1]" - } -} - -ad_set_client_property wf wf_net_tmpfile $tmpfile - -set workflow_img_tag "\"Graphical" - - if { $workflow(num_cases) > 0 } { - set edit_process_url "" + #set edit_process_url "" + set edit_process_url "define?[export_vars -url {workflow_key}]" set edit_attributes_url "" + set edit_roles_url "workflow-roles?[export_vars -url {workflow_key}]" set copy_process_url "workflow-copy?[export_vars -url {workflow_key}]" } else { set edit_process_url "define?[export_vars -url {workflow_key}]" set edit_attributes_url "attributes?[export_vars -url {workflow_key}]" - set copy_process_url "" + set edit_roles_url "workflow-roles?[export_vars -url {workflow_key}]" + set copy_process_url "workflow-copy?[export_vars -url {workflow_key}]" } set export_process_url "export?[export_vars -url {workflow_key}]" Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/assignments.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/assignments.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/assignments.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/assignments.adp 19 Nov 2001 18:30:18 -0000 1.2 @@ -51,62 +51,66 @@

- -
- - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - +
OrderTaskAssignmentAction
@tasks_with_options.rownum@.@tasks_with_options.task_name@ - - - static - - - Manual: assigned during task '@tasks_with_options.assigning_task_name@' - - - first task must be statically assigned - Assign during task - - - (make static)
+ + - - - -
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + +
OrderTaskAssignmentAction
@tasks_with_options.rownum@.@tasks_with_options.task_name@ + + static + + + Manual: assigned during task '@tasks_with_options.assigning_task_name@' + + first task must be statically assigned + Assign during task + + + + (make static) +
+
-
+
+

Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create-oracle.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create-oracle.xql 16 May 2001 00:40:41 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create-oracle.xql 19 Nov 2001 18:30:18 -0000 1.3 @@ -36,31 +36,9 @@ default_value => '[ad_decode $task($transition_key,loop_answer) "t" "f" "t"]' ); - insert into wf_transition_attribute_map (workflow_key, transition_key, attribute_id, sort_order) - values ('[db_quote $workflow_key]', '[db_quote $transition_key]', v_attribute_id, 1); end; - - - - - select constraint_name from user_constraints - - - - - - - insert into wf_arcs (workflow_key, transition_key, place_key, direction, - guard_callback, guard_custom_arg, guard_description) - values ('[db_quote $workflow_key]', '[db_quote $transition_key]', '[db_quote $true_place]', 'out', - 'wf_callback.guard_attribute_true', '[db_quote $task($transition_key,loop_attribute_name)]', - '[db_quote $task($transition_key,loop_question)]') - - - - Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create-postgresql.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create-postgresql.xql 16 May 2001 00:40:41 -0000 1.3 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create-postgresql.xql 19 Nov 2001 18:30:18 -0000 1.4 @@ -5,14 +5,13 @@ - select workflow__create_workflow( '[db_quote $workflow_key]', '[db_quote $workflow_name]', '[db_quote $workflow_name]', '[db_quote $workflow_description]', '[db_quote $workflow_cases_table]', - 'case_id' + 'case_id' ); @@ -22,33 +21,24 @@ - begin - insert into wf_transition_attribute_map - select '[db_quote $workflow_key]' as workflow_key, - '[db_quote $transition_key]' as transition_key, - workflow__create_attribute( - '[db_quote $workflow_key]', - '[db_quote $task($transition_key,loop_attribute_name)]', - 'boolean', - '[db_quote "$task($transition_key,loop_question)"]', - null, - null, - null, - '[ad_decode $task($transition_key,loop_answer) "t" "f" "t"]', - 1, - 1, - null, - 'generic', - 'none' - ) as attribute_id, - 1 as sortorder; - - return null; - end; - + select workflow__create_attribute( + '[db_quote $workflow_key]', + '[db_quote $task($transition_key,loop_attribute_name)]', + 'boolean', + '[db_quote "$task($transition_key,loop_question)"]', + null, + null, + null, + '[ad_decode $task($transition_key,loop_answer) "t" "f" "t"]', + 1, + 1, + null, + 'generic' + ); + @@ -57,16 +47,5 @@ - - - - insert into wf_arcs (workflow_key, transition_key, place_key, direction, - guard_callback, guard_custom_arg, guard_description) - values ('[db_quote $workflow_key]', '[db_quote $transition_key]', '[db_quote $true_place]', 'out', - 'wf_callback__guard_attribute_true', '[db_quote $task($transition_key,loop_attribute_name)]', - '[db_quote $task($transition_key,loop_question)]') - - - Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create.adp,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create.adp 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create.adp 19 Nov 2001 18:30:18 -0000 1.2 @@ -17,7 +17,7 @@

    -
  • set static assignments. +
  • set static assignments.

    Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create.tcl 16 May 2001 00:40:41 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create.tcl 19 Nov 2001 18:30:18 -0000 1.3 @@ -95,42 +95,53 @@ ); end; " - ##### # # Places # ##### - set counter 0 foreach transition_key $tasks { - db_dml insert_place " - insert into wf_places (place_key, workflow_key, place_name, sort_order) - values ('[db_quote $task($transition_key,input_place_key)]', '[db_quote $workflow_key]', - '[db_quote "Ready to $task($transition_key,task_name)"]', [expr $counter+1])" - - incr counter + wf_add_place \ + -workflow_key $workflow_key \ + -place_key $task($transition_key,input_place_key) \ + -place_name "Ready to $task($transition_key,task_name)" } + wf_add_place \ + -workflow_key $workflow_key \ + -place_key "end" \ + -place_name "Process finished" - db_dml insert_end_place " - insert into wf_places (place_key, workflow_key, place_name, sort_order) - values ('end', '[db_quote $workflow_key]', 'Process finished', [expr $num_tasks+1])" + ##### + # + # Roles + # + ##### + # For simplicity, we just create one role per transition, with the same + # key and name as the transition, and match those up one-to-one + + foreach transition_key $tasks { + wf_add_role \ + -workflow_key $workflow_key \ + -role_key $transition_key \ + -role_name $task($transition_key,task_name) + } + ##### # # Transitions # ##### - set counter 0 foreach transition_key $tasks { - db_dml insert_transition " - insert into wf_transitions (transition_key, transition_name, workflow_key, sort_order, trigger_type) - values ('[db_quote $transition_key]', '[db_quote $task($transition_key,task_name)]', - '[db_quote $workflow_key]', [expr $counter+1], 'user')" - - incr counter + wf_add_transition \ + -workflow_key $workflow_key \ + -transition_key $transition_key \ + -transition_name $task($transition_key,task_name) \ + -role_key $transition_key \ + -estimated_minutes $task($transition_key,task_time) } @@ -141,20 +152,21 @@ ##### foreach transition_key $tasks { - # arc from input place - db_dml insert_input_arc " - insert into wf_arcs (workflow_key, transition_key, place_key, direction) - values ('[db_quote $workflow_key]', '[db_quote $transition_key]', - '[db_quote $task($transition_key,input_place_key)]', 'in')" - + wf_add_arc_in \ + -workflow_key $workflow_key \ + -from_place_key $task($transition_key,input_place_key) \ + -to_transition_key $transition_key + + # arcs to output place(s) if { [empty_string_p $task($transition_key,loop_to_transition_key)] } { - db_dml insert_output_arc " - insert into wf_arcs (workflow_key, transition_key, place_key, direction) - values ('[db_quote $workflow_key]', '[db_quote $transition_key]', - '[db_quote $task($transition_key,output_place_key)]', 'out')" + # Simple: only one output arc, no guard + wf_add_arc_out \ + -workflow_key $workflow_key \ + -from_transition_key $transition_key \ + -to_place_key $task($transition_key,output_place_key) } else { @@ -166,18 +178,20 @@ set false_place $task($transition_key,loop_to_place_key) } - db_dml insert_false_output_arc " - insert into wf_arcs (workflow_key, transition_key, place_key, direction, guard_callback, guard_description) - values ('[db_quote $workflow_key]', '[db_quote $transition_key]', - '[db_quote $false_place]', 'out', '#', '[db_quote "Not $task($transition_key,loop_question)"]')" - - db_dml insert_true_output_arc " - insert into wf_arcs (workflow_key, transition_key, place_key, direction, - guard_callback, guard_custom_arg, guard_description) - values ('[db_quote $workflow_key]', '[db_quote $transition_key]', '[db_quote $true_place]', 'out', - 'wf_callback.guard_attribute_true', '[db_quote $task($transition_key,loop_attribute_name)]', - '[db_quote $task($transition_key,loop_question)]')" - + wf_add_arc_out \ + -workflow_key $workflow_key \ + -from_transition_key $transition_key \ + -to_place_key $false_place \ + -guard_callback "#" \ + -guard_description "Not $task($transition_key,loop_question)" + + wf_add_arc_out \ + -workflow_key $workflow_key \ + -from_transition_key $transition_key \ + -to_place_key $true_place \ + -guard_callback "wf_callback.guard_attribute_true" \ + -guard_custom_arg $task($transition_key,loop_attribute_name) \ + -guard_description $task($transition_key,loop_question) } } @@ -203,10 +217,13 @@ default_value => '[ad_decode $task($transition_key,loop_answer) "t" "f" "t"]' ); - insert into wf_transition_attribute_map (workflow_key, transition_key, attribute_id, sort_order) - values ('[db_quote $workflow_key]', '[db_quote $transition_key]', v_attribute_id, 1); end;" + wf_add_trans_attribute_map \ + -workflow_key $workflow_key \ + -transition_key $transition_key \ + -attribute_name $task($transition_key,loop_attribute_name) + } } @@ -221,30 +238,14 @@ set assigning_transition_key $task($transition_key,assigning_transition_key) if { ![empty_string_p $assigning_transition_key] } { - db_dml insert_transition_assignment_map " - insert into wf_transition_assignment_map (workflow_key, transition_key, assign_transition_key) - values ('[db_quote $workflow_key]', '[db_quote $assigning_transition_key]', '[db_quote $transition_key]')" + wf_add_trans_role_assign_map \ + -workflow_key $workflow_key \ + -transition_key $assigning_transition_key \ + -assign_role_key $transition_key } } - ##### - # - # Time estimate (in default context) - # - ##### - - foreach transition_key $tasks { - set task_time $task($transition_key,task_time) - if { ![empty_string_p $task_time] } { - - db_dml insert_time_estimate " - insert into wf_context_transition_info (context_key, workflow_key, transition_key, estimated_minutes) - values ('default', '[db_quote $workflow_key]', '[db_quote $transition_key]', $task_time)" - - } - } - } on_error { set error_p 1 } @@ -253,6 +254,7 @@ if { [db_table_exists $workflow_cases_table] } { db_dml drop_cases_table "drop table $workflow_cases_table" } + ad_return_error "Failed creating process" "We're sorry, but we couldn't create your process." return } Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create.xql 16 May 2001 00:40:41 -0000 1.2 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/admin/wizard/create.xql 19 Nov 2001 18:30:18 -0000 1.3 @@ -34,96 +34,9 @@ - - - - insert into wf_places (place_key, workflow_key, place_name, sort_order) - values ('[db_quote $task($transition_key,input_place_key)]', '[db_quote $workflow_key]', - '[db_quote "Ready to $task($transition_key,task_name)"]', [expr $counter+1]) - - - - - - - - - insert into wf_places (place_key, workflow_key, place_name, sort_order) - values ('end', '[db_quote $workflow_key]', 'Process finished', [expr $num_tasks+1]) - - - - - - - - - insert into wf_transitions (transition_key, transition_name, workflow_key, sort_order, trigger_type) - values ('[db_quote $transition_key]', '[db_quote $task($transition_key,task_name)]', - '[db_quote $workflow_key]', [expr $counter+1], 'user') - - - - - - - - - insert into wf_arcs (workflow_key, transition_key, place_key, direction) - values ('[db_quote $workflow_key]', '[db_quote $transition_key]', - '[db_quote $task($transition_key,input_place_key)]', 'in') - - - - - - - - - insert into wf_arcs (workflow_key, transition_key, place_key, direction) - values ('[db_quote $workflow_key]', '[db_quote $transition_key]', - '[db_quote $task($transition_key,output_place_key)]', 'out') - - - - - - - - - insert into wf_arcs (workflow_key, transition_key, place_key, direction, guard_callback, guard_description) - values ('[db_quote $workflow_key]', '[db_quote $transition_key]', - '[db_quote $false_place]', 'out', '#', '[db_quote "Not $task($transition_key,loop_question)"]') - - - - - - - - - insert into wf_transition_assignment_map (workflow_key, transition_key, assign_transition_key) - values ('[db_quote $workflow_key]', '[db_quote $assigning_transition_key]', '[db_quote $transition_key]') - - - - - - - - - insert into wf_context_transition_info (context_key, workflow_key, transition_key, estimated_minutes) - values ('default', '[db_quote $workflow_key]', '[db_quote $transition_key]', $task_time) - - - - - - drop table $workflow_cases_table - Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/design.html,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/design.html 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/design.html 19 Nov 2001 18:31:50 -0000 1.2 @@ -11,8 +11,8 @@

    Workflow Design Documentation

    -By Lars Pind on 7 September 2000. - +By Lars Pind on 7 September 2000.

    +By Khy Huang on 12 April 2001.

    ACS Documentation : Workflow : Workflow Design Documentation @@ -238,15 +238,12 @@ assignments by setting and querying a workflow attribute. Conceptually, this is very nice, but with the current implementation of workflow attributes, it doesn't allow multiple -assignments to the same task, so we had to scrap that. Now we have a -table, wf_case_assignments, to hold this -information. There's currently no way to have this queried for -automatically as part of the workflow execution (i.e. one task is to -assign the user to execute some other task), but we'll implement that -as soon as it is clear how it should work (i.e. should there be a -"base class" of parties to choose from? is this always one party, or -does that need to be multiple parties as well?). - +assignments to the same task, so we had to scrap that. +Since then we introduce the notion of roles to provide more flexibility +in assignment of users to task. Roles are assigned to parties and +they are associated with a case and/or task. This adds the functionality to +group a set of task together for assignment (i.e. assign a role +to a set of task)

    We've decided to make the workflow engine have a PL/SQL-only @@ -271,16 +268,16 @@ Some things, such as assignments, may be defined cascadingly at several levels, such as statically for all workflows, manually for each individual case, or programatically, by -executing a callback that determines who to assign. For example, a -task such as "send out check" would always be assigned to the billing -department. A task such as "author article" would be assigned manually -by the editor based on his knowledge of the skills of the individual -authors. In the ticket-tracker, the task of fixing a problem would -typically be assigned to a party based on who owns the corresponding +executing a callback that determines who to assign based on roles. +For example, a task such as "send out check" would always be assigned to +the billing department. A task such as "author article" would be assigned +manually by the editor based on his knowledge of the skills of the individual +authors in "author" role. In the ticket-tracker, the task of fixing a problem + would typically be assigned to a party based on who owns the corresponding project or feature area, and would be implemented by a callback from -the workflow package into the ticket-tracker package. +the workflow package into the ticket-tracker package. The callback would +include the "module owner" role as its parameter. -

    VI. API

    The API comes in two parts. There's one for manipulating @@ -398,7 +395,7 @@ for each of the elements, i.e. places, transitions and arcs. There's also a mapping table between transitions and workflow attributes, saying which attributes should be the output of which transitions. And -there's the now-obsololete wf_attribute_info table that +there's the now-obsololeted wf_attribute_info table that holds the wf_datatype discussed above under design tradeoffs. @@ -419,9 +416,10 @@ Petri Net pretty closely. There's a table, wf_tasks holding dynamic information corresponding to transitions, and one, wf_tokens, holding information about the tokens, which -corresponds to dynamic information on places. Besides that, there are -two tables, wf_case_assignments and -wf_case_deadlines, holding case-level manual assignments +corresponds to dynamic information on places. +There is a wf_roles that stores all roles for the +workflow. Besides that, there are two tables, wf_case_assignments + and wf_case_deadlines, holding case-level manual assignments and deadlines. The assignments table is necessary because attributes can't hold multiple values. The deadlines table isn't strictly necessary, but it is an option in line with setting the deadline in @@ -447,7 +445,7 @@ Workflow" section of the Developer's Guide. -

    Data Model Changes as per Nov 8, 2000

    +

    Data Model Changes as per Nov 8, 2000 (Planned, but not implemented)

    For permissions, the right solution seems to be to make at least wf_workflows, wf_cases and @@ -560,7 +558,6 @@
  • Third, we want to provide a repository of callback routines to be applied, so we can provide a nice user-interface for adding callbacks to a process. -

@@ -656,12 +653,17 @@ Finally, the table wf_attribute_info should go away. We don't need it any more, since it was only used for assignment attributes, something that's gone now. -

+

Note:

+The describe changes, as of Nov 8, are not implemented. These design changes +will be factored into the next release of workflow. For the next release +the most significant change is reimplementing the engine in Java. It will +require changes the way guards, callbacks, attributes, and object transitions +are handled. Don't worry as part of the next release we'll include, +hopefully, a straight foward upgrade path. -

VIII. User Interface

The user-interface falls in these separate parts: @@ -715,25 +717,25 @@ standard format. -
Workflow Debugging UI +
Workflow Debugging UI (not implemented, future feature)
For managers building workflows, we'll provide an interface for debugging the execution of the workflow, so there's a way to figure out what happened when it doesn't behave as expected. It might allow the user to step through the historic execution of the workflow, to verify what happened at each step of the execution. - -

IX. Configuration/Parameters

-There are currently no APM parameters for the workflow -package. However, the workflow package, by design, does require -customization by another package to be useful. +There are two optional parameters under the APM, +graphviz_dot_path and tmp_path. These parameters are required for +the +GraphVizv program used to generated the diagrams. Please read +the installation guide for more details.

X. Future Improvements/Areas of Likely Change

@@ -754,9 +756,9 @@

XI. Authors

@@ -769,8 +771,13 @@ When? By Whom? - + 1.0 + Minor updates about wf roles, parameters, and operational datamodel + 04/12/2001 + Khy Huang (khy@arsdigita.com) + + 0.1 Creation 9/18/2000 Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/installation.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/installation.html,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/installation.html 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/installation.html 19 Nov 2001 18:31:50 -0000 1.2 @@ -106,7 +106,7 @@ You don't have to copy over all the fonts. For the standard installation, you only need arial.ttf, -arialb.ttf, and times.ttf>. You may also symlink +arialb.ttf, and times.ttf. You may also symlink them if you prefer. But the above will work.

@@ -156,10 +156,13 @@

  • Create a new subfolder for workflow, and name it workflow (you may name it anything you want). -
  • Click "new application" next to that new subfolder. +
  • Click "mount" next to that new subfolder. -
  • Name it "Workflow", and select "ACS Workflow" from the drop-down -(you may name it differently if you like). +
  • Select "ACS Workflow" from the list of packages. +
    +If Workflow isn't on this list, click the back button on your browser +and click "new application" instead. Then type in a name (e.g., +"Workflow") and select "ACS Workflow" from the drop-down. Hit "New".
  • Click "set parameters" next to the workflow package. Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/release-notes.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/release-notes.html,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/release-notes.html 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/release-notes.html 19 Nov 2001 18:31:50 -0000 1.2 @@ -9,7 +9,7 @@

    Workflow Release Notes

    -By
    Lars Pind on January 12, 2001. +By Lars Pind on December 19, 2000.

    @@ -18,47 +18,10 @@


    -Workflow has been significantly enhanced since last version. Most -importantly, the package is now feature complete. It fully supports -all the things necessary to build applications on it. -

    -The changes include: -

      -
    • The Process Builder now lets you access every feature available in -the engine. - -
    • Processes can now be exported to other systems, as well as copied -on the existing system, so you can create a modified version of an -existing process. - -
    • Unassigned tasks are now handled properly and there's a callback -so you can email an administrator. - -
    • You can reassign a task, and we'll notify the new assignees -correspondingly. - -
    • The process summary is improved. - -
    - -In general, a lot of the user interface has been brushed up and -improved, and a few new features have been added to the engine. And, -of course, bugs have been fixed. - -

    - -For more details, please refer to the ACS -Workflow Package bboard on arsdigita.com, as well as the Workflow -module in the arsdigita.com Software Development Manager. - - -


    lars@pinds.com
    Index: openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/requirements.html,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/requirements.html 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/acs-workflow/www/doc/requirements.html 19 Nov 2001 18:31:50 -0000 1.2 @@ -9,8 +9,8 @@

    Workflow Requirements

    -By Lars Pind on November 8, 2000. - +By Lars Pind on November 8, 2000.
    +By Khy Huang on April 13, 2001

    ACS Documentation : Workflow : @@ -56,9 +56,10 @@

      -
    • The process acts upon objects of a certain type. +
    • The process acts upon objects of a certain type. -
    • The process is the same for every objects of this type. +
    • The process is the same for every objects of this type. Currently +this feature is not supported.
    • For each instance of the object type, the process can be characterized as a series of possibly conditional and otherwise @@ -123,10 +124,6 @@ - - - -

      III. System Overview

      The workflow package consists of three separate parts. @@ -421,146 +418,23 @@ and the chairman must approve it.

      -10.4.1 Explicit and Implicit Condition Routing The decision can -be made either as we're finishing the prior task, or as we execute one -of the two conditional tasks. The above example is one of explicit -conditional routing. An example of implicit conditional routing is -that we mail a form to the client, which the client must fill in and -return. If the user doesn't respond within a certain time-limit, we'll -do something different from when the user does respond. But the -decision needs to be made as late as possible, so we don't decide what -way to go until we receive the form or our patience runs out. - -

    - +
  • 10.4.1 Explicit and Implicit Condition Routing

    - -

  • 20.0 Permissions (NEW) -

    - -Following is the complete list of permissions that I can think -would be necessary and reasonable. - -

    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PrivilegeTaskCaseProcessSystemExplanation
    View taskxxxxView the information about a task
    Execute taskxxxxStart/Finish/Cancel the task, and possibly do - assignment/attribute setting as part of executing the task. - If you have the execute priviledge, you additionally have the - option of backtracking and undoing any tasks that you have the - right to execute (although you can only undo backwards, so if you - don't have permission to undo the latest task done, you can't undo).
    Assign taskxxxxAssign or reassign users to tasks. On the task or case level, - it's manual assignments. On the process or system level, it additionally - includes static assignments.
    Edit taskxxxxSet time estimates and deadlines for tasks. On the task and - case levels, this means setting it for the case. If it's on the - process level, it additionalli includes the option to set time - estimates on the workflow level
    Case overviewN/AxxxView the whole case in one snapshot. Will allow you to see all - the process, and the whole history of the case in the light of - this process. On the process level, it additionally allows viewing - of the process performance overview page, including drilling down - into all the cases of this process.
    Alter stateN/AxxxAlter the state of the case, including back-tracking, editing - attribute values, and putting the case into any valid state.
    Edit ProcessN/AN/AxxDefine or edit the process definition itself, indluing - adding/editing/deleting transitions, places, arcs, guards, - callbacks, etc.
    - -
    - -

    - -

  • 30.0 Process Definition Versioning (NEW) -

    - -We need to be able to keep multiple versions of a process -around. One of these will be the active version, which means -that it's the one that'll be used for new cases. - -

    - -

      - -
    • 30.1 Once cases exist of a specific version of a process, -that version can no longer be altered. But a new version can be -created, which will start out identical to the existing version, and -this version can then be altered as needed. - +The decision can be made either as we're finishing the prior task, or as we +execute one of the two conditional tasks. The above example is one of explicit +conditional routing. An example of Implicit conditioning, is a restaurant +owner purchases perishable goods, such as meat and vegatables. The food items +sit in a queue waiting to be processed into meals or wait for 15 days (meat +and vegatables tastes change after 15 days). If the task "wait for 15 days" + is completed, then the food item is thrown away. The routing is determined by +the first task to execute.
    - +

    - -

    Tasks

      -
    • 40.0 Inputs

      The item that the workflow is about will always be part of the input, @@ -589,7 +463,7 @@ takes time, so we must have a "start", "commit", "rollback" meachanism.

      - +

    • 70.1 There should be a date, such that, if the user has stared, but not committed or rolled back the task before that timeout date, the task is automatically rolled back and the task is created again. @@ -599,22 +473,23 @@
    • 80.0 Assignments

      -Tasks can be assigned to specific parties. +Tasks are not assigned directly to users, instead we associate roles +with a task. A role is granted to a single or a group of users. +Users belonging to that role have execute privileges on the task +associated with role.

      -80.1

        -
      1. Static assignment: while defining the workflow
      2. Manual assignment: assignment of tasks to users is part of the -workflow process, as in the user-scenario above. +workflow process, as in the user-scenario above. Only users with the +role associated with task are available for selection.
      3. Programmatic assignment: The assignment is made automatically based on some condition, e.g. a category. It should be done with a call-back in the RDBMS layer, so another package that uses the workflow package can provide their own logic, without having to use the same webserver as the workflow package might. -

      @@ -629,6 +504,9 @@

      Each task can have a deadline, a date by which is must be performed. This is determined by a call-back as the task is created. +

      +90.5 Completion time A task has an entry to estimate how long +it will take for completion.

      @@ -660,27 +538,14 @@

    • When a new task arrives
    • When a task is finished. - -
      Possibly also:
      - - +
    • When a task gets unassigned
    • When a task is started
    • When a task is finished (committed)
    • When a task is canceled (rolled back)
    • When a task times out and is canceled. -

      -

    • 115.0 Callback repository (NEW) -

      - -There should be a repository of callback routines which can be used -through the advanced process builder. They should include -documentation. - -

      -

    • 120.0 Automatic tasks

      A task can be "automatic" in the sense, that it is only there for the @@ -692,17 +557,20 @@ useful for timeouts, e.g. when waiting for a client to return a form, we may cancel the case if we don't hear back within a month. The point in time is determined via a call-back. -

      +

      120.5 Message tasks +

      A message from an external source can be passed to the task. The task +is executed upon receiving the message and all the criteria placed on +the message are satisfied. +

    • 125.0 Commentability

      The user can post a comment on a task at any time during the life-cycle of the case . The comments are shown to the users, so they can use them as a guidance in processing the case.

      -

    - +

    Contexts

      @@ -723,26 +591,20 @@

        -
      • Static assignment -
      • The number of minutes estimated to complete the task - +
      • The side effect events that trigger a callback +
      • Roles associated with a task.

      Note! It may or may not be the case that a context will always also be a subsite, in which case we don't need any -additional concept to model this situation. We'll need more -information from marketing to determine this. - +additional concept to model this situation.

    - - -

    VI.B Requirements: API

    Controlling the Workflow Process

    @@ -751,8 +613,10 @@
  • 200.0 Start workflow

    -Start a new instance of the workflow around an object, e.g. when a new -applicant signs up. +Start a new instance of the workflow around an object. Currently +it is not possible to have a callback in the kernel upon new +object creation. This requires programmically calling the +method to start a new case.

  • 210.0 Cancel/Suspend/Resume workflow @@ -773,10 +637,11 @@
  • 230.0 Workflow Attributes

    -There must be a way to query workflow attributes, so conditions, -side-effects and other call-backs can use those in their code. -

    - +Attributes for a process to use for branching and keeping state +properties. +

    230.10 Add and Edit attributes attributes per case +

    230.20 Access to those attributes values in the callback + procedures @@ -788,8 +653,6 @@ - -

    VI.C Requirements: Web Interface for Interacting with the Workflow Process

      @@ -804,7 +667,6 @@
    • 310.0 Task information and management

      See the user-scenario for a sample page. -

      @@ -826,17 +688,16 @@

        -
      • 400.0 Simple Process Wizard - +
      • 400.0 Simple Process Wizard

        +Step by step directions for creating a new workflow process. +Do not expose process designer to more advance features such +as addition parallel routing.

        - -

      • 410.0 Advanced Process Builder - +
      • 410.0 Advanced Process Builder
        +Exposes all the glory details of each entity within the workflow.
      - -

      VII. Revision History

      @@ -846,44 +707,44 @@ - - - - - + + + - + + + + + + - - - - + + + + - - - - - - + + + + - - - - - + + + + -
      When? By Whom?
      0.1Creation8/10/2000Lars Pind + 2.3Minor edits04/13/2001Khy Huang
      2.0Added information on permissions and versioning.11/8/2000Lars Pind
       Reviewed8/11/2000John Prevost, Mark Thomas, and Pete Su0.3Reviewed, revised, and updated - conforms to requirements template.8/22/2000Bryan Quinn
      0.2 Revised and updated 8/12/2000 Lars Pind
      0.3Reviewed, revised, and updated - conforms to requirements template.8/22/2000Bryan Quinn Reviewed8/11/2000John Prevost, Mark Thomas, and Pete Su
      2.0Added information on permissions and versioning.11/8/2000Lars Pind0.1Creation8/10/2000Lars Pind