]project-open[ : @This Wiki
Portrait

Welcome, Unregistered Visitor

 ·  ·  ·  Contact ·  Index · Login · Register

Contents

Remote Training
Support
SaaS Service

5 registered users
 in last 24 hours

Assigning tasks to users or groups

WF tasks can be assigned to users or user groups.

The easiest way to assign a task to a group of users is by calling a pg/plsql function when a particular task is fired but hasn't been assigned yet:

Handle unsassigned tasks  

Other available pg/plsql routines for task assignments include:

  • Package: intranet-timesheet2-workflow :: im_workflow__assign_to_supervisor (with no custom argument)
    Assigns a task to the owners supervisor as managed in portlet "Employee Information" 
  • Package: intranet-workflow :: im_workflow__assign_to_user (user_id)
    Assigns a task to a particular user
  • im_workflow__assign_to_project_manager­
    Experimental: 
    create function im_workflow__assign_to_project_manager(int4,text) returns int4 as '
            declare
                    p_task_id               alias for $1;
                    p_custom_arg            alias for $2;
    
                    v_transition_key        varchar;
                    v_object_type           varchar;
                    v_case_id               integer;
                    v_object_id             integer;
                    v_creation_user         integer;
                    v_creation_ip           varchar;
                    v_project_manager_id    integer;
                    v_project_manager_name  varchar;
    
                    v_journal_id            integer;
                    v_workflow_key          varchar;
    
             begin
                    -- Get information about the transition and the 'environment'
                    select  tr.transition_key, t.case_id, c.object_id, o.creation_user, o.creation_ip, o.object_type
                    into    v_transition_key, v_case_id, v_object_id, v_creation_user, v_creation_ip, v_object_type
                    from    wf_tasks t, wf_cases c, wf_transitions tr, acs_objects o
                    where   t.task_id = p_task_id
                            and t.case_id = c.case_id
                            and o.object_id = t.case_id
                            and t.workflow_key = tr.workflow_key
                            and t.transition_key = tr.transition_key;
    
                    select attr_value into v_workflow_key from apm_parameter_values where parameter_id in
                            (select parameter_id from apm_parameters where package_key like 'intranet-timesheet2-workflow' and  parameter_name = 'DefaultWorkflowKey');
    
            	RAISE NOTICE 'im_workflow__assign_to_project_manager: Found workflow: %: ', v_workflow_key;
    
                    IF v_workflow_key = '' THEN
                            v_workflow_key := 'timesheet_approval_wf';
            	        RAISE NOTICE 'im_workflow__assign_to_project_manager: No parameter found, set workflow_key to: %: ', v_workflow_key;
                    END IF;
    
                    IF v_object_type = v_workflow_key THEN
                            select  project_lead_id into v_project_manager_id from im_projects
                            where   project_id in (select conf_project_id from im_timesheet_conf_objects where conf_id = v_object_id);
            		RAISE NOTICE 'im_workflow__assign_to_project_manager: Project Manager ID: %: ', v_project_manager_id;
                    ELSE
                            select  project_lead_id into v_project_manager_id from im_projects
                            where   project_id = v_object_id;
                    END IF;
                    select im_name_from_id(v_project_manager_id) into v_project_manager_name;
    
                    IF v_project_manager_id is not null THEN
                            v_journal_id := journal_entry__new(
                                null, v_case_id,
                                v_transition_key || ' assign_to_project_manager ' || v_project_manager_name,
                                v_transition_key || ' assign_to_project_manager ' || v_project_manager_name,
                                now(), v_creation_user, v_creation_ip,
                                'Assigning to user' || v_project_manager_name
                            );
                            PERFORM workflow_case__add_task_assignment(p_task_id, v_project_manager_id, 'f');
                            PERFORM workflow_case__notify_assignee (p_task_id, v_project_manager_id, null, null,
                                    'wf_' || v_object_type || '_assignment_notif');
                    END IF;
                    return 0;
            end;' language 'plpgsql';
    
    
    ­




Please take a moment to complete this form to help us improve our service.

Note:
Please only provide feedback in regards to content this page shows. For support inquiries please refer either to the Community Support forum at Sourceforge or check out our 'Professional Support'

Did this page help you to achieve your goal?

 Yes  No  Don't know

Please provide us with comments to improve this page:

How useful is the information?

 1  2  3  4  5
Not
useful
      Extremely
useful
 
  

Explore

Installers
Demo Server
Modules & Functionality
Packages
Business Processes supported
FAQ's

Help

Getting started
User Manuals
Configuration Manuals
Community Support
Professional Support

News

News
Twitter
RSS Community / Sourceforge
Register for Newsletter

Get in touch

Contact
Register



Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0 Generic License - Privacy Policy