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

XMCP.m

Go to the documentation of this file.
  1. XMCP ;ISC-SF/GMB-Poll Domains ;08/29/2002 13:12
  1. ;;8.0;MailMan;**4**;Jun 28, 2002
  1. ; Was (WASH ISC)/CAP/RM/AML/THM
  1. ;
  1. ; Entry points used by MailMan options (not covered by DBIA):
  1. ; POLL XMPOLL (was POLL^XMS1 and TSKPOLR^XMS5B)
  1. ;
  1. ; This option may be SCHEDULED.
  1. ; It goes through a list of domains whose FLAGS field contains P,
  1. ; meaning that the domains are to be "polled", that they should be
  1. ; contacted whether or not there are messages in their queues.
  1. ; If no messages are in the queues, the script for the poll domain
  1. ; will be 'played' anyway, and the TURN command executed to pull in
  1. ; any messages which may be waiting to be transmitted to this domain.
  1. ;
  1. POLL ; Process domains on poll list.
  1. S:$D(ZTQUEUED) ZTREQ="@"
  1. K ^TMP("XM",$J)
  1. I $$GOTTASKS W:'$D(ZTQUEUED) !!,$$EZBLD^DIALOG(42150) Q ;All domains have tasks.
  1. I $$XMITOK D TASKXMIT
  1. K ^TMP("XM",$J)
  1. Q
  1. GOTTASKS() ; Does every poll site have a task?
  1. N XMTSK,XMINST,XMSITE,XMPARM
  1. S XMINST=0
  1. F S XMINST=$O(^DIC(4.2,"AC","P",XMINST)) Q:'XMINST D
  1. . W:'$D(ZTQUEUED) "."
  1. . S XMSITE=$P(^DIC(4.2,XMINST,0),U)
  1. . S XMTSK=$$GETTSK^XMKPR(XMINST)
  1. . I XMTSK,'$$TSKEXIST^XMKPR(XMINST,XMTSK) S ^TMP("XM",$J,XMSITE)=XMINST Q
  1. . Q:$D(ZTQUEUED)
  1. . S XMPARM(1)=XMTSK,XMPARM(2)=XMSITE
  1. . W !,$$EZBLD^DIALOG(42151,.XMPARM) ;Task |1| is already scheduled for domain |2|
  1. Q '$D(^TMP("XM",$J))
  1. XMITOK() ; Ask whether eligible queues should be transmitted.
  1. N DIR,DIRUT,DTOUT,DUOUT,X,Y,XMSITE
  1. I $D(ZTQUEUED) Q 1
  1. W @IOF,$$EZBLD^DIALOG(42152) ;These domains lack tasks:
  1. S XMSITE=""
  1. F S XMSITE=$O(^TMP("XM",$J,XMSITE)) Q:XMSITE="" D
  1. . I $Y+4>IOSL D
  1. . . D WAIT^XMXUTIL
  1. . . W @IOF
  1. . W !?5,XMSITE
  1. S DIR(0)="YO"
  1. S DIR("A")=$$EZBLD^DIALOG(42128) ;Requeue the missing tasks
  1. S DIR("B")=$$EZBLD^DIALOG(39053) ;NO
  1. S DIR("?")=$$EZBLD^DIALOG(42153) ;Answer YES to transmit these domains.
  1. D ^DIR
  1. I 'Y W !!,$$EZBLD^DIALOG(42130) ;Tasks not requeued.
  1. Q Y
  1. TASKXMIT ;
  1. ; Task off transmission jobs
  1. N XMINST,XMSITE,XMPOLL
  1. I '$D(ZTQUEUED) W !
  1. S XMSITE="",XMPOLL=1
  1. F S XMSITE=$O(^TMP("XM",$J,XMSITE)) Q:XMSITE="" S XMINST=^(XMSITE) D
  1. . D QUEUE^XMCX(XMINST,XMSITE)
  1. W:'$D(ZTQUEUED) !,$$EZBLD^DIALOG(42132) ; Finished.
  1. Q