project QadFinancials > class BReplicaDaemon > method ValMaxNumberOfInstances

validation procedure

Description

Maximum one instance of the daemon allowed.


Parameters


iiTargetFieldinputintegerValue of the business field to validate.
icTargetFieldNameinputcharacterName of the business field to validate.
icRowidinputcharacterContents of field tc_Rowid, if the target field is a field of a component temp-table.
icDaemonNameinputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
validation on tfcDaemon.DaemonMaxNumberOfInstances


program code (program4/breplicadaemon.p)

if icDaemonName = {&REPLICATIONDAEMON} and iiTargetField > 1
then do:
    assign vcMessage      = trim(#T-2'You can only run one Replication daemon process.':255(69458)t-2#)
           oiReturnStatus = -1.
    <M-1 run SetMessage
       (input  vcMessage (icMessage), 
        input  '':U (icArguments), 
        input  icTargetFieldName (icFieldName), 
        input  string(iiTargetField) (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  icRowid (icRowid), 
        input  'QadFin-8102':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BReplicaDaemon>
end. /* if icDaemonName = {&REPLICATIONDAEMON} and integer(icTargetField) > 1 */