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.
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.
-
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.
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 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.
-
-
-
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.
-
-
-
-
-
-
-
-
-
Privilege
-
Task
-
Case
-
Process
-
System
-
Explanation
-
-
-
View task
-
x
-
x
-
x
-
x
-
View the information about a task
-
-
-
Execute task
-
x
-
x
-
x
-
x
-
Start/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 task
-
x
-
x
-
x
-
x
-
Assign 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 task
-
x
-
x
-
x
-
x
-
Set 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 overview
-
N/A
-
x
-
x
-
x
-
View 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 state
-
N/A
-
x
-
x
-
x
-
Alter the state of the case, including back-tracking, editing
- attribute values, and putting the case into any valid state.
-
-
-
Edit Process
-
N/A
-
N/A
-
x
-
x
-
Define 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
-
Static assignment: while defining the workflow
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.
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.
-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.1
-
Creation
-
8/10/2000
-
Lars Pind
+
2.3
+
Minor edits
+
04/13/2001
+
Khy Huang
-
+
+
2.0
+
Added information on permissions and versioning.
+
11/8/2000
+
Lars Pind
+
-
-
Reviewed
-
8/11/2000
-
John Prevost, Mark Thomas, and Pete Su
+
0.3
+
Reviewed, revised, and updated - conforms to requirements template.
+
8/22/2000
+
Bryan Quinn
-
0.2
Revised and updated
8/12/2000
Lars Pind
-
-
0.3
-
Reviewed, revised, and updated - conforms to requirements template.