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

XMKPL.m

Go to the documentation of this file.
  1. XMKPL ;ISC-SF/GMB-Manage the local mail posting process ;04/17/2002 10:54
  1. ;;8.0;MailMan;;Jun 28, 2002
  1. ; Replaces ^XMADGO1,^XMADGO (ISC-WASH/CAP)
  1. ; Entry points (not covered by DBIA):
  1. ; CHECK Check the local processes.
  1. ; If they haven't been deliberately STOP'd,
  1. ; and if they are not running,
  1. ; then task them.
  1. ; STATUS Get status of local processes.
  1. ;
  1. ; Entry points used by MailMan options (not covered by DBIA):
  1. ; STOP XMMGR-STOP-BACKGROUND-FILER - Stop the local processes.
  1. ; START XMMGR-START-BACKGROUND-FILER - Start the local processes.
  1. ;
  1. CHECK ; Task Background Filer processes if any missing
  1. Q:$P(^XMB(1,1,0),U,16) ; Quit if 'background filer stop flag' set.
  1. N XMPROC,XMSTATUS
  1. D STATUS(.XMSTATUS)
  1. Q:'$D(XMSTATUS)
  1. S XMPROC=""
  1. F S XMPROC=$O(XMSTATUS(XMPROC)) Q:XMPROC="" D QUEUE(XMPROC)
  1. Q
  1. STATUS(XMSTATUS) ;Check status of background filer
  1. N XMPROC,XMLOCK
  1. F XMPROC="Mover","Tickler" D
  1. . S XMLOCK="POST_"_XMPROC
  1. . L +^XMBPOST(XMLOCK):0 E Q
  1. . S XMSTATUS(XMPROC)=$$EZBLD^DIALOG($S(XMPROC="Mover":36224.1,1:36224.2)) ; The Mover/Tickler is not running!
  1. . L -^XMBPOST(XMLOCK)
  1. Q
  1. QUEUE(XMPROC) ;Start Queue processors
  1. N XMHANG,ZTRTN,ZTDESC,ZTSAVE,X,ZTSK,ZTQUEUED,ZTCPU,ZTDTH,ZTIO
  1. S XMHANG=$$HANG
  1. S ZTDESC=$$EZBLD^DIALOG($S(XMPROC="Mover":36227,1:36228)) ; MailMan: Background Filer (Mover/Tickler)
  1. S ZTSAVE("XMHANG")=""
  1. S ZTRTN=$S(XMPROC="Mover":"GO^XMKPLQ",1:"GO^XMTDT")
  1. I $D(^XMB(1,1,0)) S X=$P(^(0),U,12) I X'="" S ZTCPU=$P(X,",",2)
  1. S ZTIO="",ZTDTH=$H
  1. D ^%ZTLOAD
  1. Q
  1. HANG() ; Get Hangtime for delivery modules
  1. N X
  1. S X=$P($G(^XMB(1,1,0)),U,13)
  1. Q $S(X:X,1:5)
  1. STOP ; Stop Background mail delivery processes
  1. N DIR,Y,DIRUT
  1. S DIR(0)="Y"
  1. D BLD^DIALOG(36229,"","","DIR(""A"")")
  1. ;Are you sure you want the Background Filers to stop delivering mail
  1. S DIR("B")=$$EZBLD^DIALOG(39053) ; No
  1. D ^DIR Q:'Y
  1. S $P(^XMB(1,1,0),U,16)=1 ; Set 'background filer stop flag'
  1. W:'$D(ZTQUEUED) !!,$C(7),$$EZBLD^DIALOG(36229.1) ; << Background Filers will stop soon. >>
  1. Q
  1. START ; Start the local processes (usually after they had been STOP'd).
  1. S $P(^XMB(1,1,0),U,16)="" ; Reset 'background filer stop flag'
  1. D CHECK
  1. W:'$D(ZTQUEUED) !!,$C(7),$$EZBLD^DIALOG(36229.2) ; << Background Filers will start soon. >>
  1. Q