Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XMTDO

XMTDO.m

Go to the documentation of this file.
  1. XMTDO ;ISC-SF/GMB-Deliver other (server,device) ;04/11/2002 07:05
  1. ;;8.0;MailMan;**45**;Jun 28, 2002;Build 9
  1. ; Replaces ZSER^, ZDEV^XMS1 (ISC-WASH/THM/CAP)
  1. ;
  1. ; Patch mod to attempt to sync mail message arrival with processing
  1. ; by building in 5 minute pause waiting for next mail msg line to
  1. ; arrive, and, if not, then xm send error server msg
  1. ;
  1. SERVER ; S.server TASKMAN ENTRY
  1. ; Variables supplied by TaskMan: XMZ,XMSERVER,XMSVIENS
  1. ; XMSERVER Name of the server option (includes leading S.)
  1. N XMZREC,XMFROM,XMSERR,XMSUBJ,XMZI
  1. D DUZ^XUP(.5)
  1. F XMZI=1:1 S XMZREC=$G(^XMB(3.9,XMZ,0)) Q:XMZREC'="" H 1 I XMZI>300 D Q ;patch mod for timing lag with mail msg
  1. . N XMPARM,XMINSTR
  1. . S XMINSTR("FROM")=.5
  1. . S XMPARM(1)=XMSERVER
  1. . S XMPARM(2)=ZTSK
  1. . D TASKBULL^XMXBULL(.5,"XM SEND ERR SERVER MSG",.XMPARM,"",.5,.XMINSTR)
  1. Q:XMZREC="" ;patch mode to quit if mail msg lag check occurs in for loop waiting for next line
  1. S XMSUBJ=$P(XMZREC,U,1)
  1. S:XMSUBJ["~U~" XMSUB=$$DECODEUP^XMXUTIL1(XMSUBJ)
  1. S XMFROM=$P(XMZREC,U,2)
  1. S:XMFROM["@" XMFROM=$$REPLYTO1^XMXREPLY(XMZ)
  1. D SETSTAT(XMSVIENS,$$EZBLD^DIALOG(39300)) ; Server hand off ready
  1. D DOSERV($E(XMSERVER,3,99),XMZ,XMFROM,XMSUBJ,.XMSERR)
  1. D SETSTAT(XMSVIENS,$S($D(XMSERR):XMSERR,1:$$EZBLD^DIALOG(39301))) ; Served (hand off done)
  1. S ZTREQ="@"
  1. Q
  1. DOSERV(XMXX,XMZ,XMFROM,XMSUBJ,XQSRVOK) ;
  1. N XMCHAN,XMPROT,X,Y,XMSEN,XMREC,XMOPEN,XMCLOSE,XMSVIENS
  1. S XMCHAN="SERVER"
  1. D GET^XML
  1. S X=XMXX_U_XMZ_U_XMFROM_U_XMSUBJ
  1. D ^XQSRV
  1. ; ^XQSRV1 calls SETSB^XMA1C to put the msg in the postmaster's bskt.
  1. ; Instead, that line could read:
  1. ; D:XQSRV PUTSERV^XMXMSGS1(XQSOP,XQMSG)
  1. Q
  1. DEVICE ; D.device or H.device TASKMAN ENTRY
  1. ; Variables supplied by TaskMan: XMDUZ,XMZ,XMDVIENS,XMPRTHDR
  1. ; TaskMan opens and closes the device.
  1. N XMV
  1. I '$G(DUZ) D DUZ^XUP(XMDUZ)
  1. D INITAPI^XMVVITAE
  1. D PRTMSG^XMJMP(XMDUZ,"?",XMZ,"0-",0,$G(XMPRTHDR,1))
  1. D SETSTAT(XMDVIENS,$$EZBLD^DIALOG(39302)) ; Printed
  1. S ZTREQ="@"
  1. Q
  1. SETSTAT(XMIENS,XMSTATUS) ; Record Time/Status in msg file
  1. N XMFDA
  1. S XMFDA(3.91,XMIENS,2)=$$NOW^XLFDT
  1. S XMFDA(3.91,XMIENS,5)=XMSTATUS
  1. D FILE^DIE("","XMFDA")
  1. Q