DBA Data[Home] [Help]

PACKAGE BODY: APPS.CSM_SETUP_RESPONSIBILITY

Source


1 PACKAGE BODY CSM_SETUP_RESPONSIBILITY AS
2 /* $Header: csmdresb.pls 120.3 2006/01/09 05:04:49 trajasek noship $ */
3 --
4 -- To modify this template, edit file PKGBODY.TXT in TEMPLATE
5 -- directory of SQL Navigator
6 --
7 -- Purpose: Briefly explain the functionality of the package body
8 --
9 -- MODIFICATION HISTORY
10 -- Person      Date    Comments
11 -- ---------   ------  ------------------------------------------
12    -- Enter procedure, function bodies as shown below
13 
14   ------------------------------------------------------------
15   -- procedure to initialize test datastructures
16   -- executeds prior to test run (not currently being called)
17   ------------------------------------------------------------
18   PROCEDURE init IS
19   BEGIN
20    -- test writer could insert special setup code here
21    null;
22   END init;
23 
24   ------------------------------------------------------------
25   -- procedure to cleanup any  test datastructures that were setup in the init
26   --  procedure call executes after test run (not currently being called)
27   ------------------------------------------------------------
28   PROCEDURE cleanup IS
29   BEGIN
30    -- test writer could insert special cleanup code here
31    NULL;
32   END cleanup;
33 
34   ------------------------------------------------------------
35   -- procedure to execute the PLSQL test
36   -- the inputs needed for the test are passed in and a report object and CLOB are -- returned.
37   ------------------------------------------------------------
38   PROCEDURE runtest(inputs IN  JTF_DIAG_INPUTTBL,
39                             report OUT NOCOPY JTF_DIAG_REPORT,
40                             reportClob OUT NOCOPY CLOB) IS
41      reportStr   LONG;
42      statusStr   VARCHAR2(50);  -- SUCCESS or FAILURE
43      errStr      VARCHAR2(4000);
44      fixInfo     VARCHAR2(4000);
45      isFatal     VARCHAR2(50);  -- TRUE or FALSE
46      responsibilityExists VARCHAR2(1) ;
47    BEGIN
48      JTF_DIAGNOSTIC_ADAPTUTIL.setUpVars(reportClob);
49      begin
50        select 'Y'
51          into responsibilityExists
52          from fnd_responsibility
53         where application_id = 883 -- 'CSM'
54           and responsibility_key = 'OMFS_PALM'
55 	  and sysdate between start_date and nvl(end_date, sysdate) ;
56      exception
57        WHEN NO_DATA_FOUND THEN
58             responsibilityExists := 'N' ;
59      end ;
60      IF (responsibilityExists = 'Y') THEN
61          reportStr := 'Oracle Mobile Field Service responsibility exists.' ;
62          JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport(reportClob,reportStr);
63          statusStr := 'SUCCESS';
64      ELSE
65               statusStr := 'FAILURE';
66               errStr := 'Oracle Mobile Field Service responsibility does not exist. ';
67               fixInfo := 'Apply latest patch then contact support (if needed).' ;
68               isFatal := 'FALSE';
69       END IF;
70       report := JTF_DIAGNOSTIC_ADAPTUTIL.constructReport(statusStr,errStr,fixInfo,isFatal);
71       reportClob := JTF_DIAGNOSTIC_ADAPTUTIL.getReportClob ;
72    END runTest;
73 
74   ------------------------------------------------------------
75   -- procedure to report name back to framework
76   ------------------------------------------------------------
77   PROCEDURE getComponentName(str OUT NOCOPY VARCHAR2) IS
78   BEGIN
79     str := 'Responsibility Status';
80   END getComponentName;
81 
82   ------------------------------------------------------------
83   -- procedure to report test description back to framework
84   ------------------------------------------------------------
85   PROCEDURE getTestDesc(str OUT NOCOPY VARCHAR2) IS
86   BEGIN
87     str := 'Responsibility Exists or not';
88   END getTestDesc;
89 
90   ------------------------------------------------------------
91   -- procedure to report test name back to framework
92   ------------------------------------------------------------
93   PROCEDURE getTestName(str OUT NOCOPY VARCHAR2) IS
94   BEGIN
95     str := 'Check responsibility';
96   END getTestName;
97 
98    -- Enter further code below as specified in the Package spec.
99 END;