project QadFinancials > class BHistoryDaemonProcessor > method PerformWorkItemDIRECTUpdFcDaemonQueue


Parameters


ihLocalHandleToThePersistenceinputhandle
iiDaemonQueueIDinputinteger
iiAvgProcesingTimeinputintegerAverage Procesing Time expressed in milliseconds
iiNbrQPostingLinesProcessedinputintegerNbrQPostingLinesProcessed
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BHistoryDaemonProcessor.PerformWorkItemDIRECT


program code (program1/bhistorydaemonprocessor.p)

/* =================================================================== */
/* This method updates the reference field of an existing daemon queue */
/* to show some processing information:                                */
/* PROCESSING INFO: Count=123, Avg(ms)=123                             */
/* =================================================================== */
/* Input is                                                            */
/*    iiDaemonQueueID                                                  */
/*    iiNbrRecordsProcessed                                            */
/*    iiAvgTimeProcessed (Average time in ms to process)               */
/* =================================================================== */
/* Indicate Direct db-access (find, update and create) is done here    */
<I-92 {WRITEDIRECTDBACCESS
     &WRITETABLENAMES = "'fcDaemonQueue'"}>


/* ========================================================== */
/* Get the fcDaemonQueue record                               */
/* When the record does not exist or is locked, we do nothing */
/* ========================================================== */
find fcDaemonQueue where
     fcDaemonQueue.DaemonQueueID = iiDaemonQueueID
     exclusive-lock no-error no-wait.
if not available (fcDaemonQueue)
then return.

/* ========================================================== */
/* Assign the data to the ref field again                     */
/* ========================================================== */
assign fcDaemonQueue.DaemonQueueRef = trim({&DAEMONQUEUEREFERENCE-MULTIPLE}) + " ":U + 
                                      trim({&DAEMONQUEUEREFERENCE-COUNT}) + "=":U + string (iiNbrQPostingLinesProcessed) + " ":U + 
                                      trim({&DAEMONQUEUEREFERENCE-AVERAGE}) + "=":U + string(iiAvgProcesingTime).

/* ======================== */
/* Release the used buffers */
/* ======================== */
release fcDaemonQueue.