project BLF > class BScanDaemon > method DefaultComponentLabel

Description

Returnes the component label for a given component code.


Parameters


icRowIdinputcharacter
icComponentCodeinputcharacter
ocComponentLabeloutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program1/bscandaemon.p)

if icRowId = '' or icRowId = ?
then return.

find first bScanDaemonLocation where
           bScanDaemonLocation.tc_Rowid = icRowId no-error.

if not available bScanDaemonLocation
then return.

if icComponentCode = '' or icComponentCode = ?
then do: 
    assign bScanDaemonLocation.tcBusComponentCode = ''
           bScanDaemonLocation.tcBusComponentLabel = ''.
    return.
end.

if bScanDaemonLocation.tcBusComponentCode <> icComponentCode
then assign bScanDaemonLocation.tcBusComponentCode = icComponentCode
            bScanDaemonLocation.tcBusComponentLabel = ''.

if bScanDaemonLocation.tcBusComponentLabel = ''
then do:
    <Q-2 run BusComponentByLabelCodeID (all) (Read) (NoCache)
       (input ?, (BusComponentID)
        input icComponentCode, (BusComponentCode)
        input ?, (BusComponentLabel)
        output dataset tqBusComponentByLabelCodeID) in BBusinessComponent >

    find first tqBusComponentByLabelCodeID where
               tqBusComponentByLabelCodeID.tcBusComponentCode = bScanDaemonLocation.tcBusComponentCode no-error.
    if available tqBusComponentByLabelCodeID
    then assign bScanDaemonLocation.tcBusComponentLabel = tqBusComponentByLabelCodeID.tcBusComponentLabel.
end.

assign ocComponentLabel = bScanDaemonLocation.tcBusComponentLabel.