DBA Data[Home] [Help]

APPS.CS_WF_EVENT_PKG SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 10

    oracle.apps.cs.sr.ServiceRequest.updated .
    These subscriptions executes the old BES converted seeded workflow CALL
    SUPPORT, as well as any client custom BES workflows. Also, these subscriptions
    are executed Synchronously, the same as the old seeded workflows. This is
    important since the calling wrapper API needs to update the workflow_process_id
    if the workflow was launched.

    If this custom rule function is not able to launch the workflow process
    because the proces is not BES compatible, then the CS event wrapper API
    Raise_ServiceRequest_Event() will try to launch the workflow process using
    the old non-BES workflow API calls, i.e., CreateProcess(), StartProcess() .
    This provides backward compatibility for those clients who has custom
    workflow processes but has not converted to BES.

  ***************************************************************************************/

  FUNCTION CS_Custom_Rule_Func (p_subscription_guid in raw,
                                     p_event in out nocopy WF_EVENT_T) return varchar2 is

    l_event_name 	VARCHAR2(240) := p_event.getEventName( );
Line: 40

      SELECT nvl(status.close_flag,'N') close_flag,
                inc.workflow_process_id,
                cit.AUTOLAUNCH_WORKFLOW_FLAG,
                cit.WORKFLOW,
                inc.resource_type,
                inc.incident_owner_id,
                inc.incident_id,
                inc.object_version_number
      FROM   cs_incident_statuses status,
             cs_incidents_all_b inc,
             cs_incident_types cit
      WHERE  inc.incident_number = l_request_number
             AND inc.incident_status_id = status.incident_status_id
             and cit.incident_type_id = inc.incident_type_id;
Line: 58

      SELECT end_date
      FROM   wf_items
      WHERE  item_type = 'SERVEREQ'
      AND    item_key  like l_request_number||'-%'
      AND    item_key NOT like l_request_number||'%EVT'
      AND end_date IS NULL;
Line: 74

      select wfa.name
      from WF_ACTIVITIES wfa
      where wfa.item_type = 'SERVEREQ'
            and  wfa.type ='EVENT'
            and wfa.name = l_wf_proc_activity_name;
Line: 83

      select wfpa.ACTIVITY_NAME
      from wf_process_activities wfpa
      where wfpa.PROCESS_ITEM_TYPE = 'SERVEREQ'
            and wfpa.PROCESS_NAME = l_process_name
            and wfpa.START_END = 'START'
      ORDER BY wfpa.process_version DESC;
Line: 228

    WHEN l_UPDATE_FAILED THEN
      IF sel_workflow_csr%ISOPEN THEN
	CLOSE sel_workflow_csr;
Line: 294

        p_USER_ID               IN NUMBER  DEFAULT FND_GLOBAL.USER_ID, -- p_last_updated_by from Update_ServiceREquest()
        p_RESP_ID               IN NUMBER,      -- p_resp_id from Update_ServiceREquest()
        p_RESP_APPL_ID          IN NUMBER,      -- p_resp_appl_id from Update_ServiceREquest()
        p_Old_SR_Rec            IN CS_ServiceRequest_PVT.service_request_rec_type,
        p_New_SR_Rec            IN CS_ServiceRequest_PVT.service_request_rec_type,
        p_Contacts_Table        IN CS_ServiceRequest_PVT.contacts_table,
        p_Link_Rec              IN CS_INCIDENTLINKS_PVT.CS_INCIDENT_LINK_REC_TYPE,
        p_wf_process_id         IN NUMBER, -- from Update_ServiceRequest() parameter list, important
					   -- to pass this to prevent unwanted recursive calls
	p_owner_id		IN NUMBER, -- passed by CIC
	p_wf_manual_launch	IN VARCHAR2 , -- flag for event raised from UI launch_wf().
					      -- p_Event_Code for manually launched workflow
					      -- should always be UPDATE_SERVICE_REQUEST
        x_wf_process_id         OUT NOCOPY NUMBER,
        x_return_status         OUT NOCOPY VARCHAR2,
        x_msg_count             OUT NOCOPY NUMBER,
        x_msg_data              OUT NOCOPY VARCHAR2) IS

    l_dummy             	VARCHAR2(240);
Line: 368

	 SELECT P.PARTY_NAME
	 FROM HZ_PARTIES P,
	 CS_HZ_SR_CONTACT_POINTS C
	 WHERE P.PARTY_ID = l_contact_party_id AND C.CONTACT_TYPE <> 'EMPLOYEE' AND C.PARTY_ID= P.PARTY_ID
	 UNION
	 SELECT P.FULL_NAME
	 FROM PER_ALL_PEOPLE_F P
	 WHERE P.PERSON_ID = l_contact_party_id AND TRUNC(SYSDATE) BETWEEN TRUNC(NVL(P.EFFECTIVE_START_DATE, SYSDATE))
	 AND TRUNC(NVL(P.EFFECTIVE_END_DATE, SYSDATE))
	 AND EXISTS (SELECT 1
	 FROM CS_HZ_SR_CONTACT_POINTS C
	 WHERE C.CONTACT_TYPE = 'EMPLOYEE'
	 AND C.PARTY_ID = P.PERSON_ID) ;
Line: 385

       SELECT p.PARTY_NAME
       FROM HZ_PARTIES p, cs_hz_sr_contact_points c
       WHERE p.PARTY_ID = c.party_id and
             c.contact_type <> 'EMPLOYEE' and c.party_id=l_contact_party_id
       UNION
       select p.full_name
       from per_all_people_f p, cs_hz_sr_contact_points c
       where p.person_id = c.party_id
       and TRUNC(SYSDATE) BETWEEN TRUNC(NVL(p.effective_start_date, SYSDATE))
       and TRUNC(NVL(p.effective_end_date, SYSDATE))
       and c.contact_type = 'EMPLOYEE' and c.party_id=l_contact_party_id;
Line: 404

        SELECT nvl(status.close_flag,'N') close_flag,
		inc.workflow_process_id,
		cit.AUTOLAUNCH_WORKFLOW_FLAG,
		cit.WORKFLOW,
		inc.resource_type,
		inc.incident_owner_id,
		inc.incident_id,
		inc.object_version_number
        FROM   cs_incident_statuses status,
		cs_incidents_all_b inc,
		cs_incident_types cit
        WHERE  inc.incident_number = p_Incident_Number
               AND inc.incident_status_id = status.incident_status_id
	       and cit.incident_type_id = inc.incident_type_id;
Line: 432

      select emp.source_id , emp.resource_name
      from jtf_rs_resource_extns_vl emp
      where emp.resource_id = p_resource_id;
Line: 443

     to the update_servicerequest() api. This prevents another
     seeded workflow from launching by looking if one is already
     running.
    **/

    CURSOR l_servereq_csr IS
      SELECT end_date,item_key
      FROM   wf_items
      WHERE  item_type = 'SERVEREQ'
      AND    item_key  like p_Incident_Number||'-%'
      AND    item_key NOT like p_Incident_Number||'%EVT'
      AND end_date IS NULL;
Line: 459

      SELECT display_name,expiration_date
      FROM wf_local_roles
      WHERE name = c_role_name;
Line: 467

      SELECT name
        FROM cs_party_roles_vl
       WHERE party_role_code = p_party_role_code;
Line: 479

   SELECT  csat.INCIDENT_STATUS_ID
	--INTO    l_status_id
	FROM    CS_SR_ACTION_TRIGGERS csat,
		CS_SR_ACTION_DETAILS csad,
		CS_SR_EVENT_CODES_B cec
        WHERE
		  cec.WF_BUSINESS_EVENT_ID = 'oracle.apps.cs.sr.ServiceRequest.statuschanged'
		  and csat.EVENT_CODE = cec.EVENT_CODE
		  and TRUNC(SYSDATE) BETWEEN TRUNC(NVL(csat.start_date_active, SYSDATE))
		  and TRUNC(NVL(csat.end_date_active, SYSDATE))
		  and csad.event_condition_id = csat.event_condition_id
		  and TRUNC(SYSDATE) BETWEEN TRUNC(NVL(csad.start_date_active, SYSDATE))
		  and TRUNC(NVL(csad.end_date_active, SYSDATE))
	          and csat.from_to_status_code IS not NULL
	          and csad.resolution_code IS  NULL
		  and csat.incident_status_id IS NOT NULL
		  and csat.incident_status_id = (select incident_status_id from cs_incidents_all_b
						   where incident_number = p_incident_number)
		  and csad.action_code like 'NOTIFY%';
Line: 529

        CS_WF_AUTO_NTFY_UPDATE_PKG.get_fnd_user_role
             ( p_fnd_user_id        => p_USER_ID,
               x_role_name          => l_initiator_role,
               x_role_display_name  => l_dummy );
Line: 654

        SELECT name
	INTO l_old_request_status
	FROM cs_incident_statuses_vl
	WHERE INCIDENT_STATUS_ID = p_Old_SR_Rec.STATUS_ID;
Line: 707

        SELECT name
	INTO l_link_type_name
        FROM CS_SR_LINK_TYPES_VL
        WHERE link_type_id = p_Link_Rec.LINK_TYPE_ID;
Line: 862

      IF (p_Event_Code = 'UPDATE_SERVICE_REQUEST') THEN

        /* Roopa - begin
          Fix for bug # 2809232
        */
        wf_event.AddParameterToList(p_name => 'PREV_TYPE_ID',
			      p_value => p_Old_SR_Rec.type_id,
			      p_parameterlist => l_param_list);
Line: 898

          SELECT cs_wf_process_id_s.nextval
          INTO l_event_id
          FROM dual;
Line: 947

          SELECT cs_wf_process_id_s.nextval
          INTO l_event_id
          FROM dual;
Line: 972

           from the SR api we need to interpret the update condition and raise this
           event accordingly. inserting the following if .
           Roopa - end
        ***********************************************/

   	IF (l_new_contact_point_name IS NOT NULL) THEN

          SELECT cs_wf_process_id_s.nextval
          INTO l_event_id
          FROM dual;
Line: 996

          SELECT cs_wf_process_id_s.nextval
          INTO l_event_id
          FROM dual;
Line: 1010

        l_business_event := 'oracle.apps.cs.sr.ServiceRequest.updated';
Line: 1031

      ELSIF (p_Event_Code = 'RELATIONSHIP_DELETE_FOR_SR') THEN

    	IF (p_Link_Rec.LINK_TYPE_ID IS NOT NULL) THEN
/* Roopa - Fix for bug 3528510 */
/* The following 2 parameters are added to the payload so that
   the business event wf will catch the non-SR -> SR link scenario
*/
        wf_event.AddParameterToList(p_name => 'LINK_SUBJECT_TYPE',
                              p_value => p_link_rec.subject_type,
                              p_parameterlist => l_param_list);
Line: 1044

              l_business_event := 'oracle.apps.cs.sr.ServiceRequest.relationshipdeleted';
Line: 1051

                          we need to interpret the update condition and raise this
                          event accordingly. Commenting out the following elsif
      Roopa - end*/

      --  ELSIF (p_Event_Code = 'ADD_NEW_CONTACT_TO_SR') THEN
      --    IF (l_new_contact_point_name IS NOT NULL) THEN
      --              l_business_event :=  'oracle.apps.cs.sr.ServiceRequest.newcontactadded';
Line: 1072

      SELECT cs_wf_process_id_s.nextval
      INTO l_event_id
      FROM dual;
Line: 1090

      l_param_list.DELETE;
Line: 1113

      IF (p_Event_Code = 'CREATE_SERVICE_REQUEST' OR p_Event_Code = 'UPDATE_SERVICE_REQUEST') THEN

	OPEN l_sel_request_csr;
Line: 1122

	  -- update SR table with the workflow process ID used in the event.
          -- If not (workflow process may not be BES converted), try to launch
	  -- the workflow using the old workflow APIs.



          OPEN l_servereq_csr;
Line: 1141

              It was decided that Update_ServiceRequest API need not be called
              just to update the workflow process id of the SR that too with full validation on.
              An explicit update should suffice. Hence commenting out the following code and
              replacing it with an explicit update statement
            */
            l_pos := INSTR(l_itemkey, '-',-1,1); -- Bug#4007088
Line: 1152

            UPDATE CS_INCIDENTS_ALL_B set WORKFLOW_PROCESS_ID = x_wf_process_id
            WHERE INCIDENT_ID = l_sel_request_rec.incident_id;
Line: 1230

				-- Update/Create SR api, or any other API. This is only
				-- set to 'Y' when called from the tools menu of the SR UI.
				--
				p_wf_manual_launch	=> 'N',
			        p_workflow_process_id	=> out_wf_process_id,
			        x_msg_count		=> l_msg_count,
                	        x_msg_data		=> l_msg_data);
Line: 1283

      END IF; -- IF (p_Event_Code='CREATE_SERVICE_REQUEST' OR 'UPDATE_SERVICE_REQUEST')
Line: 1285

      l_param_list.DELETE;
Line: 1369

  SELECT employee_id INTO l_employee_id
    FROM fnd_user
    WHERE user_id = p_fnd_user_id;