Index: openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.tcl 19 Nov 2001 18:25:09 -0000 1.5 +++ openacs-4/contrib/obsolete-packages/acs-workflow/tcl/workflow-procs.tcl 19 Nov 2001 22:10:36 -0000 1.6 @@ -1705,8 +1705,8 @@ [ad_decode $sort_order "" "null" $sort_order], '[db_quote $header]', '[db_quote $template_url]', -:overrides_action_p, -:only_display_when_started_p); + '[db_quote $overrides_action_p]', + '[db_quote $only_display_when_started_p]'); " } Index: openacs-4/contrib/obsolete-packages/ticket-tracker/sql/postgresql/ttracker-workflow-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/obsolete-packages/ticket-tracker/sql/postgresql/ttracker-workflow-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/obsolete-packages/ticket-tracker/sql/postgresql/ttracker-workflow-create.sql 9 Jul 2001 16:18:59 -0000 1.3 +++ openacs-4/contrib/obsolete-packages/ticket-tracker/sql/postgresql/ttracker-workflow-create.sql 19 Nov 2001 22:14:23 -0000 1.4 @@ -1,404 +1,624 @@ --- --- 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$ --- --- Ported to OpenACS - Vinod Kurup (vkurup@massmed.org) --- --- 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 + */ -select workflow__create_workflow( - 'ttracker_wf', -- workflow_key - 'Ticket Tracker Process', -- pretty_name - 'Ticket Tracker Process', -- pretty_plural - 'Workflow for processing a ticket in the ticket-tracker', -- description - 'wf_ttracker_cases', -- table_name - 'case_id' -- id_column -); - -- Creating places -select workflow__add_place ( - 'ttracker_wf', -- workflow_key - 'start', -- place_key - 'Needs to be resolved', -- place_name - 1 -- sort_order -); +create function inline_0 () returns integer as ' +begin + PERFORM workflow__create_workflow ( + ''ttracker_wf'', + ''Ticket Tracker Process'', + ''Ticket Tracker Process'', + ''Workflow for processing a ticket in the ticket-tracker'', + ''wf_ttracker_cases'', + ''case_id'' + ); -select workflow__add_place ( - 'ttracker_wf', -- workflow_key - 'to_be_clarified', -- place_key - 'Needs to be clarified', -- place_name - 2 -- sort_order -); + return null; -select workflow__add_place ( - 'ttracker_wf', -- workflow_key - 'to_be_verified', -- place_key - 'Needs to be verified', -- place_name - 3 -- sort_order -); +end;' language 'plpgsql'; -select workflow__add_place ( - 'ttracker_wf', -- workflow_key - 'end', -- place_key - 'Closed', -- place_name - 4 -- sort_order -); +select inline_0 (); +drop function inline_0 (); --- Creating transitions -select workflow__add_transition ( - 'ttracker_wf', -- workflow_key - 'resolve', -- transition_key - 'Resolve ticket', -- transition_name - 1, -- sort_order - 'user' -- trigger_type -); + -select workflow__add_transition ( - 'ttracker_wf', -- workflow_key - 'clarify', -- transition_key - 'Clarify ticket description', -- transition_name - 2, -- sort_order - 'user' -- trigger_type -); -select workflow__add_transition ( - 'ttracker_wf', -- workflow_key - 'verify', -- transition_key - 'Verify result', -- transition_name - 3, -- sort_order - 'user' -- trigger_type -); +/***** + * Places + *****/ --- creating arcs + select workflow__add_place( + 'ttracker_wf', + 'start', + 'Needs to be resolved', + 1 + ); --- resolve --- in -select workflow__add_arc ( - 'ttracker_wf', -- workflow_key - 'resolve', -- transition_key - 'start', -- place_key - 'in', -- direction - null, -- guard_callback - null, -- guard_custom_arg - null -- guard_description -); + --- out -select workflow__add_arc ( - 'ttracker_wf', -- workflow_key - 'resolve', -- transition_key - 'to_be_clarified', -- place_key - 'out', -- direction - 'wf_callback__guard_attribute_true', -- guard_callback - 'need_clarification', -- guard_custom_arg - 'Description needs clarification' -- guard_description -); + select workflow__add_place( + 'ttracker_wf', + 'to_be_clarified', + 'Needs to be clarified', + 2 + ); -select workflow__add_arc ( - 'ttracker_wf', -- workflow_key - 'resolve', -- transition_key - 'to_be_verified', -- place_key - 'out', -- direction - '#', -- guard_callback - null, -- guard_custom_arg - 'Description clear; issue resolved' -- guard_description -); - --- verify --- in -select workflow__add_arc ( - 'ttracker_wf', -- workflow_key - 'verify', -- transition_key - 'to_be_verified', -- place_key - 'in', -- direction - null, -- guard_callback - null, -- guard_custom_arg - null -- guard_description -); + --- out -select workflow__add_arc ( - 'ttracker_wf', -- workflow_key - 'verify', -- transition_key - 'end', -- place_key - 'out', -- direction - 'wf_callback__guard_attribute_true', -- guard_callback - 'verified', -- guard_custom_arg - 'Result okay' -- guard_description -); + select workflow__add_place( + 'ttracker_wf', + 'to_be_verified', + 'Needs to be verified', + 3 + ); -select workflow__add_arc ( - 'ttracker_wf', -- workflow_key - 'verify', -- transition_key - 'start', -- place_key - 'out', -- direction - '#', -- guard_callback - null, -- guard_custom_arg - 'Result not okay' -- guard_description -); + --- clarify --- in -select workflow__add_arc ( - 'ttracker_wf', -- workflow_key - 'clarify', -- transition_key - 'to_be_clarified', -- place_key - 'in', -- direction - null, -- guard_callback - null, -- guard_custom_arg - null -- guard_description -); + select workflow__add_place( + 'ttracker_wf', + 'end', + 'Closed', + 4 + ); --- out -select workflow__add_arc ( - 'ttracker_wf', -- workflow_key - 'clarify', -- transition_key - 'start', -- place_key - 'out', -- direction - null, -- guard_callback - null, -- guard_custom_arg - null -- guard_description -); + +/***** + * Roles + *****/ -create function inline_0 () -returns integer as ' -declare - v_attribute_id acs_attributes.attribute_id%TYPE; -begin - select workflow__create_attribute( - ''ttracker_wf'', -- workflow_key - ''need_clarification'', -- attribute_name - ''boolean'', -- datatype - ''Description needs clarification'', -- pretty_name - null, -- pretty_plural - null, -- table_name - null, -- column_name - ''f'', -- default_value - 1, -- min_n_values - 1, -- max_n_values - null, -- sort_order - ''generic'', -- storage - ''none'' -- wf_datatype - ) into v_attribute_id; - insert into wf_transition_attribute_map - (workflow_key, transition_key, attribute_id, sort_order) - values - (''ttracker_wf'', ''resolve'', v_attribute_id, 1); + select workflow__add_role ( + 'ttracker_wf', + 'clarify', + 'Clarify ticket description', + 2 + ); - return 0; -end;' language 'plpgsql'; + -select inline_0 (); + select workflow__add_role ( + 'ttracker_wf', + 'resolve', + 'Resolve ticket', + 1 + ); -drop function inline_0 (); + + select workflow__add_role ( + 'ttracker_wf', + 'verify', + 'Verify result', + 3 + ); -create function inline_1 () -returns integer as ' -declare - v_attribute_id acs_attributes.attribute_id%TYPE; -begin - select workflow__create_attribute( - ''ttracker_wf'', -- workflow_key - ''verified'', -- attribute_name - ''boolean'', -- datatype - ''Result is okay'', -- pretty_name - null, -- pretty_plural - null, -- table_name - null, -- column_name - ''t'', -- default_value - 1, -- min_n_values - 1, -- max_n_values - null, -- sort_order - ''generic'', -- storage - ''none'' -- wf_datatype - ) into v_attribute_id; + - insert into wf_transition_attribute_map - (workflow_key, transition_key, attribute_id, sort_order) - values - (''ttracker_wf'', ''verify'', v_attribute_id, 1); +/***** + * Transitions + *****/ + + + + select workflow__add_transition ( + 'ttracker_wf', + 'resolve', + 'Resolve ticket', + 'resolve', + 1, + 'user' + ); - return 0; -end;' language 'plpgsql'; + -select inline_1 (); + select workflow__add_transition ( + 'ttracker_wf', + 'clarify', + 'Clarify ticket description', + 'clarify', + 2, + 'user' + ); + + -drop function inline_1 (); + select workflow__add_transition ( + 'ttracker_wf', + 'verify', + 'Verify result', + 'verify', + 3, + 'user' + ); + + -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_to_assignee', - 'ttracker_callback__resolve_fire', - 'ttracker_callback__notification', - 'Resolve Ticket', - 'ttracker_callback__notify_admin', - 'admin' -); +/***** + * Arcs + *****/ -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_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_to_submitter', - 'ttracker_callback__notification', - 'Verify Result', - 'admin' -); + select workflow__add_arc ( + 'ttracker_wf', + 'clarify', + 'start', + 'out', + '', + '', + '' + ); -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_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' -); + select workflow__add_arc ( + 'ttracker_wf', + 'clarify', + 'to_be_clarified', + 'in', + '', + '', + '' + ); -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' -); + select workflow__add_arc ( + 'ttracker_wf', + 'resolve', + 'start', + 'in', + '', + '', + '' + ); -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' -); + -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' -); - + select workflow__add_arc ( + 'ttracker_wf', + 'resolve', + 'to_be_clarified', + 'out', + 'wf_callback__guard_attribute_true', + 'need_clarification', + 'Description needs clarification' + ); + + + + select workflow__add_arc ( + 'ttracker_wf', + 'resolve', + 'to_be_verified', + 'out', + '#', + '', + 'Description clear; issue resolved' + ); + + + + select workflow__add_arc ( + 'ttracker_wf', + 'verify', + 'end', + 'out', + 'wf_callback__guard_attribute_true', + 'verified', + 'Result okay' + ); + + + + select workflow__add_arc ( + 'ttracker_wf', + 'verify', + 'start', + 'out', + '#', + '', + 'Result not okay' + ); + + + + select workflow__add_arc ( + 'ttracker_wf', + 'verify', + 'to_be_verified', + 'in', + '', + '', + '' + ); + + + +/***** + * Attributes + *****/ + + + + select workflow__create_attribute( + 'ttracker_wf', + 'verified', + 'boolean', + 'Result is okay', + null, + null, + null, + 't', + 1, + 1, + null, + 'generic' + ); + + + + select workflow__add_trans_attribute_map( + 'ttracker_wf', + 'verify', + 'verified', + 1 + ); + + + + select workflow__create_attribute( + 'ttracker_wf', + 'need_clarification', + 'boolean', + 'Description needs clarification', + null, + null, + null, + 'f', + 1, + 1, + null, + 'generic' + ); + + + + select workflow__add_trans_attribute_map( + 'ttracker_wf', + 'resolve', + 'need_clarification', + 1 + ); + + +/***** + * 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', + 'ttracker_wf', + 'clarify', + null, + '', + '', + 'ttracker_callback__clarify_fire', + '', + '', + '', + '', + '', + '', + '', + '', + 'ttracker_callback__notification', + 'Clarify Description', + '', + '', + 'admin'); + +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', + '', + 'admin'); + +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', + '', + '', + 'admin'); + + + +/* + * Context/Role info + * (for context = default) + */ + +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_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_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_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', + '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', + 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;