text: 
  /*
   * Business Process Definition: Generic Ticket Workflow (ticket_generic_wf)
   *
   * Auto-generated by ACS Workflow Export, version 4.3
   *
   * Context: default
   */
  
  
  /*
   * Cases table
   */
  create table ticket_generic_wf_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 (
          ''ticket_generic_wf'', 
          ''Generic Ticket Workflow'', 
          ''Generic Ticket Workflow'', 
          ''Generic Ticket Workflow'', 
          ''ticket_generic_wf_cases'',
          ''case_id''
      );
  
      return null;
  
  end;' language 'plpgsql';
  
  select inline_0 ();
  drop function inline_0 ();
  
          
  
  
  /*****
   * Places
   *****/
  
  
      select workflow__add_place(
          'ticket_generic_wf',
          'start', 
          'Ready to Modify', 
          null
      );
  
          
  
      select workflow__add_place(
          'ticket_generic_wf',
          'before_quote', 
          'Ready to Quote', 
          null
      );
  
          
  
      select workflow__add_place(
          'ticket_generic_wf',
          'before_confirm_quote', 
          'Ready to Confirm Quote', 
          null
      );
  
          
  
      select workflow__add_place(
          'ticket_generic_wf',
          'before_assign', 
          'Ready to Assign', 
          null
      );
  
          
  
      select workflow__add_place(
          'ticket_generic_wf',
          'before_execute', 
          'Ready to Execute', 
          null
      );
  
          
  
      select workflow__add_place(
          'ticket_generic_wf',
          'before_signoff', 
          'Ready to Signoff', 
          null
      );
  
          
  
      select workflow__add_place(
          'ticket_generic_wf',
          'before_invoice', 
          'Ready to Invoice', 
          null
      );
  
          
  
      select workflow__add_place(
          'ticket_generic_wf',
          'end', 
          'Process finished', 
          null
      );
  
          
  /*****
   * Roles
   *****/
  
  
  
  	select workflow__add_role (
           'ticket_generic_wf',
           'modify',
           'Modify',
           1
      );
  
          
  
  	select workflow__add_role (
           'ticket_generic_wf',
           'quote',
           'Quote',
           2
      );
  
          
  
  	select workflow__add_role (
           'ticket_generic_wf',
           'confirm_quote',
           'Confirm Quote',
           3
      );
  
          
  
  	select workflow__add_role (
           'ticket_generic_wf',
           'assign',
           'Assign',
           4
      );
  
          
  
  	select workflow__add_role (
           'ticket_generic_wf',
           'execute',
           'Execute',
           5
      );
  
          
  
  	select workflow__add_role (
           'ticket_generic_wf',
           'signoff',
           'Signoff',
           6
      );
  
          
  
  	select workflow__add_role (
           'ticket_generic_wf',
           'invoice',
           'Invoice',
           7
      );
  
          
  
  /*****
   * Transitions
   *****/
  
  
  
  	select workflow__add_transition (
           'ticket_generic_wf',
           'modify',
           'Modify',
           'modify',
           1,
           'user'
  	);
  	
          
  
  	select workflow__add_transition (
           'ticket_generic_wf',
           'quote',
           'Quote',
           'quote',
           2,
           'user'
  	);
  	
          
  
  	select workflow__add_transition (
           'ticket_generic_wf',
           'confirm_quote',
           'Confirm Quote',
           'confirm_quote',
           3,
           'user'
  	);
  	
          
  
  	select workflow__add_transition (
           'ticket_generic_wf',
           'assign',
           'Assign',
           'assign',
           4,
           'user'
  	);
  	
          
  
  	select workflow__add_transition (
           'ticket_generic_wf',
           'execute',
           'Execute',
           'execute',
           5,
           'user'
  	);
  	
          
  
  	select workflow__add_transition (
           'ticket_generic_wf',
           'signoff',
           'Signoff',
           'signoff',
           6,
           'user'
  	);
  	
          
  
  	select workflow__add_transition (
           'ticket_generic_wf',
           'invoice',
           'Invoice',
           'invoice',
           7,
           'user'
  	);
  	
          
  
  /*****
   * Arcs
   *****/
  
  
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'assign',
           'before_execute',
           'out',
           '',
           '',
           ''
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'assign',
           'before_assign',
           'in',
           '',
           '',
           ''
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'confirm_quote',
           'before_assign',
           'out',
           'wf_callback__guard_attribute_true',
           'confirm_quote_accept_quote_p',
           'Accept Quote'
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'confirm_quote',
           'before_confirm_quote',
           'in',
           '',
           '',
           ''
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'confirm_quote',
           'before_quote',
           'out',
           '#',
           '',
           'Not Accept Quote'
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'execute',
           'before_execute',
           'in',
           '',
           '',
           ''
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'execute',
           'before_signoff',
           'out',
           '',
           '',
           ''
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'invoice',
           'end',
           'out',
           '',
           '',
           ''
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'invoice',
           'before_invoice',
           'in',
           '',
           '',
           ''
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'modify',
           'before_quote',
           'out',
           '',
           '',
           ''
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'modify',
           'start',
           'in',
           '',
           '',
           ''
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'quote',
           'before_confirm_quote',
           'out',
           '',
           '',
           ''
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'quote',
           'before_quote',
           'in',
           '',
           '',
           ''
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'signoff',
           'before_assign',
           'out',
           '#',
           '',
           'Not Sign-off OK'
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'signoff',
           'before_signoff',
           'in',
           '',
           '',
           ''
  	);
  
          
  
  	select workflow__add_arc (
           'ticket_generic_wf',
           'signoff',
           'before_invoice',
           'out',
           'wf_callback__guard_attribute_true',
           'signoff_signoff_ok_p',
           'Sign-off OK'
  	);
  
          
  
  /*****
   * Attributes
   *****/
  
  
  
      select workflow__create_attribute(
          'ticket_generic_wf',
          'confirm_quote_accept_quote_p',
          'boolean',
          'Accept Quote',
  	null,
  	null,
  	null,
          't',
  	1,
  	1,
  	null,
  	'generic'
      );
  
          
  
  	select workflow__add_trans_attribute_map(
          	'ticket_generic_wf', 
          	'confirm_quote',
          	'confirm_quote_accept_quote_p',
          	1
      );
  
          
  
      select workflow__create_attribute(
          'ticket_generic_wf',
          'signoff_signoff_ok_p',
          'boolean',
          'Sign-off OK',
  	null,
  	null,
  	null,
          't',
  	1,
  	1,
  	null,
  	'generic'
      );
  
          
  
  	select workflow__add_trans_attribute_map(
          	'ticket_generic_wf', 
          	'signoff',
          	'signoff_signoff_ok_p',
          	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',
   'ticket_generic_wf',
   'modify',
   5,
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '');
  
  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',
   'ticket_generic_wf',
   'quote',
   5,
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '');
  
  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',
   'ticket_generic_wf',
   'confirm_quote',
   5,
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '');
  
  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',
   'ticket_generic_wf',
   'assign',
   5,
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '');
  
  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',
   'ticket_generic_wf',
   'execute',
   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',
   'ticket_generic_wf',
   'signoff',
   5,
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '');
  
  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',
   'ticket_generic_wf',
   'invoice',
   5,
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '',
   '');
  
  
  
  /*
   * Context/Role info
   * (for context = default)
   */
  
  
  
  /*
   * Context Task Panels
   * (for context = default)
   */
  
  
  commit;
  
  