source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMCX.m@ 623

Last change on this file since 623 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1XMCX ;ISC-SF/GMB-Play a Script / Queue Transmit Task ;12/04/2002 13:45
2 ;;8.0;MailMan;**6,10**;Jun 28, 2002
3 ; Was (WASH ISC)/THM
4 ;
5 ; Entry points used by MailMan options (not covered by DBIA):
6 ; PLAY XMSCRIPTPLAY (was GO^XMC11)
7 ; Q1 XMSTARTQUE (was Q^XMC2)
8 ; QALL XMSTARTQUE-ALL (was REQUE^XMS5)
9 Q
10PLAY ; Play a script
11 N XM,XMB,XMC,XMINST,XMSITE,XMIO,XMHOST,XMABORT
12 K XMTLER
13 S XM="D",XMABORT=0
14 D ASKINST^XMCXU(.XMINST,.XMSITE,.XMABORT) Q:XMABORT
15 D CHKTSK^XMCXU(XMINST,2,.XMABORT) Q:XMABORT
16 D ASKSCR^XMCXU(XMINST,XMSITE,.XMB,.XMABORT) Q:XMABORT
17 S XMIO=$P(XMB("SCR REC"),U,5)
18AGAIN ;
19 D ENT^XMC1
20 I ER=25!($G(XMHOST)="NO-IP") D G:'XMABORT AGAIN
21 . N XMTEXT,XMIPSAVE
22 . I '$$USEDNS^XMKPR1 D Q
23 . . S XMABORT=1
24 . . ;DNS is not activated at this site, so you'll have to figure
25 . . ;out the correct IP address yourself.
26 . . D BLD^DIALOG(42263,"","","XMTEXT","F")
27 . . D MSG^DIALOG("WM","","","","XMTEXT")
28 . ;Let's see what we can do...
29 . ;We've tried these: |1|
30 . D BLD^DIALOG(42264,XMB("IP TRIED"),"","XMTEXT","F")
31 . D MSG^DIALOG("WM","","","","XMTEXT")
32 . S XMB("TRIES")=XMB("TRIES")+1
33 . S XMIPSAVE=XMB("IP TRIED"),XMC("PLAY")=1
34 . D NEXTIP^XMKPR1(XMSITE,.XMB) K XMC("PLAY")
35 . I XMIPSAVE=XMB("IP TRIED") D Q
36 . . S XMABORT=1
37 . . ;The DNS did not return any other addresses to try. Sorry!
38 . . D BLD^DIALOG(42265,"","","XMTEXT","F")
39 . . D MSG^DIALOG("WM","","","","XMTEXT")
40 . W !,$$EZBLD^DIALOG(42266,$P(XMB("SCR REC"),U,6)) ;Now, let's try: |1|
41 . K ER,XMER
42 I 'XMABORT,'ER S XMC("PLAY")=1 D CHKSETIP^XMTDR(XMINST,XMSITE,.XMB)
43 D KL^XMC
44 Q
45Q1 ; Trigger a queue for transmission
46 N XMB,XMINST,XMSITE,XMTSK,XMABORT
47 S XMABORT=0 ; pick a queue w/msgs
48 D ASKINST^XMCXU(.XMINST,.XMSITE,.XMABORT,"M") Q:XMABORT
49 D CHKTSK^XMCXU(XMINST,1,.XMABORT) Q:XMABORT
50 D ASKSCR^XMCXU(XMINST,XMSITE,.XMB,.XMABORT) Q:XMABORT
51 D QUEUE(XMINST,XMSITE,.XMB)
52 Q
53TASK ;
54QALL ;
55 N XMDUZ,XMK,XMIEN,XMSITE
56 S:$D(ZTQUEUED) ZTREQ="@"
57 D RESEQ^XMCQA
58 K ^TMP("XM",$J)
59 S XMK=1000
60 F S XMK=$O(^XMB(3.7,.5,2,XMK)) Q:'XMK Q:XMK>9999 D
61 . Q:'$$BMSGCT^XMXUTIL(.5,XMK)
62 . W:'$D(ZTQUEUED) "."
63 . S XMIEN=XMK-1000
64 . S:'$$TSKEXIST^XMKPR(XMIEN) ^TMP("XM",$J,$P(^DIC(4.2,XMIEN,0),U))=XMIEN
65 I '$D(^TMP("XM",$J)) D Q
66 . W:'$D(ZTQUEUED) !!,$$EZBLD^DIALOG(42125) ;All queues with messages have tasks.
67 I '$D(ZTQUEUED) D Q:'$D(^TMP("XM",$J))
68 . W:$E($G(IOST),1,2)="C-" @IOF
69 . W !,$$EZBLD^DIALOG(42126),! ;These queues with messages have no tasks:
70 . S XMSITE=""
71 . F S XMSITE=$O(^TMP("XM",$J,XMSITE)) Q:XMSITE="" D
72 . . I $Y+3>IOSL D
73 . . . D WAIT^XMXUTIL
74 . . . W @IOF
75 . . S XMIEN=^TMP("XM",$J,XMSITE)
76 . . W !,$E(XMSITE,1,37)
77 . . Q:$P(^DIC(4.2,XMIEN,0),U,2)["S"
78 . . W ?40,$$EZBLD^DIALOG(42127) ;No Send Flag - Will not task
79 . . K ^TMP("XM",$J,XMSITE)
80 . Q:'$D(^TMP("XM",$J))
81 . N DIR
82 . S DIR(0)="YO"
83 . S DIR("A")=$$EZBLD^DIALOG(42128) ;Requeue the missing tasks
84 . S DIR("B")=$$EZBLD^DIALOG(39053) ;No
85 . D BLD^DIALOG(42129,"","","DIR(""?"")") ;Answer YES to create tasks to transmit these queues.
86 . D ^DIR Q:Y
87 . W !!,$$EZBLD^DIALOG(42130) ;Tasks not requeued.
88 . K ^TMP("XM",$J)
89 S XMSITE=""
90 F S XMSITE=$O(^TMP("XM",$J,XMSITE)) Q:XMSITE="" D
91 . S XMIEN=^TMP("XM",$J,XMSITE)
92 . I $$UP^XLFSTR($P(^DIC(4.2,XMIEN,0),U,2))'["S" D Q
93 . . W:'$D(ZTQUEUED) !,$E(XMSITE,1,37),?40,$$EZBLD^DIALOG(42127) ;No Send Flag - Will not task
94 . D QUEUE(XMIEN,XMSITE)
95 W:'$D(ZTQUEUED) !,$$EZBLD^DIALOG(42132) ;Finished.
96 K ^TMP("XM",$J)
97 Q
98QUEUE(XMINST,XMSITE,XMB,XMWHEN,XMTSK) ;
99 D QUEUE^XMKPR(XMINST,XMSITE,.XMB,.XMWHEN,.XMTSK) Q:$D(ZTQUEUED)
100 W !,$E(XMSITE,1,37),?40,$$EZBLD^DIALOG($S($D(XMTSK):42131,1:39311),$G(XMTSK)) ;Task |1| queued / Task creation failed
101 Q
Note: See TracBrowser for help on using the repository browser.