icDraftReference | input | character | Description for the draft instance. This parameter will have a value when creating a draft instance. |
icDraftFormName | input | character | This parameter will have a value when creating a draft instance. |
ilDraftIsShared | input | logical | This parameter will have a value when creating a draft instance. |
oiReturnStatus | output | integer | Return status of the method. |
If oiReturnStatus = 0 Then Assign oiReturnStatus = -98. Empty Temp-table tLogoutSessionTokenCaller. Empty Temp-table tResponseCodeCaller. If vlDoLogOut = True And icDraftReference = "":U And viCurrentDraftInstanceId = 0 And (vcUserFromUIShell = '':U Or vcUserFromUIShell = ?) Then Do: <Q-18 run FcSessionByAll (all) (Read) (NoCache) (input viFcCurrentInstanceId, (SessionInstanceId) input ?, (GlobalSessionNeedsUpdate) output dataset tqFcSessionByAll) in BFcSession> find first tqFcSessionByAll no-error. if available tqFcSessionByAll and tqFcSessionByAll.tiSessionTimeOut = 0 then do: Create tLogoutSessionTokenCaller. Assign tLogoutSessionTokenCaller.tcMfgSessionId = vcGlobalSessionId. <I-1 {bFcStartAndOpenInstance &CLASS = "PAuthentication"}> <M-4 run Logout (input tLogoutSessionTokenCaller (tLogoutSessionToken), output tResponseCodeCaller (tResponseCode), output viFcReturnSuper (oiReturnStatus)) in PAuthentication> if viFcReturnSuper <> 0 then oiReturnStatus = viFcReturnSuper. if viFcReturnSuper < 0 then Do: <I-10 {bFcCloseAndStopInstance &CLASS = "PAuthentication"}> return. End. For Each tResponseCodeCaller Where tResponseCodeCaller.tcResponseCode <> '0':U: assign vcMsg = <M-5 GetMessage (input tResponseCodeCaller.tcResponseCode (icErrorCode)) in PAuthentication> oiReturnStatus = -1. <M-6 run SetMessage (input vcMsg (icMessage), input '' (icArguments), input '' (icFieldName), input '' (icFieldValue), input 'E':U (icType), input 3 (iiSeverity), input '' (icRowid), input 'BLF-397':U (icFcMsgNumber), input '' (icFcExplanation), input '' (icFcIdentification), input '' (icFcContext), output viFcReturnSuper (oiReturnStatus)) in Session> End. /*For Each tControlFlagsCall:*/ <I-9 {bFcCloseAndStopInstance &CLASS = "PAuthentication"}> If oiReturnStatus < 0 And oiReturnStatus <> -98 Then Return. end. /* if available tqFcSessionByAll and tqFcSessionByAll.tiSessionTimeOut = 0 */ End. /* if */ If icDraftReference = "":U And viCurrentDraftInstanceId = 0 And vlDeleteFcSession = true Then Do: <M-15 run StartPersistence (output vhFcComponent (ohPersistence), output viFcReturnSuper (oiReturnStatus)) in Session> if viFcReturnSuper <> 0 then oiReturnStatus = viFcReturnSuper. if viFcReturnSuper < 0 then return. /*delete the record*/ Assign vcQuery = "for each fcSession where fcSession.SessionInstance_ID = ":U + String(viSessionID). <M-16 run WriteDirect (input 'fcSession':U (icTableName), input vcQuery (icPrepare), input '' (icFieldList), input '' (icFieldListDataTypes), input '' (icAbsolute), input '' (icIncremental), input {&TARGETPROCEDURE} (ihClass), input vcUserLogin (icUserLogin), output viFcReturnSuper (oiReturnStatus)) in persistence> if viFcReturnSuper <> 0 then oiReturnStatus = viFcReturnSuper. if viFcReturnSuper < 0 then return. Assign vlDeleteFcSession = FALSE. End. If oiReturnStatus = -98 Then Assign oiReturnStatus = 0. <ANCESTOR-CODE> <M-17 run SetDebugLevel (input 0 (iiDebugLevel)) in Session> empty temp-table tDataItems. empty temp-table tFilterVariable. /* Invalidate the cached data of this session. */ <M-59 run StartCacher (output vhFcComponent (ohCacher), output viFcReturnSuper (oiReturnStatus)) in Session> <M-12 run ClearCache (output viFcReturnSuper (oiReturnStatus)) in Cacher>