Index: openacs-4/contrib/obsolete-packages/ticket-tracker/sql/oracle/ttracker-workflow-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/ticket-tracker/sql/oracle/ttracker-workflow-create.sql,v diff -u -N -r1.1 -r1.2 --- openacs-4/contrib/obsolete-packages/ticket-tracker/sql/oracle/ttracker-workflow-create.sql 20 Apr 2001 20:51:25 -0000 1.1 +++ openacs-4/contrib/obsolete-packages/ticket-tracker/sql/oracle/ttracker-workflow-create.sql 19 Nov 2001 22:26:34 -0000 1.2 @@ -1,351 +1,654 @@ --- --- packages/ticket-tracker/sql/ttracker-workflow-create.sql --- --- --- @author Phong Nguyen (phong@arsdigita.com) --- @author Tony Tseng (tony@arsidigta.com) --- --- @creation-date 2000-11-15 --- --- @cvs-id $Id$ --- --- This table will hold one row for each case using this workflow. +/* + * Business Process Definition: Ticket Tracker Process (ttracker_wf) + * + * Auto-generated by ACS Workflow Export, version 4.3 + * + * Context: default + */ + + +/* + * Cases table + */ create table wf_ttracker_cases ( - case_id integer - constraint wf_ttkr_cases_pk - primary key - constraint wf_ticket_cases_case_fk - references wf_cases + case_id integer primary key + references wf_cases on delete cascade ); +/* + * Declare the object type + */ declare - v_workflow_key wf_workflows.workflow_key%TYPE; + v_workflow_key varchar2(40); begin v_workflow_key := workflow.create_workflow( - workflow_key => 'ttracker_wf', - pretty_name => 'Ticket Tracker Process', - pretty_plural => 'Ticket Tracker Process', - description => 'Workflow for processing a ticket in the ticket-tracker', - table_name => 'wf_ttracker_cases' + workflow_key => 'ttracker_wf', + pretty_name => 'Ticket Tracker Process', + pretty_plural => 'Ticket Tracker Process', + description => 'Workflow for processing a ticket in the ticket-tracker', + table_name => 'wf_ttracker_cases' ); +end; +/ +show errors - -- Creating places - workflow.add_place ( + + + +/***** + * Places + *****/ + +begin + workflow.add_place( workflow_key => 'ttracker_wf', - place_key => 'start', - place_name => 'Needs to be resolved', + place_key => 'start', + place_name => 'Needs to be resolved', sort_order => 1 - ); - workflow.add_place ( + ); +end; +/ +show errors + +begin + workflow.add_place( workflow_key => 'ttracker_wf', - place_key => 'to_be_clarified', - place_name => 'Needs to be clarified', + place_key => 'to_be_clarified', + place_name => 'Needs to be clarified', sort_order => 2 ); - workflow.add_place ( +end; +/ +show errors + +begin + workflow.add_place( workflow_key => 'ttracker_wf', - place_key => 'to_be_verified', - place_name => 'Needs to be verified', + place_key => 'to_be_verified', + place_name => 'Needs to be verified', sort_order => 3 ); - workflow.add_place ( +end; +/ +show errors + +begin + workflow.add_place( workflow_key => 'ttracker_wf', - place_key => 'end', - place_name => 'Closed', + place_key => 'end', + place_name => 'Closed', sort_order => 4 ); +end; +/ +show errors + +/***** + * Roles + *****/ - -- Creating transitions - workflow.add_transition ( + +begin + workflow.add_role( + workflow_key => 'ttracker_wf', + role_key => 'clarify', + role_name => 'Clarify ticket description', + sort_order => 2 + ); +end; +/ +show errors + +begin + workflow.add_role( + workflow_key => 'ttracker_wf', + role_key => 'resolve', + role_name => 'Resolve ticket', + sort_order => 1 + ); +end; +/ +show errors + +begin + workflow.add_role( + workflow_key => 'ttracker_wf', + role_key => 'verify', + role_name => 'Verify result', + sort_order => 3 + ); +end; +/ +show errors + + +/***** + * Transitions + *****/ + + +begin + workflow.add_transition( workflow_key => 'ttracker_wf', transition_key => 'resolve', transition_name => 'Resolve ticket', + role_key => 'resolve', sort_order => 1, trigger_type => 'user' ); - workflow.add_transition ( +end; +/ +show errors + +begin + workflow.add_transition( workflow_key => 'ttracker_wf', transition_key => 'clarify', transition_name => 'Clarify ticket description', + role_key => 'clarify', sort_order => 2, trigger_type => 'user' ); - workflow.add_transition ( +end; +/ +show errors + +begin + workflow.add_transition( workflow_key => 'ttracker_wf', transition_key => 'verify', transition_name => 'Verify result', + role_key => 'verify', sort_order => 3, trigger_type => 'user' ); end; / show errors + +/***** + * Arcs + *****/ + + begin - -- creating arcs - -- resolve in - -- in - workflow.add_arc ( - workflow_key => 'ttracker_wf', - transition_key => 'resolve', - place_key => 'start', - direction => 'in' + workflow.add_arc( + workflow_key => 'ttracker_wf', + transition_key => 'clarify', + place_key => 'start', + direction => 'out', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' ); - -- out - workflow.add_arc ( - workflow_key => 'ttracker_wf', - transition_key => 'resolve', - place_key => 'to_be_clarified', - direction => 'out', - guard_callback => 'wf_callback.guard_attribute_true', - guard_custom_arg => 'need_clarification', - guard_description => 'Description needs clarification' +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'ttracker_wf', + transition_key => 'clarify', + place_key => 'to_be_clarified', + direction => 'in', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' ); - workflow.add_arc ( - workflow_key => 'ttracker_wf', - transition_key => 'resolve', - place_key => 'to_be_verified', - direction => 'out', - guard_callback => '#', - guard_description => 'Description clear; issue resolved' +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'ttracker_wf', + transition_key => 'resolve', + place_key => 'start', + direction => 'in', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' ); - - -- verify - -- in - workflow.add_arc ( - workflow_key => 'ttracker_wf', - transition_key => 'verify', - place_key => 'to_be_verified', - direction => 'in' +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'ttracker_wf', + transition_key => 'resolve', + place_key => 'to_be_clarified', + direction => 'out', + guard_callback => 'wf_callback.guard_attribute_true', + guard_custom_arg => 'need_clarification', + guard_description => 'Description needs clarification' ); - -- out - workflow.add_arc ( - workflow_key => 'ttracker_wf', - transition_key => 'verify', - place_key => 'end', - direction => 'out', - guard_callback => 'wf_callback.guard_attribute_true', - guard_custom_arg => 'verified', - guard_description => 'Result okay' +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'ttracker_wf', + transition_key => 'resolve', + place_key => 'to_be_verified', + direction => 'out', + guard_callback => '#', + guard_custom_arg => '', + guard_description => 'Description clear; issue resolved' ); - workflow.add_arc ( - workflow_key => 'ttracker_wf', - transition_key => 'verify', - place_key => 'start', - direction => 'out', - guard_callback => '#', - guard_custom_arg => '', - guard_description => 'Result not okay' +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'ttracker_wf', + transition_key => 'verify', + place_key => 'end', + direction => 'out', + guard_callback => 'wf_callback.guard_attribute_true', + guard_custom_arg => 'verified', + guard_description => 'Result okay' ); - - -- clarify - -- in - workflow.add_arc ( - workflow_key => 'ttracker_wf', - transition_key => 'clarify', - place_key => 'to_be_clarified', - direction => 'in' +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'ttracker_wf', + transition_key => 'verify', + place_key => 'to_be_verified', + direction => 'in', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' ); - -- out - workflow.add_arc ( - workflow_key => 'ttracker_wf', - transition_key => 'clarify', - place_key => 'start', - direction => 'out' +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'ttracker_wf', + transition_key => 'verify', + place_key => 'start', + direction => 'out', + guard_callback => '#', + guard_custom_arg => '', + guard_description => 'Result not okay' ); - end; / show errors + +/***** + * Attributes + *****/ + + declare - v_attribute_id acs_attributes.attribute_id%TYPE; + v_attribute_id number; begin v_attribute_id := workflow.create_attribute( - workflow_key => 'ttracker_wf', - attribute_name => 'need_clarification', - datatype => 'boolean', - pretty_name => 'Description needs clarification', - default_value => 'f' + workflow_key => 'ttracker_wf', + attribute_name => 'need_clarification', + datatype => 'boolean', + pretty_name => 'Description needs clarification', + default_value => 'f' ); - - insert into wf_transition_attribute_map - (workflow_key, transition_key, attribute_id, sort_order) - values - ('ttracker_wf', 'resolve', v_attribute_id, 1); - +end; +/ +show errors + +begin + workflow.add_trans_attribute_map( + workflow_key => 'ttracker_wf', + transition_key => 'resolve', + attribute_name => 'need_clarification', + sort_order => 1 + ); +end; +/ +show errors + +declare + v_attribute_id number; +begin v_attribute_id := workflow.create_attribute( - workflow_key => 'ttracker_wf', - attribute_name => 'verified', - datatype => 'boolean', - pretty_name => 'Result is okay', - default_value => 't' + workflow_key => 'ttracker_wf', + attribute_name => 'verified', + datatype => 'boolean', + pretty_name => 'Result is okay', + default_value => 't' ); - - insert into wf_transition_attribute_map - (workflow_key, transition_key, attribute_id, sort_order) - values - ('ttracker_wf', 'verify', v_attribute_id, 1); end; / show errors + +begin + workflow.add_trans_attribute_map( + workflow_key => 'ttracker_wf', + transition_key => 'verify', + attribute_name => 'verified', + sort_order => 1 + ); +end; +/ +show errors + +/***** + * Transition-role-assignment-map + *****/ -insert into wf_context_transition_info ( - context_key, - workflow_key, - transition_key, - assignment_callback, - fire_callback, - notification_callback, - notification_custom_arg, - unassigned_callback, - access_privilege -) values ( - 'default', - 'ttracker_wf', - 'resolve', - 'ttracker_callback.assign_task_to_assignee', - 'ttracker_callback.resolve_fire', - 'ttracker_callback.notification', - 'Resolve Ticket', - 'ttracker_callback.notify_admin', - 'admin' -); -insert into wf_context_transition_info ( - context_key, - workflow_key, - transition_key, - assignment_callback, - fire_callback, - notification_callback, - notification_custom_arg, - access_privilege -) values ( - 'default', - 'ttracker_wf', - 'clarify', - 'ttracker_callback.assign_task_to_submitter', - 'ttracker_callback.clarify_fire', - 'ttracker_callback.notification', - 'Clarify Description', - 'admin' -); -insert into wf_context_transition_info ( - context_key, - workflow_key, - transition_key, - assignment_callback, - notification_callback, - notification_custom_arg, - access_privilege -) values ( - 'default', - 'ttracker_wf', - 'verify', - 'ttracker_callback.assign_task_to_submitter', - 'ttracker_callback.notification', - 'Verify Result', - 'admin' -); +/* + * Context/Transition info + * (for context = default) + */ +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, + 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) +values +('default', + 'ttracker_wf', + 'clarify', + null, + '', + '', + '', + 'ttracker_callback.clarify_fire', + '', + '', + '', + '', + '', + '', + '', + '', + 'ttracker_callback.notification', + 'Clarify Description', + '', + ''); -insert into wf_context_task_panels ( - context_key, - workflow_key, - transition_key, - sort_key, - header, - template_url -) values ( - 'default', - 'ttracker_wf', - 'resolve', - 1, - 'Ticket Info', - '/packages/ticket-tracker/wf-templates/ticket-info' -); +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, + 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) +values +('default', + 'ttracker_wf', + 'resolve', + null, + '', + '', + '', + 'ttracker_callback.resolve_fire', + '', + '', + '', + '', + '', + '', + '', + '', + 'ttracker_callback.notification', + 'Resolve Ticket', + 'ttracker_callback.notify_admin', + ''); -insert into wf_context_task_panels ( - context_key, - workflow_key, - transition_key, - sort_key, - header, - template_url -) values ( - 'default', - 'ttracker_wf', - 'resolve', - 2, - 'What to do', - '/packages/ticket-tracker/wf-templates/resolve' -); +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, + 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) +values +('default', + 'ttracker_wf', + 'verify', + null, + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + 'ttracker_callback.notification', + 'Verify Result', + '', + ''); -insert into wf_context_task_panels ( - context_key, - workflow_key, - transition_key, - sort_key, - header, - template_url -) values ( - 'default', - 'ttracker_wf', - 'clarify', - 1, - 'Ticket Info', - '/packages/ticket-tracker/wf-templates/ticket-info' -); -insert into wf_context_task_panels ( - context_key, - workflow_key, - transition_key, - sort_key, - header, - template_url -) values ( - 'default', - 'ttracker_wf', - 'clarify', - 2, - 'What to do', - '/packages/ticket-tracker/wf-templates/clarify' -); -insert into wf_context_task_panels ( - context_key, - workflow_key, - transition_key, - sort_key, - header, - template_url -) values ( - 'default', - 'ttracker_wf', - 'verify', - 1, - 'Ticket Info', - '/packages/ticket-tracker/wf-templates/ticket-info' -); +/* + * Context/Role info + * (for context = default) + */ -insert into wf_context_task_panels ( - context_key, - workflow_key, - transition_key, - sort_key, - header, - template_url -) values ( - 'default', - 'ttracker_wf', - 'verify', - 2, - 'What to do', - '/packages/ticket-tracker/wf-templates/verify' -); - \ No newline at end of file +insert into wf_context_role_info +(context_key, + workflow_key, + role_key, + assignment_callback, + assignment_custom_arg) +values +('default', + 'ttracker_wf', + 'clarify', + 'ttracker_callback.assign_task_to_submitter', + ''); + +insert into wf_context_role_info +(context_key, + workflow_key, + role_key, + assignment_callback, + assignment_custom_arg) +values +('default', + 'ttracker_wf', + 'resolve', + 'ttracker_callback.assign_task_to_assignee', + ''); + +insert into wf_context_role_info +(context_key, + workflow_key, + role_key, + assignment_callback, + assignment_custom_arg) +values +('default', + 'ttracker_wf', + 'verify', + 'ttracker_callback.assign_task_to_submitter', + ''); + + + +/* + * Context Task Panels + * (for context = default) + */ + +insert into wf_context_task_panels +(context_key, + workflow_key, + transition_key, + sort_order, + header, + template_url, + overrides_action_p, + only_display_when_started_p) +values +('default', + 'ttracker_wf', + 'clarify', + 1, + 'Ticket Info', + '/packages/ticket-tracker/wf-templates/ticket-info', + 'f', + 'f'); + +insert into wf_context_task_panels +(context_key, + workflow_key, + transition_key, + sort_order, + header, + template_url, + overrides_action_p, + only_display_when_started_p) +values +('default', + 'ttracker_wf', + 'clarify', + 2, + 'What to do', + '/packages/ticket-tracker/wf-templates/clarify', +:overrides_action_p, +:only_display_when_started_p); + +insert into wf_context_task_panels +(context_key, + workflow_key, + transition_key, + sort_order, + header, + template_url, + overrides_action_p, + only_display_when_started_p) +values +('default', + 'ttracker_wf', + 'resolve', + 1, + 'Ticket Info', + '/packages/ticket-tracker/wf-templates/ticket-info', + 'f', + 'f'); + +insert into wf_context_task_panels +(context_key, + workflow_key, + transition_key, + sort_order, + header, + template_url, + overrides_action_p, + only_display_when_started_p) +values +('default', + 'ttracker_wf', + 'resolve', + 2, + 'What to do', + '/packages/ticket-tracker/wf-templates/resolve', + 'f', + 'f'); + +insert into wf_context_task_panels +(context_key, + workflow_key, + transition_key, + sort_order, + header, + template_url, + overrides_action_p, + only_display_when_started_p) +values +('default', + 'ttracker_wf', + 'verify', + 1, + 'Ticket Info', + '/packages/ticket-tracker/wf-templates/ticket-info', + 'f', + 'f'); + +insert into wf_context_task_panels +(context_key, + workflow_key, + transition_key, + sort_order, + header, + template_url, + overrides_action_p, + only_display_when_started_p) +values +('default', + 'ttracker_wf', + 'verify', + 2, + 'What to do', + '/packages/ticket-tracker/wf-templates/verify', + 'f', + 'f'); + + +commit; + Index: openacs-4/packages/glossary/sql/oracle/glossary-workflows.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/sql/oracle/glossary-workflows.sql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/sql/oracle/glossary-workflows.sql 20 Apr 2001 20:51:12 -0000 1.1 +++ openacs-4/packages/glossary/sql/oracle/glossary-workflows.sql 19 Nov 2001 22:34:23 -0000 1.2 @@ -1,329 +1,3 @@ --- glossary/sql/glossary-workflows.sql --- walter@arsdigita.com, 11-26-2000 - --- load some default workflows for the glossary package --- each glossary decides on a workflow - --- create the full term publishing process workflow --- the alternative is a simple workflow (i.e. submit -> approve) - - -create table full_term_publish_proces_cases ( - case_id integer primary key - constraint full_term_publish_proc_case_fk - references wf_cases on delete cascade -); - -declare - v_workflow_key varchar(40); -begin - v_workflow_key := workflow.create_workflow( - workflow_key => 'full_term_publish_process_wf', - pretty_name => 'Full Term Publish Process', - pretty_plural => 'Full Term Publish Processes', - description => 'Fairly sophisticatd standard glossary term publishing. Publisher or Editor create a term. Author writes definition. Editor edits definition. Graphic designer adds and illustration. Editor or publisher approve or reject new term.', - table_name => 'full_term_publish_proces_cases' - ); -end; -/ -show errors - -begin -insert into wf_places ( -place_key, workflow_key, place_name, sort_order -) values ( -'start', 'full_term_publish_process_wf', 'Ready to Author Definition.', 1 -); - -insert into wf_places ( -place_key, workflow_key, place_name, sort_order -) values ( -'before_edit_definiton', 'full_term_publish_process_wf', 'Ready to Edit Definiton', 2 -); - -insert into wf_places ( -place_key, workflow_key, place_name, sort_order -) values ( -'before_add_illustration', 'full_term_publish_process_wf', 'Ready to Add Illustration', 3 -); - -insert into wf_places ( -place_key, workflow_key, place_name, sort_order -) values ( -'before_approve_new_term', 'full_term_publish_process_wf', 'Ready to Approve New Term', 4 -); - -insert into wf_places ( -place_key, workflow_key, place_name, sort_order -) values ( -'end', 'full_term_publish_process_wf', 'Process finished', 5 -); -end; -/ -show errors - -begin -insert into wf_transitions ( -transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( -'author_definition', 'Author Definition.', 'full_term_publish_process_wf', 1, 'user' -); - -insert into wf_transitions ( -transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( -'edit_definiton', 'Edit Definiton', 'full_term_publish_process_wf', 2, 'user' -); - -insert into wf_transitions ( -transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( -'add_illustration', 'Add Illustration', 'full_term_publish_process_wf', 3, 'user' -); - -insert into wf_transitions ( -transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( -'approve_new_term', 'Approve New Term', 'full_term_publish_process_wf', 4, 'user' -); -end; -/ -show errors - -begin -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction -) values ( -'full_term_publish_process_wf', 'author_definition', 'start', 'in' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction -) values ( -'full_term_publish_process_wf', 'author_definition', -'before_edit_definiton', 'out' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction -) values ( -'full_term_publish_process_wf', 'edit_definiton', -'before_edit_definiton', 'in' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction, guard_callback, guard_description -) values ( -'full_term_publish_process_wf', 'edit_definiton', -'start', 'out', '#', 'Not Is definition correct' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction, -guard_callback, guard_custom_arg, guard_description -) values ( -'full_term_publish_process_wf', 'edit_definiton', 'before_add_illustration', 'out', -'wf_callback.guard_attribute_true', 'edit_definiton_is_definition_correct_p', 'Is definition correct' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction -) values ( -'full_term_publish_process_wf', 'add_illustration', -'before_add_illustration', 'in' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction -) values ( -'full_term_publish_process_wf', 'add_illustration', -'before_approve_new_term', 'out' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction -) values ( -'full_term_publish_process_wf', 'approve_new_term', -'before_approve_new_term', 'in' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction, guard_callback, guard_description -) values ( -'full_term_publish_process_wf', 'approve_new_term', -'before_edit_definiton', 'out', '#', 'Not Approved' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction, -guard_callback, guard_custom_arg, guard_description -) values ( -'full_term_publish_process_wf', 'approve_new_term', 'end', 'out', -'wf_callback.guard_attribute_true', 'approve_new_term_approved_p', 'Approved' -); -end; -/ -show errors - -declare - v_attribute_id acs_attributes.attribute_id%TYPE; -begin - v_attribute_id := workflow.create_attribute( - workflow_key => 'full_term_publish_process_wf', - attribute_name => 'edit_definiton_is_definition_correct_p', - datatype => 'boolean', - pretty_name => 'Is definition correct', - default_value => 't' - ); - - insert into wf_transition_attribute_map ( - workflow_key, transition_key, attribute_id, sort_order - ) values ( - 'full_term_publish_process_wf', 'edit_definiton', v_attribute_id, 1); -end; -/ -show errors - -declare - v_attribute_id acs_attributes.attribute_id%TYPE; -begin - v_attribute_id := workflow.create_attribute( - workflow_key => 'full_term_publish_process_wf', - attribute_name => 'approve_new_term_approved_p', - datatype => 'boolean', - pretty_name => 'Approved', - default_value => 't' - ); - - insert into wf_transition_attribute_map ( - workflow_key, transition_key, attribute_id, sort_order - ) values ( - 'full_term_publish_process_wf', 'approve_new_term', v_attribute_id, 1 - ); -end; -/ -show errors - -begin -insert into wf_transition_assignment_map ( -workflow_key, transition_key, assign_transition_key -) values ( -'full_term_publish_process_wf', 'edit_definiton', 'add_illustration' -); - -insert into wf_context_transition_info ( -context_key, workflow_key, transition_key, estimated_minutes -) values ( -'default', 'full_term_publish_process_wf', 'author_definition', 60 -); - -insert into wf_context_transition_info ( -context_key, workflow_key, transition_key, estimated_minutes -) values ( -'default', 'full_term_publish_process_wf', 'edit_definiton', 20 -); - -insert into wf_context_transition_info ( -context_key, workflow_key, transition_key, estimated_minutes -) values ( -'default', 'full_term_publish_process_wf', 'add_illustration', 120 -); - -insert into wf_context_transition_info ( -context_key, workflow_key, transition_key, estimated_minutes -) values ( -'default', 'full_term_publish_process_wf', 'approve_new_term', 10 -); -end; -/ -show errors - --- simple term submission process - -create table term_submission_process_cases ( - case_id integer primary key - constraint term_submission_proces_case_fk - references wf_cases on delete cascade -); - -declare - v_workflow_key varchar(40); -begin - v_workflow_key := workflow.create_workflow( - workflow_key => 'term_submission_process_wf', - pretty_name => 'Term Submission Process', - pretty_plural => 'Term Submission Processes', - description => 'User submits new term and its definition (and maybe illustration). Administrator approves or rejects submission.', - table_name => 'term_submission_process_cases' - ); -end; -/ -show errors - -begin - insert into wf_places ( - place_key, workflow_key, place_name, sort_order - ) values ( - 'start', 'term_submission_process_wf', 'Ready to Approve', 1 - ); - - insert into wf_places ( - place_key, workflow_key, place_name, sort_order - ) values ( - 'end', 'term_submission_process_wf', 'Process finished', 2 - ); - - insert into wf_transitions ( - transition_key, transition_name, workflow_key, sort_order, trigger_type - ) values ( - 'approve', 'Approve', 'term_submission_process_wf', 1, 'user' - ); - - insert into wf_arcs ( - workflow_key, transition_key, place_key, direction - ) values ( - 'term_submission_process_wf', 'approve', 'start', 'in' - ); - - insert into wf_arcs ( - workflow_key, transition_key, place_key, direction - ) values ( - 'term_submission_process_wf', 'approve', 'end', 'out' - ); - - insert into wf_context_transition_info ( - context_key, workflow_key, transition_key, estimated_minutes - ) values ( - 'default', 'term_submission_process_wf', 'approve', 10 - ); -end; -/ -show errors - --- this is a special case inorder to maintain --- constraint integrity --- has the disadvantage, that is shows up on the workflow pages --- when it is really just a deadend --- oh well - -create table term_go_live_process_cases ( - case_id integer primary key - constraint term_go_live_proces_case_fk - references wf_cases on delete cascade -); - -declare - v_workflow_key varchar(40); -begin - v_workflow_key := workflow.create_workflow( - workflow_key => 'term_go_live_wf', - pretty_name => 'Term Go Live Process', - pretty_plural => 'Term Go Live Processes', - description => 'User submits new term and its definition (and maybe illustration) and it goes live immediately.', - table_name => 'term_go_live_process_cases' - ); -end; -/ -show errors - - +@@ wf-full-term-publish-create.sql +@@ wf-term-go-live.sql +@@ wf-term-submission.sql \ No newline at end of file Index: openacs-4/packages/glossary/sql/oracle/wf-full-term-publish-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/sql/oracle/wf-full-term-publish-create.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/sql/oracle/wf-full-term-publish-create.sql 19 Nov 2001 22:34:23 -0000 1.1 @@ -0,0 +1,617 @@ + +/* + * Business Process Definition: Full Term Publish Process (full_term_publish_process_wf) + * + * Auto-generated by ACS Workflow Export, version 4.3 + * + * Context: default + */ + + +/* + * Cases table + */ +create table full_term_publish_proces_cases ( + case_id integer primary key + references wf_cases on delete cascade +); + +/* + * Declare the object type + */ + +declare + v_workflow_key varchar2(40); +begin + v_workflow_key := workflow.create_workflow( + workflow_key => 'full_term_publish_process_wf', + pretty_name => 'Full Term Publish Process', + pretty_plural => 'Full Term Publish Processes', + description => 'Fairly sophisticatd standard glossary term publishing. Publisher or Editor create a term. Author writes definition. Editor edits definition. Graphic designer adds and illustration. Editor or publisher approve or reject new term.', + table_name => 'full_term_publish_proces_cases' + ); +end; +/ +show errors + + + + +/***** + * Places + *****/ + +begin + workflow.add_place( + workflow_key => 'full_term_publish_process_wf', + place_key => 'start', + place_name => 'Ready to Author Definition.', + sort_order => 1 + ); +end; +/ +show errors + +begin + workflow.add_place( + workflow_key => 'full_term_publish_process_wf', + place_key => 'before_edit_definiton', + place_name => 'Ready to Edit Definiton', + sort_order => 2 + ); +end; +/ +show errors + +begin + workflow.add_place( + workflow_key => 'full_term_publish_process_wf', + place_key => 'before_add_illustration', + place_name => 'Ready to Add Illustration', + sort_order => 3 + ); +end; +/ +show errors + +begin + workflow.add_place( + workflow_key => 'full_term_publish_process_wf', + place_key => 'before_approve_new_term', + place_name => 'Ready to Approve New Term', + sort_order => 4 + ); +end; +/ +show errors + +begin + workflow.add_place( + workflow_key => 'full_term_publish_process_wf', + place_key => 'end', + place_name => 'Process finished', + sort_order => 5 + ); +end; +/ +show errors + +/***** + * Roles + *****/ + + +begin + workflow.add_role( + workflow_key => 'full_term_publish_process_wf', + role_key => 'add_illustration', + role_name => 'Add Illustration', + sort_order => 3 + ); +end; +/ +show errors + +begin + workflow.add_role( + workflow_key => 'full_term_publish_process_wf', + role_key => 'approve_new_term', + role_name => 'Approve New Term', + sort_order => 4 + ); +end; +/ +show errors + +begin + workflow.add_role( + workflow_key => 'full_term_publish_process_wf', + role_key => 'author_definition', + role_name => 'Author Definition.', + sort_order => 1 + ); +end; +/ +show errors + +begin + workflow.add_role( + workflow_key => 'full_term_publish_process_wf', + role_key => 'edit_definiton', + role_name => 'Edit Definiton', + sort_order => 2 + ); +end; +/ +show errors + + +/***** + * Transitions + *****/ + + +begin + workflow.add_transition( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'author_definition', + transition_name => 'Author Definition.', + role_key => 'author_definition', + sort_order => 1, + trigger_type => 'user' + ); +end; +/ +show errors + +begin + workflow.add_transition( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'edit_definiton', + transition_name => 'Edit Definiton', + role_key => 'edit_definiton', + sort_order => 2, + trigger_type => 'user' + ); +end; +/ +show errors + +begin + workflow.add_transition( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'add_illustration', + transition_name => 'Add Illustration', + role_key => 'add_illustration', + sort_order => 3, + trigger_type => 'user' + ); +end; +/ +show errors + +begin + workflow.add_transition( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'approve_new_term', + transition_name => 'Approve New Term', + role_key => 'approve_new_term', + sort_order => 4, + trigger_type => 'user' + ); +end; +/ +show errors + + +/***** + * Arcs + *****/ + + +begin + workflow.add_arc( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'add_illustration', + place_key => 'before_add_illustration', + direction => 'in', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'add_illustration', + place_key => 'before_approve_new_term', + direction => 'out', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'approve_new_term', + place_key => 'before_approve_new_term', + direction => 'in', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'approve_new_term', + place_key => 'before_edit_definiton', + direction => 'out', + guard_callback => '#', + guard_custom_arg => '', + guard_description => 'Not Approved' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'approve_new_term', + place_key => 'end', + direction => 'out', + guard_callback => 'wf_callback.guard_attribute_true', + guard_custom_arg => 'approve_new_term_approved_p', + guard_description => 'Approved' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'author_definition', + place_key => 'before_edit_definiton', + direction => 'out', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'author_definition', + place_key => 'start', + direction => 'in', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'edit_definiton', + place_key => 'before_add_illustration', + direction => 'out', + guard_callback => 'wf_callback.guard_attribute_true', + guard_custom_arg => 'edit_definiton_is_definition_correct_p', + guard_description => 'Is definition correct' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'edit_definiton', + place_key => 'start', + direction => 'out', + guard_callback => '#', + guard_custom_arg => '', + guard_description => 'Not Is definition correct' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'edit_definiton', + place_key => 'before_edit_definiton', + direction => 'in', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + + +/***** + * Attributes + *****/ + + +declare + v_attribute_id integer; +begin + v_attribute_id := workflow.create_attribute( + workflow_key => 'full_term_publish_process_wf', + attribute_name => 'edit_definiton_is_definition_correct_p', + datatype => 'boolean', + pretty_name => 'Is definition correct', + default_value => 't' + ); +end; +/ +show errors + +begin + workflow.add_trans_attribute_map( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'edit_definiton', + attribute_name => 'edit_definiton_is_definition_correct_p', + sort_order => 1 + ); +end; +/ +show errors + +declare + v_attribute_id integer; +begin + v_attribute_id := workflow.create_attribute( + workflow_key => 'full_term_publish_process_wf', + attribute_name => 'approve_new_term_approved_p', + datatype => 'boolean', + pretty_name => 'Approved', + default_value => 't' + ); +end; +/ +show errors + +begin + workflow.add_trans_attribute_map( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'approve_new_term', + attribute_name => 'approve_new_term_approved_p', + sort_order => 1 + ); +end; +/ +show errors + +/***** + * Transition-role-assignment-map + *****/ + + +begin + workflow.add_trans_role_assign_map( + workflow_key => 'full_term_publish_process_wf', + transition_key => 'edit_definiton', + assign_role_key => 'add_illustration' + ); +end; +/ +show errors; + + +/* + * Context/Transition info + * (for context = default) + */ + +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, + 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) +values +('default', + 'full_term_publish_process_wf', + 'add_illustration', + 120, + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + ''); + +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, + 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) +values +('default', + 'full_term_publish_process_wf', + 'approve_new_term', + 10, + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + ''); + +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, + 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) +values +('default', + 'full_term_publish_process_wf', + 'author_definition', + 60, + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + ''); + +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, + 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) +values +('default', + 'full_term_publish_process_wf', + 'edit_definiton', + 20, + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + ''); + + + +/* + * Context/Role info + * (for context = default) + */ + + + +/* + * Context Task Panels + * (for context = default) + */ + + +commit; + Index: openacs-4/packages/glossary/sql/oracle/wf-term-go-live.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/sql/oracle/wf-term-go-live.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/sql/oracle/wf-term-go-live.sql 19 Nov 2001 22:34:23 -0000 1.1 @@ -0,0 +1,94 @@ + +/* + * Business Process Definition: Term Go Live Process (term_go_live_wf) + * + * Auto-generated by ACS Workflow Export, version 4.3 + * + * Context: default + */ + + +/* + * Cases table + */ +create table term_go_live_process_cases ( + case_id integer primary key + references wf_cases on delete cascade +); + +/* + * Declare the object type + */ + +declare + v_workflow_key varchar2(40); +begin + v_workflow_key := workflow.create_workflow( + workflow_key => 'term_go_live_wf', + pretty_name => 'Term Go Live Process', + pretty_plural => 'Term Go Live Processes', + description => 'User submits new term and its definition (and maybe illustration) and it goes live immediately.', + table_name => 'term_go_live_process_cases' + ); +end; +/ +show errors + + + + +/***** + * Places + *****/ + +/***** + * Roles + *****/ + + + +/***** + * Transitions + *****/ + + + +/***** + * Arcs + *****/ + + + +/***** + * Attributes + *****/ + + +/***** + * Transition-role-assignment-map + *****/ + + + +/* + * Context/Transition info + * (for context = default) + */ + + + +/* + * Context/Role info + * (for context = default) + */ + + + +/* + * Context Task Panels + * (for context = default) + */ + + +commit; + Index: openacs-4/packages/glossary/sql/oracle/wf-term-submission.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/sql/oracle/wf-term-submission.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/sql/oracle/wf-term-submission.sql 19 Nov 2001 22:34:23 -0000 1.1 @@ -0,0 +1,426 @@ + +/* + * Business Process Definition: Simple Publishing Workflow (publishing_wf) + * + * Auto-generated by ACS Workflow Export, version 4.3 + * + * Context: default + */ + + +/* + * Cases table + */ +create table cr_workflows ( + case_id integer primary key + references wf_cases on delete cascade +); + +/* + * Declare the object type + */ + +declare + v_workflow_key varchar2(40); +begin + v_workflow_key := workflow.create_workflow( + workflow_key => 'publishing_wf', + pretty_name => 'Simple Publishing Workflow', + pretty_plural => 'Simple Publishing Workflows', + description => 'A simple linear workflow for authoring, + editing and scheduling content items.', + table_name => 'cr_workflows' + ); +end; +/ +show errors + + + + +/***** + * Places + *****/ + +begin + workflow.add_place( + workflow_key => 'publishing_wf', + place_key => 'start', + place_name => 'Created', + sort_order => 1 + ); +end; +/ +show errors + +begin + workflow.add_place( + workflow_key => 'publishing_wf', + place_key => 'authored', + place_name => 'Authored', + sort_order => 2 + ); +end; +/ +show errors + +begin + workflow.add_place( + workflow_key => 'publishing_wf', + place_key => 'edited', + place_name => 'Edited', + sort_order => 3 + ); +end; +/ +show errors + +begin + workflow.add_place( + workflow_key => 'publishing_wf', + place_key => 'end', + place_name => 'Approved', + sort_order => 4 + ); +end; +/ +show errors + +/***** + * Roles + *****/ + + +begin + workflow.add_role( + workflow_key => 'publishing_wf', + role_key => 'approval', + role_name => 'Approval', + sort_order => 3 + ); +end; +/ +show errors + +begin + workflow.add_role( + workflow_key => 'publishing_wf', + role_key => 'authoring', + role_name => 'Authoring', + sort_order => 1 + ); +end; +/ +show errors + +begin + workflow.add_role( + workflow_key => 'publishing_wf', + role_key => 'editing', + role_name => 'Editing', + sort_order => 2 + ); +end; +/ +show errors + + +/***** + * Transitions + *****/ + + +begin + workflow.add_transition( + workflow_key => 'publishing_wf', + transition_key => 'authoring', + transition_name => 'Authoring', + role_key => 'authoring', + sort_order => 1, + trigger_type => 'user' + ); +end; +/ +show errors + +begin + workflow.add_transition( + workflow_key => 'publishing_wf', + transition_key => 'editing', + transition_name => 'Editing', + role_key => 'editing', + sort_order => 2, + trigger_type => 'user' + ); +end; +/ +show errors + +begin + workflow.add_transition( + workflow_key => 'publishing_wf', + transition_key => 'approval', + transition_name => 'Approval', + role_key => 'approval', + sort_order => 3, + trigger_type => 'user' + ); +end; +/ +show errors + + +/***** + * Arcs + *****/ + + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'approval', + place_key => 'authored', + direction => 'out', + guard_callback => 'publishing_wf.is_next', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'approval', + place_key => 'edited', + direction => 'in', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'approval', + place_key => 'end', + direction => 'out', + guard_callback => 'publishing_wf.is_next', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'approval', + place_key => 'start', + direction => 'out', + guard_callback => 'publishing_wf.is_next', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'approval', + place_key => 'edited', + direction => 'out', + guard_callback => '#', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'authoring', + place_key => 'authored', + direction => 'out', + guard_callback => 'publishing_wf.is_next', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'authoring', + place_key => 'start', + direction => 'out', + guard_callback => '#', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'authoring', + place_key => 'start', + direction => 'in', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'editing', + place_key => 'authored', + direction => 'in', + guard_callback => '', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'editing', + place_key => 'edited', + direction => 'out', + guard_callback => 'publishing_wf.is_next', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'editing', + place_key => 'start', + direction => 'out', + guard_callback => 'publishing_wf.is_next', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + +begin + workflow.add_arc( + workflow_key => 'publishing_wf', + transition_key => 'editing', + place_key => 'authored', + direction => 'out', + guard_callback => '#', + guard_custom_arg => '', + guard_description => '' + ); +end; +/ +show errors + + +/***** + * Attributes + *****/ + + +declare + v_attribute_id integer; +begin + v_attribute_id := workflow.create_attribute( + workflow_key => 'publishing_wf', + attribute_name => 'next_place', + datatype => 'string', + pretty_name => 'Next Place', + default_value => 'start' + ); +end; +/ +show errors + +begin + workflow.add_trans_attribute_map( + workflow_key => 'publishing_wf', + transition_key => 'approval', + attribute_name => 'next_place', + sort_order => 1 + ); +end; +/ +show errors + +begin + workflow.add_trans_attribute_map( + workflow_key => 'publishing_wf', + transition_key => 'authoring', + attribute_name => 'next_place', + sort_order => 1 + ); +end; +/ +show errors + +begin + workflow.add_trans_attribute_map( + workflow_key => 'publishing_wf', + transition_key => 'editing', + attribute_name => 'next_place', + sort_order => 1 + ); +end; +/ +show errors + +/***** + * Transition-role-assignment-map + *****/ + + + +/* + * Context/Transition info + * (for context = default) + */ + + + +/* + * Context/Role info + * (for context = default) + */ + + + +/* + * Context Task Panels + * (for context = default) + */ + + +commit; + Index: openacs-4/packages/glossary/sql/postgresql/glossary-workflows.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/sql/postgresql/glossary-workflows.sql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/glossary/sql/postgresql/glossary-workflows.sql 31 Oct 2001 20:46:59 -0000 1.1 +++ openacs-4/packages/glossary/sql/postgresql/glossary-workflows.sql 19 Nov 2001 22:26:07 -0000 1.2 @@ -1,329 +1,3 @@ --- glossary/sql/glossary-workflows.sql --- walter@arsdigita.com, 11-26-2000 - --- load some default workflows for the glossary package --- each glossary decides on a workflow - --- create the full term publishing process workflow --- the alternative is a simple workflow (i.e. submit -> approve) - - -create table full_term_publish_proces_cases ( - case_id integer primary key - constraint full_term_publish_proc_case_fk - references wf_cases on delete cascade -); - -select workflow__create_workflow( - 'full_term_publish_process_wf', - 'Full Term Publish Process', - 'Full Term Publish Processes', - 'Fairly sophisticatd standard glossary term publishing. Publisher or Editor create a term. Author writes definition. Editor edits definition. Graphic designer adds and illustration. Editor or publisher approve or reject new term.', - 'full_term_publish_proces_cases', - 'case_id' - ); - -begin; -insert into wf_places ( -place_key, workflow_key, place_name, sort_order -) values ( -'start', 'full_term_publish_process_wf', 'Ready to Author Definition.', 1 -); - -insert into wf_places ( -place_key, workflow_key, place_name, sort_order -) values ( -'before_edit_definiton', 'full_term_publish_process_wf', 'Ready to Edit Definiton', 2 -); - -insert into wf_places ( -place_key, workflow_key, place_name, sort_order -) values ( -'before_add_illustration', 'full_term_publish_process_wf', 'Ready to Add Illustration', 3 -); - -insert into wf_places ( -place_key, workflow_key, place_name, sort_order -) values ( -'before_approve_new_term', 'full_term_publish_process_wf', 'Ready to Approve New Term', 4 -); - -insert into wf_places ( -place_key, workflow_key, place_name, sort_order -) values ( -'end', 'full_term_publish_process_wf', 'Process finished', 5 -); -end; - -begin; -insert into wf_transitions ( -transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( -'author_definition', 'Author Definition.', 'full_term_publish_process_wf', 1, 'user' -); - -insert into wf_transitions ( -transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( -'edit_definiton', 'Edit Definiton', 'full_term_publish_process_wf', 2, 'user' -); - -insert into wf_transitions ( -transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( -'add_illustration', 'Add Illustration', 'full_term_publish_process_wf', 3, 'user' -); - -insert into wf_transitions ( -transition_key, transition_name, workflow_key, sort_order, trigger_type -) values ( -'approve_new_term', 'Approve New Term', 'full_term_publish_process_wf', 4, 'user' -); -end; - -begin; -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction -) values ( -'full_term_publish_process_wf', 'author_definition', 'start', 'in' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction -) values ( -'full_term_publish_process_wf', 'author_definition', -'before_edit_definiton', 'out' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction -) values ( -'full_term_publish_process_wf', 'edit_definiton', -'before_edit_definiton', 'in' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction, guard_callback, guard_description -) values ( -'full_term_publish_process_wf', 'edit_definiton', -'start', 'out', '#', 'Not Is definition correct' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction, -guard_callback, guard_custom_arg, guard_description -) values ( -'full_term_publish_process_wf', 'edit_definiton', 'before_add_illustration', 'out', -'wf_callback.guard_attribute_true', 'edit_definiton_is_definition_correct_p', 'Is definition correct' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction -) values ( -'full_term_publish_process_wf', 'add_illustration', -'before_add_illustration', 'in' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction -) values ( -'full_term_publish_process_wf', 'add_illustration', -'before_approve_new_term', 'out' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction -) values ( -'full_term_publish_process_wf', 'approve_new_term', -'before_approve_new_term', 'in' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction, guard_callback, guard_description -) values ( -'full_term_publish_process_wf', 'approve_new_term', -'before_edit_definiton', 'out', '#', 'Not Approved' -); - -insert into wf_arcs ( -workflow_key, transition_key, place_key, direction, -guard_callback, guard_custom_arg, guard_description -) values ( -'full_term_publish_process_wf', 'approve_new_term', 'end', 'out', -'wf_callback.guard_attribute_true', 'approve_new_term_approved_p', 'Approved' -); -end; - -create function inline_0() returns integer as ' -declare - v_attribute_id integer; -begin - v_attribute_id := workflow__create_attribute( - ''full_term_publish_process_wf'', - ''edit_definiton_is_definition_correct_p'', - ''boolean'', - ''Is definition correct'', - NULL, - NULL, - NULL, - ''t'', - 1, - 1, - NULL, - ''generic'', - ''none'' - ); - - insert into wf_transition_attribute_map ( - workflow_key, transition_key, attribute_id, sort_order - ) values ( - ''full_term_publish_process_wf'', ''edit_definiton'', v_attribute_id, 1); - - return 0; - -end;' language 'plpgsql'; - -select inline_0(); -drop function inline_0(); - -create function inline_0() returns integer as ' -declare - v_attribute_id integer; -begin - v_attribute_id := workflow__create_attribute( - ''full_term_publish_process_wf'', - ''approve_new_term_approved_p'', - ''boolean'', - ''Approved'', - NULL, - NULL, - NULL, - ''t'', - 1, - 1, - NULL, - ''generic'', - ''none'' - ); - - insert into wf_transition_attribute_map ( - workflow_key, transition_key, attribute_id, sort_order - ) values ( - ''full_term_publish_process_wf'', ''approve_new_term'', v_attribute_id, 1 - ); - - return 0; - -end;' language 'plpgsql'; - -select inline_0(); -drop function inline_0(); - -begin; -insert into wf_transition_assignment_map ( -workflow_key, transition_key, assign_transition_key -) values ( -'full_term_publish_process_wf', 'edit_definiton', 'add_illustration' -); - -insert into wf_context_transition_info ( -context_key, workflow_key, transition_key, estimated_minutes -) values ( -'default', 'full_term_publish_process_wf', 'author_definition', 60 -); - -insert into wf_context_transition_info ( -context_key, workflow_key, transition_key, estimated_minutes -) values ( -'default', 'full_term_publish_process_wf', 'edit_definiton', 20 -); - -insert into wf_context_transition_info ( -context_key, workflow_key, transition_key, estimated_minutes -) values ( -'default', 'full_term_publish_process_wf', 'add_illustration', 120 -); - -insert into wf_context_transition_info ( -context_key, workflow_key, transition_key, estimated_minutes -) values ( -'default', 'full_term_publish_process_wf', 'approve_new_term', 10 -); -end; - --- simple term submission process - -create table term_submission_process_cases ( - case_id integer primary key - constraint term_submission_proces_case_fk - references wf_cases on delete cascade -); - -select workflow__create_workflow( - 'term_submission_process_wf', - 'Term Submission Process', - 'Term Submission Processes', - 'User submits new term and its definition (and maybe illustration). Administrator approves or rejects submission.', - 'term_submission_process_cases', - 'case_id' - ); - -begin; - insert into wf_places ( - place_key, workflow_key, place_name, sort_order - ) values ( - 'start', 'term_submission_process_wf', 'Ready to Approve', 1 - ); - - insert into wf_places ( - place_key, workflow_key, place_name, sort_order - ) values ( - 'end', 'term_submission_process_wf', 'Process finished', 2 - ); - - insert into wf_transitions ( - transition_key, transition_name, workflow_key, sort_order, trigger_type - ) values ( - 'approve', 'Approve', 'term_submission_process_wf', 1, 'user' - ); - - insert into wf_arcs ( - workflow_key, transition_key, place_key, direction - ) values ( - 'term_submission_process_wf', 'approve', 'start', 'in' - ); - - insert into wf_arcs ( - workflow_key, transition_key, place_key, direction - ) values ( - 'term_submission_process_wf', 'approve', 'end', 'out' - ); - - insert into wf_context_transition_info ( - context_key, workflow_key, transition_key, estimated_minutes - ) values ( - 'default', 'term_submission_process_wf', 'approve', 10 - ); -end; - --- this is a special case inorder to maintain --- constraint integrity --- has the disadvantage, that is shows up on the workflow pages --- when it is really just a deadend --- oh well - -create table term_go_live_process_cases ( - case_id integer primary key - constraint term_go_live_proces_case_fk - references wf_cases on delete cascade -); - -select workflow__create_workflow( - 'term_go_live_wf', - 'Term Go Live Process', - 'Term Go Live Processes', - 'User submits new term and its definition (and maybe illustration) and it goes live immediately.', - 'term_go_live_process_cases', - 'case_id' - ); - +\i wf-full-term-publish-create.sql +\i wf-term-go-live.sql +\i wf-term-submission.sql \ No newline at end of file Index: openacs-4/packages/glossary/sql/postgresql/wf-full-term-publish-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/sql/postgresql/wf-full-term-publish-create.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/sql/postgresql/wf-full-term-publish-create.sql 19 Nov 2001 22:26:07 -0000 1.1 @@ -0,0 +1,575 @@ + +/* + * Business Process Definition: Full Term Publish Process (full_term_publish_process_wf) + * + * Auto-generated by ACS Workflow Export, version 4.3 + * + * Context: default + */ + + +/* + * Cases table + */ +create table full_term_publish_proces_cases ( + case_id integer primary key + references wf_cases on delete cascade +); + +/* + * Declare the object type + */ + + +create function inline_0 () returns integer as ' +begin + PERFORM workflow__create_workflow ( + ''full_term_publish_process_wf'', + ''Full Term Publish Process'', + ''Full Term Publish Processes'', + ''Fairly sophisticatd standard glossary term publishing. Publisher or Editor create a term. Author writes definition. Editor edits definition. Graphic designer adds and illustration. Editor or publisher approve or reject new term.'', + ''full_term_publish_proces_cases'', + ''case_id'' + ); + + return null; + +end;' language 'plpgsql'; + +select inline_0 (); +drop function inline_0 (); + + + + +/***** + * Places + *****/ + + + select workflow__add_place( + 'full_term_publish_process_wf', + 'start', + 'Ready to Author Definition.', + 1 + ); + + + + select workflow__add_place( + 'full_term_publish_process_wf', + 'before_edit_definiton', + 'Ready to Edit Definiton', + 2 + ); + + + + select workflow__add_place( + 'full_term_publish_process_wf', + 'before_add_illustration', + 'Ready to Add Illustration', + 3 + ); + + + + select workflow__add_place( + 'full_term_publish_process_wf', + 'before_approve_new_term', + 'Ready to Approve New Term', + 4 + ); + + + + select workflow__add_place( + 'full_term_publish_process_wf', + 'end', + 'Process finished', + 5 + ); + + +/***** + * Roles + *****/ + + + + select workflow__add_role ( + 'full_term_publish_process_wf', + 'add_illustration', + 'Add Illustration', + 3 + ); + + + + select workflow__add_role ( + 'full_term_publish_process_wf', + 'approve_new_term', + 'Approve New Term', + 4 + ); + + + + select workflow__add_role ( + 'full_term_publish_process_wf', + 'author_definition', + 'Author Definition.', + 1 + ); + + + + select workflow__add_role ( + 'full_term_publish_process_wf', + 'edit_definiton', + 'Edit Definiton', + 2 + ); + + + +/***** + * Transitions + *****/ + + + + select workflow__add_transition ( + 'full_term_publish_process_wf', + 'author_definition', + 'Author Definition.', + 'author_definition', + 1, + 'user' + ); + + + + select workflow__add_transition ( + 'full_term_publish_process_wf', + 'edit_definiton', + 'Edit Definiton', + 'edit_definiton', + 2, + 'user' + ); + + + + select workflow__add_transition ( + 'full_term_publish_process_wf', + 'add_illustration', + 'Add Illustration', + 'add_illustration', + 3, + 'user' + ); + + + + select workflow__add_transition ( + 'full_term_publish_process_wf', + 'approve_new_term', + 'Approve New Term', + 'approve_new_term', + 4, + 'user' + ); + + + +/***** + * Arcs + *****/ + + + + select workflow__add_arc ( + 'full_term_publish_process_wf', + 'add_illustration', + 'before_add_illustration', + 'in', + '', + '', + '' + ); + + + + select workflow__add_arc ( + 'full_term_publish_process_wf', + 'add_illustration', + 'before_approve_new_term', + 'out', + '', + '', + '' + ); + + + + select workflow__add_arc ( + 'full_term_publish_process_wf', + 'approve_new_term', + 'before_approve_new_term', + 'in', + '', + '', + '' + ); + + + + select workflow__add_arc ( + 'full_term_publish_process_wf', + 'approve_new_term', + 'before_edit_definiton', + 'out', + '#', + '', + 'Not Approved' + ); + + + + select workflow__add_arc ( + 'full_term_publish_process_wf', + 'approve_new_term', + 'end', + 'out', + 'wf_callback.guard_attribute_true', + 'approve_new_term_approved_p', + 'Approved' + ); + + + + select workflow__add_arc ( + 'full_term_publish_process_wf', + 'author_definition', + 'before_edit_definiton', + 'out', + '', + '', + '' + ); + + + + select workflow__add_arc ( + 'full_term_publish_process_wf', + 'author_definition', + 'start', + 'in', + '', + '', + '' + ); + + + + select workflow__add_arc ( + 'full_term_publish_process_wf', + 'edit_definiton', + 'before_add_illustration', + 'out', + 'wf_callback.guard_attribute_true', + 'edit_definiton_is_definition_correct_p', + 'Is definition correct' + ); + + + + select workflow__add_arc ( + 'full_term_publish_process_wf', + 'edit_definiton', + 'before_edit_definiton', + 'in', + '', + '', + '' + ); + + + + select workflow__add_arc ( + 'full_term_publish_process_wf', + 'edit_definiton', + 'start', + 'out', + '#', + '', + 'Not Is definition correct' + ); + + + +/***** + * Attributes + *****/ + + + + select workflow__create_attribute( + 'full_term_publish_process_wf', + 'approve_new_term_approved_p', + 'boolean', + 'Approved', + null, + null, + null, + 't', + 1, + 1, + null, + 'generic' + ); + + + + select workflow__add_trans_attribute_map( + 'full_term_publish_process_wf', + 'approve_new_term', + 'approve_new_term_approved_p', + 1 + ); + + + + select workflow__create_attribute( + 'full_term_publish_process_wf', + 'edit_definiton_is_definition_correct_p', + 'boolean', + 'Is definition correct', + null, + null, + null, + 't', + 1, + 1, + null, + 'generic' + ); + + + + select workflow__add_trans_attribute_map( + 'full_term_publish_process_wf', + 'edit_definiton', + 'edit_definiton_is_definition_correct_p', + 1 + ); + + +/***** + * Transition-role-assignment-map + *****/ + + + + select workflow__add_trans_role_assign_map( + 'full_term_publish_process_wf', + 'edit_definiton', + 'add_illustration' + ); + + + +/* + * Context/Transition info + * (for context = default) + */ + +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, + 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) +values +('default', + 'full_term_publish_process_wf', + 'add_illustration', + 120, + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + ''); + +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, + 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) +values +('default', + 'full_term_publish_process_wf', + 'approve_new_term', + 10, + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + ''); + +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, + 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) +values +('default', + 'full_term_publish_process_wf', + 'author_definition', + 60, + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + ''); + +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, + 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) +values +('default', + 'full_term_publish_process_wf', + 'edit_definiton', + 20, + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + ''); + + + +/* + * Context/Role info + * (for context = default) + */ + + + +/* + * Context Task Panels + * (for context = default) + */ + + +commit; Index: openacs-4/packages/glossary/sql/postgresql/wf-term-go-live.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/sql/postgresql/wf-term-go-live.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/sql/postgresql/wf-term-go-live.sql 19 Nov 2001 22:26:07 -0000 1.1 @@ -0,0 +1,98 @@ + +/* + * Business Process Definition: Term Go Live Process (term_go_live_wf) + * + * Auto-generated by ACS Workflow Export, version 4.3 + * + * Context: default + */ + + +/* + * Cases table + */ +create table term_go_live_process_cases ( + case_id integer primary key + references wf_cases on delete cascade +); + +/* + * Declare the object type + */ + + +create function inline_0 () returns integer as ' +begin + PERFORM workflow__create_workflow ( + ''term_go_live_wf'', + ''Term Go Live Process'', + ''Term Go Live Processes'', + ''User submits new term and its definition (and maybe illustration) and it goes live immediately.'', + ''term_go_live_process_cases'', + ''case_id'' + ); + + return null; + +end;' language 'plpgsql'; + +select inline_0 (); +drop function inline_0 (); + + + + +/***** + * Places + *****/ + +/***** + * Roles + *****/ + + + +/***** + * Transitions + *****/ + + + +/***** + * Arcs + *****/ + + + +/***** + * Attributes + *****/ + + +/***** + * Transition-role-assignment-map + *****/ + + + +/* + * Context/Transition info + * (for context = default) + */ + + + +/* + * Context/Role info + * (for context = default) + */ + + + +/* + * Context Task Panels + * (for context = default) + */ + + +commit; Index: openacs-4/packages/glossary/sql/postgresql/wf-term-submission.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossary/sql/postgresql/wf-term-submission.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/glossary/sql/postgresql/wf-term-submission.sql 19 Nov 2001 22:26:07 -0000 1.1 @@ -0,0 +1,203 @@ + +/* + * Business Process Definition: Term Submission Process (term_submission_process_wf) + * + * Auto-generated by ACS Workflow Export, version 4.3 + * + * Context: default + */ + + +/* + * Cases table + */ +create table term_submission_process_cases ( + case_id integer primary key + references wf_cases on delete cascade +); + +/* + * Declare the object type + */ + + +create function inline_0 () returns integer as ' +begin + PERFORM workflow__create_workflow ( + ''term_submission_process_wf'', + ''Term Submission Process'', + ''Term Submission Processes'', + ''User submits new term and its definition (and maybe illustration). Administrator approves or rejects submission.'', + ''term_submission_process_cases'', + ''case_id'' + ); + + return null; + +end;' language 'plpgsql'; + +select inline_0 (); +drop function inline_0 (); + + + + +/***** + * Places + *****/ + + + select workflow__add_place( + 'term_submission_process_wf', + 'start', + 'Ready to Approve', + 1 + ); + + + + select workflow__add_place( + 'term_submission_process_wf', + 'end', + 'Process finished', + 2 + ); + + +/***** + * Roles + *****/ + + + + select workflow__add_role ( + 'term_submission_process_wf', + 'approve', + 'Approve', + 1 + ); + + + +/***** + * Transitions + *****/ + + + + select workflow__add_transition ( + 'term_submission_process_wf', + 'approve', + 'Approve', + 'approve', + 1, + 'user' + ); + + + +/***** + * Arcs + *****/ + + + + select workflow__add_arc ( + 'term_submission_process_wf', + 'approve', + 'end', + 'out', + '', + '', + '' + ); + + + + select workflow__add_arc ( + 'term_submission_process_wf', + 'approve', + 'start', + 'in', + '', + '', + '' + ); + + + +/***** + * Attributes + *****/ + + +/***** + * Transition-role-assignment-map + *****/ + + + +/* + * Context/Transition info + * (for context = default) + */ + +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, + 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) +values +('default', + 'term_submission_process_wf', + 'approve', + 10, + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + ''); + + + +/* + * Context/Role info + * (for context = default) + */ + + + +/* + * Context Task Panels + * (for context = default) + */ + + +commit;