DBA Data[Home] [Help]

PACKAGE BODY: APPS.CSM_SETUP_CONCURRENT

Source


1 PACKAGE BODY CSM_SETUP_CONCURRENT AS
2 /* $Header: csmdconb.pls 120.1 2005/07/22 04:23:36 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      request_id  NUMBER ;
47      phase       VARCHAR2(80) ;
48      status       VARCHAR2(80) ;
49      dev_phase       VARCHAR2(80) ;
50      dev_status       VARCHAR2(80) ;
51      message       VARCHAR2(255) ;
52      return_status  BOOLEAN := FALSE ;
53      TYPE concRec IS RECORD (applName varchar2 (30), concName varchar2(30), concUserName varchar2(255)) ;
54      TYPE concTab IS TABLE OF concRec INDEX BY BINARY_INTEGER;
55      concTable concTab ;
56    BEGIN
57      JTF_DIAGNOSTIC_ADAPTUTIL.setUpVars(reportClob);
58 
59          concTable(1).applName := 'ASG' ;
60          concTable(1).concName := 'ASG_USER_CONC' ;
61          concTable(1).concUserName := 'Manage Mobile Users' ;
62          concTable(2).applName := 'ASG' ;
63          concTable(2).concName := 'ASG_APPLY' ;
64          concTable(2).concUserName := 'Processes Uploaded Mobile Data' ;
65          concTable(3).applName := 'FND' ;
66          concTable(3).concName := 'FNDWFBG' ;
67          concTable(3).concUserName := 'Workflow Background Process' ;
68 --         concTable(1).applName := 'JTM' ;
69 --         concTable(1).concName := 'MOBILE_CON_PROGRAM' ;
70 --         concTable(1).concUserName := 'MOBILE_CON_PROGRAM' ;
71 
72 
73          FOR i IN 1..concTable.COUNT LOOP
74            request_id := null ;
75            return_status := fnd_concurrent.get_request_status(request_id, -- request_id
76                                                   concTable(i).applName, -- appl_shortname
77                                                   concTable(i).concName, -- program
78                                                   phase,
79                                                   status,
80                                                   dev_phase,
81                                                   dev_status,
82                                                   message) ;
83            IF (return_status) THEN
84                 reportStr := 'Concurrent program ' || concTable(i).concUserName || ' is scheduled with status ' || status || '.';
85                 JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport(reportClob,reportStr);
86                 if statusStr IS NULL or statusStr = 'SUCCESS' THEN
87                    statusStr := 'SUCCESS';
88                 end if ;
89            ELSE
90               statusStr := 'FAILURE';
91               errStr := errStr || 'Concurrent program ' || concTable(i).concUserName || ' is not scheduled. ';
92               fixInfo := 'Switch to mobile admin responsibility and schedule concurrent programs ' ;
93               isFatal := 'FALSE';
94            END IF;
95          END LOOP ;
96          report := JTF_DIAGNOSTIC_ADAPTUTIL.constructReport(statusStr,errStr,fixInfo,isFatal);
97          reportClob := JTF_DIAGNOSTIC_ADAPTUTIL.getReportClob ;
98    END runTest;
99 
100   ------------------------------------------------------------
101   -- procedure to report name back to framework
102   ------------------------------------------------------------
103   PROCEDURE getComponentName(str OUT NOCOPY VARCHAR2) IS
104   BEGIN
105     str := 'Concurrent Programs Status';
106   END getComponentName;
107 
108   ------------------------------------------------------------
109   -- procedure to report test description back to framework
110   ------------------------------------------------------------
111   PROCEDURE getTestDesc(str OUT NOCOPY VARCHAR2) IS
112   BEGIN
113     str := 'Concurrent Programs Scheduled or Not';
114   END getTestDesc;
115 
116   ------------------------------------------------------------
117   -- procedure to report test name back to framework
118   ------------------------------------------------------------
119   PROCEDURE getTestName(str OUT NOCOPY VARCHAR2) IS
120   BEGIN
121     str := 'Check Concurrent Programs';
122   END getTestName;
123 
124    -- Enter further code below as specified in the Package spec.
125 END;