source: Scheduling/trunk/m/BSDX23.m@ 1627

Last change on this file since 1627 was 1625, checked in by Tariq Hamkari, 12 years ago

Ayman Ghaith : adding the correct routines which not has the transactions.

File size: 2.9 KB
Line 
1BSDX23 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 4/28/11 10:22am
2 ;;1.7;BSDX;;Jun 01, 2013;Build 24
3 ; Licensed under LGPL
4 ;
5 ;
6EVENT(BSDXEVENT,BSDXPARAM,BSDXSIP,BSDXSPT) ;EP
7 ;Raise event to interested clients
8 ;Clients are listed in ^BSDXTMP("EVENT",EVENT_NAME,IP,PORT)
9 ;BSDXSIP and BSDXSPT represent the sender's IP and PORT.
10 ;The event will not be raised back to the sender if these are non-null
11 ;
12 Q:'$D(^BSDXTMP("EVENT",BSDXEVENT))
13 S BSDXIP=0 F S BSDXIP=$O(^BSDXTMP("EVENT",BSDXEVENT,BSDXIP)) Q:BSDXIP="" D
14 . S BSDXPORT=0 F S BSDXPORT=$O(^BSDXTMP("EVENT",BSDXEVENT,BSDXIP,BSDXPORT)) Q:'+BSDXPORT D
15 . . I BSDXIP=BSDXSIP Q ;,BSDXPORT=BSDXSPT Q
16 . . D CALL^%ZISTCP(BSDXIP,BSDXPORT,5)
17 . . I POP K ^BSDXTMP("EVENT",BSDXEVENT,BSDXIP,BSDXPORT) Q
18 . . ;U IO R X#3:5
19 . . I X'="ACK" K ^BSDXTMP("EVENT",BSDXEVENT,BSDXIP,BSDXPORT) Q
20 . . S BSDXPARAM=$S(BSDXPARAM="":"",1:U_BSDXPARAM)
21 . . U IO W BSDXEVENT,BSDXPARAM,!
22 . . D ^%ZISC
23 . . Q
24 . Q
25 Q
26 ;
27EVERR(BSDXEVENT,BSDXIP,BSDXPORT) ;
28 ;
29 Q:$G(BSDXEVENT)=""
30 Q:$G(BSDXIP)=""
31 Q:$G(BSDXIP)=""
32 K ^BSDXTMP("EVENT",BSDXEVENT,BSDXIP,BSDXPORT)
33 Q
34 ;
35REGET ;EP
36 ;Error trap from REGEVNT
37 ;
38 I '$D(BSDXI) N BSDXI S BSDXI=999
39 S BSDXI=BSDXI+1
40 D REGERR(BSDXI,99)
41 Q
42 ;
43REGERR(BSDXI,BSDXERID) ;Error processing
44 S BSDXI=BSDXI+1
45 S ^BSDXTMP($J,BSDXI)=BSDXERID_$C(30)
46 S BSDXI=BSDXI+1
47 S ^BSDXTMP($J,BSDXI)=$C(31)
48 Q
49 ;
50 ;
51REGEVNT(BSDXY,BSDXEVENT,BSDXIP,BSDXPORT) ;EP
52 ;RPC Called by client to inform RPMS server of client's interest in BSDXEVENT
53 ;Returns RECORDSET with field ERRORID.
54 ;If everything ok then ERRORID = 0;
55 ;
56 N BSDXI
57 S BSDXI=0
58 S X="REGET^BSDX23",@^%ZOSF("TRAP")
59 S BSDXY="^BSDXTMP("_$J_")"
60 S ^BSDXTMP($J,0)="I00020ERRORID"_$C(30)
61 I '+BSDXPORT D REGERR(BSDXI,1) Q
62 I BSDXIP="" D REGERR(BSDXI,2) Q
63 S ^BSDXTMP("EVENT",BSDXEVENT,BSDXIP,BSDXPORT)=""
64 ;
65 S BSDXI=BSDXI+1
66 S ^BSDXTMP($J,BSDXI)="0"_$C(30)_$C(31)
67 Q
68 ;
69UNREG(BSDXY,BSDXEVENT,BSDXIP,BSDXPORT) ;EP
70 ;RPC Called by client to Unregister client's interest in BSDXEVENT
71 ;Returns RECORDSET with field ERRORID.
72 ;If everything ok then ERRORID = 0;
73 ;
74 N BSDXI
75 S BSDXI=0
76 S X="REGET^BSDX23",@^%ZOSF("TRAP")
77 S BSDXY="^BSDXTMP("_$J_")"
78 S ^BSDXTMP($J,0)="I00020ERRORID"_$C(30)
79 I '+BSDXPORT D REGERR(BSDXI,1) Q
80 I BSDXIP="" D REGERR(BSDXI,2) Q
81 K ^BSDXTMP("EVENT",BSDXEVENT,BSDXIP,BSDXPORT)
82 ;
83 S BSDXI=BSDXI+1
84 S ^BSDXTMP($J,BSDXI)="0"_$C(30)_$C(31)
85 Q
86 ;
87RAISEVNT(BSDXY,BSDXEVENT,BSDXPARAM,BSDXSIP,BSDXSPT) ;EP
88 ;RPC Called to raise event BSDXEVENT with parameter BSDXPARAM
89 ;BSDXSIP and BSDXSPT represent the sender's IP and PORT.
90 ;If not null, these will prevent the event from being raised back
91 ;to the sender.
92 ;Returns a RECORDSET wit the field ERRORID.
93 ;If everything ok then ERRORID = 0;
94 ;
95 N BSDXI
96 S BSDXI=0
97 S BSDXY="^BSDXTMP("_$J_")"
98 S ^BSDXTMP($J,0)="I00020ERRORID"_$C(30)
99 S X="REGET^BSDX23",@^%ZOSF("TRAP")
100 ;
101 D EVENT(BSDXEVENT,BSDXPARAM,BSDXSIP,BSDXSPT)
102 ;
103 S BSDXI=BSDXI+1
104 S ^BSDXTMP($J,BSDXI)="0"_$C(30)_$C(31)
105 Q
Note: See TracBrowser for help on using the repository browser.