project BLF > class BBaseDaemon > method InitialValues

Description

Add code here to initialize the calculated fields of a 'new' record (= a record that must be created in the application database) in a class temp-table.


Parameters


icTableNameinputcharacterName of the database table of which a record is created in the class temp-table.
oiReturnStatusoutputinteger


Internal usage


unused


program code (program/bbasedaemon.p)

<ANCESTOR-CODE>

/* Assign defaults and fixed values for new records */
if icTableName = "fcDaemon":U
then do:
    <M-4 run GetEnvVars
       (output tfcDaemon.tcEnvRoot (ocEnvRoot), 
        output tfcDaemon.tcEnvAppServerURL (ocEnvAppServerURL), 
        output viFcReturnSuper (oiReturnStatus)) in BBaseDaemon>

    assign tfcDaemon.DaemonName                 = vcFcDaemonName
           tfcDaemon.DaemonStatus               = {&DAEMONSTATUS-INACTIVE}
           tfcDaemon.DaemonInterval             = 10
           tfcDaemon.DaemonLogFile              = "$ENVROOT/logs/" + vcFcDaemonName + ".log":U
           tfcDaemon.DaemonKeepProcessedOKItems = no
           tfcDaemon.DaemonNrOfRequestsInLoop   = 999999
           tfcDaemon.DaemonOsCommand            = {&DAEMONOSCOMMAND-CONSTANT}
           tfcDaemon.DaemonStartDirectory       = "$ENVROOT/daemons/" + vcFcDaemonName
           tfcDaemon.DaemonAppserver            = "$ENVAPPSERVERURL".

    <Q-1 run SystBySystAdminUser (all) (Read) (NoCache)  (output dataset tqSystBySystAdminUser) in BSystem >
    for each tqSystBySystAdminUser where
             tqSystBySystAdminUser.tcUsrLogin <> ? on error undo, throw:
        assign tfcDaemon.DaemonLogin    = tqSystBySystAdminUser.tcUsrLogin
               tfcDaemon.DaemonPassword = tqSystBySystAdminUser.tcSystAdminUserPwd.
    end.
end.