Allow deleting of unreferenced account groups.
[capital-apms-progress.git] / inc / method / m-sysmgr.i
blob05e59f77e02db9b21fc4fe5bef043154952b04ae
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
2 &ANALYZE-RESUME
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Method-Library
4 /*--------------------------------------------------------------------------
5 Library :
6 Purpose :
8 Syntax :
10 Description :
12 Author(s) :
13 Created :
14 Notes :
15 ------------------------------------------------------------------------*/
17 DEF VAR sec-mgr AS HANDLE NO-UNDO.
18 DEF VAR sys-mgr AS HANDLE NO-UNDO.
20 &IF DEFINED(UIB_Is_Running) NE 0 &THEN
21 DEF VAR uib-operational-mode AS LOGICAL INITIAL Yes NO-UNDO.
22 &ELSE
23 DEF VAR uib-operational-mode AS LOGICAL INITIAL No NO-UNDO.
24 &ENDIF
26 RUN get-sys-mgr.
28 &GLOBAL-DEFINE SYS-MGR
30 /* _UIB-CODE-BLOCK-END */
31 &ANALYZE-RESUME
34 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
36 /* ******************** Preprocessor Definitions ******************** */
40 /* _UIB-PREPROCESSOR-BLOCK-END */
41 &ANALYZE-RESUME
45 /* *********************** Procedure Settings ************************ */
47 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
48 /* Settings for THIS-PROCEDURE
49 Type: Method-Library
50 Allow:
51 Frames: 0
52 Add Fields to: Neither
53 Other Settings: INCLUDE-ONLY
55 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
57 /* ************************* Create Window ************************** */
59 &ANALYZE-SUSPEND _CREATE-WINDOW
60 /* DESIGN Window definition (used by the UIB)
61 CREATE WINDOW Method-Library ASSIGN
62 HEIGHT = .17
63 WIDTH = 37.86.
64 /* END WINDOW DEFINITION */
66 &ANALYZE-RESUME
70 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Method-Library
71 /* ************************* Included-Libraries *********************** */
73 /* _UIB-CODE-BLOCK-END */
74 &ANALYZE-RESUME
78 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Method-Library
81 /* *************************** Main Block *************************** */
83 /* _UIB-CODE-BLOCK-END */
84 &ANALYZE-RESUME
87 /* ********************** Internal Procedures *********************** */
89 &IF DEFINED(EXCLUDE-get-sys-mgr) = 0 &THEN
91 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-sys-mgr Method-Library
92 PROCEDURE get-sys-mgr :
93 /*------------------------------------------------------------------------------
94 Purpose:
95 ------------------------------------------------------------------------------*/
96 DEF VAR wh AS HANDLE NO-UNDO.
97 DEF VAR i AS INT NO-UNDO INITIAL 0.
99 wh = SESSION:FIRST-PROCEDURE.
100 sys-mgr = ?.
101 DO WHILE VALID-HANDLE(wh):
102 i = i + 1.
103 IF INDEX( wh:FILE-NAME, "uib" ) <> 0 THEN uib-operational-mode = Yes.
104 IF LOOKUP( 'apms-system-manager':U, wh:INTERNAL-ENTRIES ) > 0 THEN DO:
105 sys-mgr = wh.
106 LEAVE.
107 END.
108 wh = wh:NEXT-SIBLING.
109 END.
111 IF NOT VALID-HANDLE( sys-mgr ) THEN RUN start-sys-mgr.
113 sec-mgr = sys-mgr.
115 END PROCEDURE.
117 /* _UIB-CODE-BLOCK-END */
118 &ANALYZE-RESUME
120 &ENDIF
122 &IF DEFINED(EXCLUDE-start-sys-mgr) = 0 &THEN
124 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE start-sys-mgr Method-Library
125 PROCEDURE start-sys-mgr :
126 /*------------------------------------------------------------------------------
127 Purpose: Start the system manager.
128 Parameters: <none>
129 Notes:
130 ------------------------------------------------------------------------------*/
131 DEF VAR sys-mgr-name AS CHAR NO-UNDO.
133 IF VALID-HANDLE( sys-mgr ) THEN RETURN.
134 sys-mgr-name = SEARCH( "sysmgr.r" ).
135 IF sys-mgr-name = ? THEN sys-mgr-name = SEARCH( "sysmgr.w" ).
137 RUN VALUE( sys-mgr-name ) PERSISTENT SET sys-mgr.
138 IF uib-operational-mode THEN RUN dispatch IN sys-mgr( 'set-uib-modus-operandi':U ).
139 RUN dispatch IN sys-mgr( 'Initialize':U ).
141 sec-mgr = sys-mgr.
143 END PROCEDURE.
145 /* _UIB-CODE-BLOCK-END */
146 &ANALYZE-RESUME
148 &ENDIF