project BLF > include tFcCloseAndStopInstance.i

Description

Combine FcCloseInstanceCommunication.i and FcStopInstance.i.
When both includes are needed, this include will give performance improvement in a stateless setup,
by skipping the last SaveState.


include parameters


&CLASSclass short name
&ERROR-STATEMENTAction to take when an error occurred.


Internal usage


BLF
method Progress.CleanupStateOnline
method RPCRequestService.ForcePublish
method RPCRequestService.ProcessDS
method RPCRequestService.PublishComponent
method RPCRequestService.RunAPI
method RPCRequestService.ValidateSession
method TApplication.ActivateSOD
method TApplication.CallDaemon
method TApplication.CallUnconditionalStopDaemon
method TApplication.ClearDaemonQueue
method TApplication.DeactivateSOD
method TApplication.Synchronize
method TDaemon.StartRun
method TDocumentLink.CreateDocumentAttachment
method TGenericReportAdapter.CreateSession
method TGenericReportAdapter.DeleteProcedure
method TSODImport.ImportSODData
method TSODImport.ImportSODDataBRole
method TSODImport.ImportSODDataBSystem

QadFinancials
method BBusinessRelation.DataLoadByInput
method BBusinessRelation.MaintainAddressMulti
method BDInvoice.CreateDInvoicesDeduction
method BProject.PostSave
method BProject.ValidateComponentPreCOAMask
method BVATReport.CalculatePaging


include code

&IF "{&CLASS-REF}" = ""
&THEN
run StopInstance in vh{&CLASS}Inst
   (input (if vlFcStateless then "delete":U else ""),
    input "",
    input "",
    input no,
    output viFcIncludeReturn).
delete procedure vh{&CLASS}Inst.
assign vh{&CLASS}Inst = ?
       vi{&CLASS}Id   = 0.

if viFcIncludeReturn < 0
then do:
    assign oiReturnStatus = viFcIncludeReturn.
    &IF "{&ERROR-STATEMENT}" = ""
    &THEN
    return ?.
    &ELSE
    {&ERROR-STATEMENT}
    &ENDIF
end.
&ELSE
run StopInstance in vh{&CLASS-REF}Inst
   (input (if vlFcStateless then "delete":U else ""),
    input "",
    input "",
    input no,
    output viFcIncludeReturn).
delete procedure vh{&CLASS-REF}Inst.
assign vh{&CLASS-REF}Inst = ?
       vi{&CLASS-REF}Id   = 0.

if viFcIncludeReturn < 0
then do:
    assign oiReturnStatus = viFcIncludeReturn.
    &IF "{&ERROR-STATEMENT}" = ""
    &THEN
    return ?.
    &ELSE
    {&ERROR-STATEMENT}
    &ENDIF
end.
&ENDIF