source: WorldVistAEHR/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/_ZTM3.m@ 1154

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

initial load of WorldVistAEHR

File size: 2.6 KB
Line 
1%ZTM3 ;SEA/RDS-TaskMan: Manager, Part 5 (Link Handling 2) ;22 May 2003 10:21 am
2 ;;8.0;KERNEL;**275**;JUL 10, 1995
3 ;
4LINK ;CHECK^%ZTM/LOOKUP^%ZTM0--test dropped links for recovery
5 L ^%ZTSCH("LINK") S ^%ZTSCH("LINK")=""
6 S ZTDVOL=""
7L0 F ZT=0:0 S ZTDVOL=$O(^%ZTSCH("LINK",ZTDVOL)) Q:ZTDVOL="" D TEST
8 I $D(^%ZTSCH("LINK"))#2,$O(^%ZTSCH("LINK",""))="" K ^%ZTSCH("LINK")
9 L K %ZTX,ZT,ZTDVOL,ZTD,ZTDTH,ZTH,ZTI,ZTM,ZTN,ZTR,ZTS,ZTSK,ZTT
10 Q
11 ;
12TEST ;LINK--test dropped link and send tasks if restored
13 S ZTI=$O(^%ZIS(14.5,"B",ZTDVOL,""))
14 S ZTS=^%ZIS(14.5,ZTI,0)
15 I $P(ZTS,U,3)="N" D REJECT Q
16 I $P(ZTS,U,4)="Y" Q
17 S ZTM=$P(ZTS,U,6)
18 S ZTN=$P(ZTS,U,7)
19 I ZTN S ZTNS=^%ZIS(14.5,ZTN,0),ZTN=$P(ZTNS,U)
20 I ZTN="" S ZTN=ZTDVOL
21 E S ZTS=ZTNS
22T1 ;
23 S X="ERTEST^%ZTM3",@^%ZOSF("TRAP")
24 S X=$D(^[ZTM,ZTN]%ZTSK)
25 S X="",@^%ZOSF("TRAP")
26 I $P(ZTS,U,10)="C" K ^%ZTSCH("LINK",ZTDVOL) Q
27 D XCPU I $O(^%ZTSCH("LINK",ZTDVOL,""))="" K ^%ZTSCH("LINK",ZTDVOL)
28 Q
29 ;
30REJECT ;TEST--reject waiting tasks whose volume set's link access is removed
31 S ZTDTH=""
32R3 S ZTDTH=$O(^%ZTSCH("LINK",ZTDVOL,ZTDTH)) I ZTDTH="" K ^%ZTSCH("LINK",ZTDVOL) Q
33 S ZTSK=""
34R4 S ZTSK=$O(^%ZTSCH("LINK",ZTDVOL,ZTDTH,ZTSK)) I ZTSK="" G R3
35 K ^%ZTSCH("LINK",ZTDVOL,ZTDTH,ZTSK)
36 I '$D(^%ZTSK(ZTSK)) G R4
37 D TSKSTAT^%ZTM1("B","NO LINK ACCESS TO VOLUME SET")
38 G R4
39 ;
40ERTEST ;TEST--trap if dropped link is still down
41 S X="",@^%ZOSF("TRAP")
42 S ^%ZTSCH("LINK")=$H
43 Q
44 ;
45XCPU ;TEST--send saved tasks across reestablished link
46 S X="ERXCPU^%ZTM3",@^%ZOSF("TRAP")
47 I '$D(^[ZTM,ZTN]%ZTSCH("RUN")) S ZTT=$H G X1
48 S ZTR=^[ZTM,ZTN]%ZTSCH("RUN"),ZTH=$H
49 S ZTD=$P(ZTDTH,",",2)+(ZTR-ZTH*86400)+$P(ZTR,",",2)-$P(ZTH,",",2)
50 S ZTT=ZTDTH+ZTR-ZTH+(ZTD\86400)-(ZTD<0)_","_$S(ZTD<0:0,1:ZTD#86400)
51 ;
52X1 S ZTDTH=""
53X3 S ZTDTH=$O(^%ZTSCH("LINK",ZTDVOL,ZTDTH)) I ZTDTH="" Q
54 S ZTSK=""
55X4 S ZTSK=$O(^%ZTSCH("LINK",ZTDVOL,ZTDTH,"")) I ZTSK="" G X3
56 K ^%ZTSCH("LINK",ZTDVOL,ZTDTH,ZTSK)
57 I $D(^%ZTSK(ZTSK,0))[0 G X4
58 I $L($P($G(^%ZTSK(ZTSK,.1)),U,10)) D TSKSTAT^%ZTM1("D","Stopped while waiting for Link") G X4
59 ;
60 L ^[ZTM,ZTN]%ZTSK(-1)
61 S ZTS=^[ZTM,ZTN]%ZTSK(-1)+1
62 F ZTI=0:0 Q:'$D(^[ZTM,ZTN]%ZTSK(ZTS)) S ZTS=ZTS+1
63 S ^[ZTM,ZTN]%ZTSK(-1)=ZTS
64 ;
65 L (^%ZTSK(ZTSK),^[ZTM,ZTN]%ZTSK(ZTS))
66 D TSKSTAT^%ZTM1(1,"Link")
67 S %X="^%ZTSK(ZTSK,",%Y="^[ZTM,ZTN]%ZTSK(ZTS," D %XY^%RCR
68 S $P(^[ZTM,ZTN]%ZTSK(ZTS,0),U,6)=ZTT
69 S ^[ZTM,ZTN]%ZTSCH(ZTT,ZTS)=""
70 ;
71 K ^%ZTSK(ZTSK)
72 L ^%ZTSCH("LINK")
73 G X4
74 ;
75ERXCPU ;XCPU--trap if link drops again while a task is being sent
76 S X="",@^%ZOSF("TRAP")
77 I ^%ZTSCH("LINK")="" S ^("LINK")=$H
78 I ZTSK]"",$D(^%ZTSK(ZTSK,0))#2 D TSKSTAT^%ZTM1("G","Link Error")
79 L ^%ZTSCH("LINK")
80 Q
81 ;
Note: See TracBrowser for help on using the repository browser.