XOBVRM ;; mjk/alb - VistaLink Request Manager ; 07/27/2002 13:00
;;1.5;VistALink;;Sep 09, 2005
;;Foundations Toolbox Release v1.5 [Build: 1.5.0.026]
;
QUIT
;
; --------------------------------------------------------------------------------
; Request Manager
; --------------------------------------------------------------------------------
;
EN(XOBROOT,XOBDATA,XOBHDLR) ; -- main entry point for Request Manager
NEW XOBOK,XOBOPT
SET XOBOK=0
;
; -- if 'current' request handler is not defined then parse xml global buffer
; Note: 'Current' request handler could be define already via proprietary format reader
IF $GET(XOBHDLR)="" SET XOBOPT="" DO EN^XOBVRMX(XOBROOT,.XOBOPT,.XOBDATA,.XOBHDLR)
;
; -- default single call processing if not specified by request handler
IF $GET(XOBDATA("MODE"),"single call")="single call" SET XOBSTOP=1
;
; -- check if request handler info was successfully initialized / if not, throw exception
SET XOBHDLR=+$GET(XOBHDLR)
IF '$GET(XOBHDLR(XOBHDLR)) DO GOTO ENQ
. DO RMERR(184001,$GET(XOBHDLR(XOBHDLR,"ERROR"),"Request Manager not defined"))
. SET XOBOK=0
;
; -- do authtentication check for message type?
IF $GET(XOBHDLR(XOBHDLR,"AUTHENTICATE")) DO
. SET XOBOK=$$LOGGEDON^XOBSCAV()
ELSE DO
. SET XOBOK=1
;
; -- call request handler
IF XOBOK XECUTE $GET(XOBHDLR(XOBHDLR,"REQHDLR"))
;
ENQ ;
QUIT XOBOK
;
; ----------------------------------------------------------------------------------
; Request Manager Error Handler
; ----------------------------------------------------------------------------------
RMERR(XOBCODE,XOBMSG) ; -- send request error message
NEW XOBDAT
SET XOBDAT("MESSAGE TYPE")=3
SET XOBDAT("ERRORS",1,"FAULT STRING")="System Error"
SET XOBDAT("ERRORS",1,"FAULT ACTOR")="Request Manager"
SET XOBDAT("ERRORS",1,"CODE")=XOBCODE
SET XOBDAT("ERRORS",1,"ERROR TYPE")="Request Manager"
SET XOBDAT("ERRORS",1,"CDATA")=0
SET XOBDAT("ERRORS",1,"MESSAGE",1)=$$EZBLD^DIALOG(XOBCODE,XOBMSG)
DO ERROR^XOBVLIB(.XOBDAT)
DO ^%ZTER
QUIT
;
XOBVRM ;; mjk/alb - VistaLink Request Manager ; 07/27/2002 13:00
+1 ;;1.5;VistALink;;Sep 09, 2005
+2 ;;Foundations Toolbox Release v1.5 [Build: 1.5.0.026]
+3 ;
+4 QUIT
+5 ;
+6 ; --------------------------------------------------------------------------------
+7 ; Request Manager
+8 ; --------------------------------------------------------------------------------
+9 ;
EN(XOBROOT,XOBDATA,XOBHDLR) ; -- main entry point for Request Manager
+1 NEW XOBOK,XOBOPT
+2 SET XOBOK=0
+3 ;
+4 ; -- if 'current' request handler is not defined then parse xml global buffer
+5 ; Note: 'Current' request handler could be define already via proprietary format reader
+6 IF $GET(XOBHDLR)=""
SET XOBOPT=""
DO EN^XOBVRMX(XOBROOT,.XOBOPT,.XOBDATA,.XOBHDLR)
+7 ;
+8 ; -- default single call processing if not specified by request handler
+9 IF $GET(XOBDATA("MODE"),"single call")="single call"
SET XOBSTOP=1
+10 ;
+11 ; -- check if request handler info was successfully initialized / if not, throw exception
+12 SET XOBHDLR=+$GET(XOBHDLR)
+13 IF '$GET(XOBHDLR(XOBHDLR))
Begin DoDot:1
+14 DO RMERR(184001,$GET(XOBHDLR(XOBHDLR,"ERROR"),"Request Manager not defined"))
+15 SET XOBOK=0
End DoDot:1
GOTO ENQ
+16 ;
+17 ; -- do authtentication check for message type?
+18 IF $GET(XOBHDLR(XOBHDLR,"AUTHENTICATE"))
Begin DoDot:1
+19 SET XOBOK=$$LOGGEDON^XOBSCAV()
End DoDot:1
+20 IF '$TEST
Begin DoDot:1
+21 SET XOBOK=1
End DoDot:1
+22 ;
+23 ; -- call request handler
+24 IF XOBOK
XECUTE $GET(XOBHDLR(XOBHDLR,"REQHDLR"))
+25 ;
ENQ ;
+1 QUIT XOBOK
+2 ;
+3 ; ----------------------------------------------------------------------------------
+4 ; Request Manager Error Handler
+5 ; ----------------------------------------------------------------------------------
RMERR(XOBCODE,XOBMSG) ; -- send request error message
+1 NEW XOBDAT
+2 SET XOBDAT("MESSAGE TYPE")=3
+3 SET XOBDAT("ERRORS",1,"FAULT STRING")="System Error"
+4 SET XOBDAT("ERRORS",1,"FAULT ACTOR")="Request Manager"
+5 SET XOBDAT("ERRORS",1,"CODE")=XOBCODE
+6 SET XOBDAT("ERRORS",1,"ERROR TYPE")="Request Manager"
+7 SET XOBDAT("ERRORS",1,"CDATA")=0
+8 SET XOBDAT("ERRORS",1,"MESSAGE",1)=$$EZBLD^DIALOG(XOBCODE,XOBMSG)
+9 DO ERROR^XOBVLIB(.XOBDAT)
+10 DO ^%ZTER
+11 QUIT
+12 ;