The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT incident_number,
object_version_number,
incident_owner_id
FROM cs_incidents_all_b
WHERE incident_id = l_request_id;
SELECT 'RS_' || category
FROM jtf_rs_resource_extns
WHERE RESOURCE_ID = P_RESOURCE_ID;
SELECT assignee_id
FROM ieu_uwqm_items
WHERE workitem_obj_code = 'SR'
AND workitem_pk_id = l_request_id;
--dbms_output.put_line('Distribute SR, Calling Update SR_UWQ ');
CS_ServiceRequest_PVT.Update_Owner(
p_api_version => 2.0,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_false,
p_validation_level => fnd_api.g_valid_level_full,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_request_id => P_WS_INPUT_DATA(j).WORKITEM_PK_ID,
p_object_version_number => l_object_version_number,
--p_resp_id => NULL,
--p_resp_appl_id => P_WS_INPUT_DATA(j).APPLICATION_ID,
p_resp_id => fnd_global.resp_id,
p_resp_appl_id => fnd_global.resp_appl_id,
p_owner_id => P_RESOURCE_ID,
p_owner_group_id => P_WS_INPUT_DATA(j).OWNER_ID,
p_resource_type => l_resource_type,
p_last_updated_by => FND_GLOBAL.USER_ID,
p_last_update_login => NULL,
p_last_update_date => sysdate,
p_audit_comments => NULL,
p_called_by_workflow => fnd_api.g_false,
p_workflow_process_id => NULL,
p_comments => NULL,
p_public_comment_flag => fnd_api.g_false,
p_parent_interaction_id => NULL,
x_interaction_id => out_interaction_id);
-- An error return status from Update_WorkItem() API
-- is ignored by Update_Owner(), so we have to test that
-- the owner update was successful for the SR and the
-- Work Item.
OPEN sel_servereq_csr(P_WS_INPUT_DATA(j).WORKITEM_PK_ID);
(p_tasks_data(j).proc_type = 'UPDATE_TASK') OR
(p_tasks_data(j).proc_type = 'DELETE_TASK') THEN
--dbms_output.put_line('In SYNC SR Tasks, task_id ='||p_tasks_data(j).task_id);
-- Select the previous Group Owner
-- Check if this Individual is a member of the Previous Group
-- Set the UWQ Owner, assignee based on the these validation
IF l_orig_grpowner IS NOT NULL THEN
l_owner_id := l_orig_grpowner;
SELECT 'Y'
INTO l_wi_flag
FROM ieu_uwqm_items
WHERE workitem_obj_code = 'TASK'
AND workitem_pk_id = p_tasks_data(j).task_id;
IEU_WR_PUB.UPDATE_WR_ITEM(
p_api_version => 1.0,
p_init_msg_list => FND_API.G_TRUE,
p_commit => FND_API.G_FALSE,
p_workitem_obj_code => 'TASK',
p_workitem_pk_id => p_tasks_data(j).task_id,
p_title => p_tasks_data(j).task_name,
p_party_id => p_tasks_data(j).customer_id,
p_priority_code => l_priority_code,
p_due_date => l_due_date,
p_owner_id => l_owner_id,
p_owner_type => l_owner_type,
p_assignee_id => l_assignee_id,
p_assignee_type => l_assignee_type,
p_source_object_id => p_tasks_data(j).source_object_id,
p_source_object_type_code => p_tasks_data(j).source_object_type_code,
p_application_id => 170,
p_work_item_status => l_task_status,
p_user_id => FND_GLOBAL.USER_ID,
p_login_id => FND_GLOBAL.LOGIN_ID,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_return_status => l_return_status);
UPDATE IEU_UWQM_ITEMS_GTT A
SET A.APPLICATION_ID = 170
WHERE A.PROCESSING_SET_ID = P_PROCESSING_SET_ID;
UPDATE IEU_UWQM_ITEMS_GTT A
SET A.ASSIGNEE_ID = A.OWNER_ID
, A.ASSIGNEE_TYPE_ACTUAL = A.OWNER_TYPE_ACTUAL
WHERE PROCESSING_SET_ID = P_PROCESSING_SET_ID
AND A.OWNER_TYPE_ACTUAL NOT IN ('RS_GROUP', 'RS_TEAM');
UPDATE IEU_UWQM_ITEMS_GTT A
SET A.OWNER_ID = ''
, A.OWNER_TYPE_ACTUAL = ''
WHERE PROCESSING_SET_ID = P_PROCESSING_SET_ID
AND A.OWNER_TYPE_ACTUAL NOT IN ('RS_GROUP', 'RS_TEAM')
AND NOT EXISTS
( SELECT 1
FROM JTF_RS_GROUP_MEMBERS B
, IEU_UWQM_ITEMS C
WHERE B.RESOURCE_ID = A.OWNER_ID
AND B.GROUP_ID = C.OWNER_ID
AND A.WORKITEM_OBJ_CODE = 'TASK'
AND C.WORKITEM_PK_ID = A.WORKITEM_PK_ID
AND C.WORKITEM_OBJ_CODE = A.WORKITEM_OBJ_CODE
AND C.OWNER_TYPE = 'RS_GROUP'
AND C.OWNER_ID IS NOT NULL);
SELECT task_id,
object_version_number,
task_priority_id
FROM jtf_tasks_b
WHERE task_id = p_task_id;
SELECT 'RS_' || CATEGORY
FROM jtf_rs_resource_extns
WHERE RESOURCE_ID = p_resource_id;
select 'X' into l_group_id
from jtf_rs_group_members
where resource_id = p_resource_id
and group_id = l_grp_owner
and nvl(delete_flag, 'N') = 'N'
and rownum < 2;
-- source like SR-TASK. The object code should be selected from
-- ieu_uwqm_work_sources_b for parent work source
-- if p_ws_input_data(j).source_object_type_code = 'SR' then
l_source_object_code := p_ws_input_data(j).source_object_type_code;
select distribution_status_id, status_id
into l_distribution_status, l_status_id
from ieu_uwqm_items
where workitem_pk_id = l_source_object_id
and workitem_obj_code = l_source_object_code;
-- Update the SR Task Owner
-- The update to the SR Task work item will be handled by
-- rule function for the work source.
OPEN sel_tasks_csr(p_ws_input_data(j).workitem_pk_id);
JTF_TASKS_PVT.UPDATE_TASK(
p_api_version => 1.0,
p_commit => FND_API.G_TRUE,
p_object_version_number => sel_tasks_rec.object_version_number,
p_task_id => sel_tasks_rec.task_id,
--p_owner_type_code => 'RS_INDIVIDUAL',
p_owner_type_code => l_category,
p_owner_id => P_RESOURCE_ID,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);