project BLF > class TApplication > method StartApplication

Description

This method should be used at the moment the application starts again. It takes care of running the housekeeping and starting the daemons that are specified in server.ini.


Parameters


ilPerformHousekeepinginputlogicalPerform the housekeeping prior to starting the rest.
ocMessageoutputcharacterMessage after processing
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method TApplication.ExecuteAction


program code (program1/tapplication.p)

/* ================================================================================ */
/* Logging                                                                          */
/* ================================================================================ */
<M-3 run GetLogFileLocation  (output vcLogFile (ocLogFile)) in TApplication>

output to value (vcLogFile) append.
put '':U  skip.
put unformatted string (now) '> ':U
    'TApplication.StartApplication: Start (PerformHousekeeping= ':U ilPerformHousekeeping ').' skip.
output close.

if ilPerformHousekeeping
then do :
    <M-4 run MainBlock  (input  no (ilRunOnline)) in Housekeeping>
    run gipr_DeleteProcedure in vhFcComponent.
    delete procedure vhFcComponent.
    /* pick up housekeeping output */
    file-info:file-name = session:temp-dir + "Housekeeping-errors.txt".
    if file-info:file-type begins "F"
    then do:
        copy-lob from file (session:temp-dir + "Housekeeping-errors.txt":U) to vpHouseKeeping.
        vcMessage = substring(vpHouseKeeping,1,20000,"CHARACTER").
        vcMessage = trim(vcMessage).
        if (vcMessage <> "" and vcMessage <> ?)
        then assign ocMessage = ocMessage + (if ocMessage = "" then "" else chr(10)) + vcMessage.
        os-delete value (session:temp-dir + "Housekeeping-errors.txt":U).
    end.
end.

/* Start the Daemons which need to be started */
assign vcMessage = ''.
<M-79 run StartDaemonAction
   (input  '':U (icDaemonName), 
    output vcMessage (ocMessage), 
    output viFcReturnSuper (oiReturnStatus)) in TApplication>

if vcMessage <> ''
then assign ocMessage = ocMessage + (if ocMessage = "" then "" else chr(10)) + vcMessage.

if viFcReturnSuper <> 0
then oiReturnStatus = viFcReturnSuper.

/* ================================================================================ */
/* Logging                                                                          */
/* ================================================================================ */
output to value (vcLogFile) append.
put unformatted string (now) '> ':U
    'TApplication.StartApplication: Ended (oiReturnStatus= ' oiReturnStatus ', ocMessage= ':U ocMessage ').' skip.
output close.