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

INHVCRV1.m

Go to the documentation of this file.
  1. INHVCRV1 ;KAC,bar ; 17 Aug 95 10:35; Create Application Server (ApS)
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. Q
  1. ;
  1. NEWSVR(INBPN,INV,INOA) ; Create Application Server (ApS).
  1. ;
  1. ; Input:
  1. ; INBPN - (req) BACKGROUND PROCESS CONTROL IEN for ApS
  1. ; INV - (req) array of inbound msg values to pass to server
  1. ; INOA - (req) array of outbound msg values to pass to server
  1. ;
  1. ; Variables:
  1. ; INAVJ - executable code to indicate # of available jobs on
  1. ; system, from ^%ZOSF("AVJ")
  1. ; INJCODE - executable code to initiate an Aps server
  1. ; INLSTSVR - last ApS server number used
  1. ; INMAXAPS - maximum # of Application Server (ApS) jobs
  1. ; default is 9999, our definition of infinity
  1. ; INSRVR - ApS server #
  1. ;
  1. ; Output:
  1. ; 0 - successfully created an application server
  1. ; 1 - application server NOT created
  1. ;
  1. N L,T,S,Y,INAVJ,INJCODE,INLSTSVR,INMAXAPS,INSRVR
  1. ;
  1. S INMAXAPS=$G(^INTHPC(INBPN,7)) ; get node with ApS startup info
  1. Q:'+INMAXAPS 1 ; valid ApS server?
  1. ; Get last ApS server # used & max # of ApS processes
  1. S INLSTSVR=+$P(INMAXAPS,U,3),INMAXAPS=+$P(INMAXAPS,U,2) S:'INMAXAPS INMAXAPS=9999
  1. ;
  1. ; Executable code that specifies # of available jobs on system
  1. S INAVJ=^%ZOSF("AVJ")
  1. ;
  1. ; Check for available ApS process slot. Locked "RUN" node indicates
  1. ; that this slot is in use. Wrap to slot 1 when hit maximum slot #.
  1. ; L = flag indicating when to stop iterating thru the list of slots
  1. ; (each slot will be ck'd no more than 2 times)
  1. ; S = ApS server (slot) #
  1. S (INSRVR,L)=0,S=INLSTSVR
  1. F S S=S+1 S:S>INMAXAPS S=1,L=L+1 Q:L>1 L +^INRHB("RUN","SRVR",INBPN,S):0 I S INSRVR=S Q
  1. ;
  1. ; Update last ApS server # used
  1. L +^INTHPC(INBPN):0 S $P(^INTHPC(INBPN,7),U,3)=INSRVR L -^INTHPC(INBPN)
  1. ;
  1. ; Check for available DSM process slot
  1. S T=0 I INSRVR X INAVJ I Y>1 D S Y=$$INRHB^INHUVUT1(INBPN,"",T) ; clr status, T=1 logs success
  1. . ; T is startup flag
  1. . S T=1,^INRHB("RUN",INBPN)=$H_"^Starting server "_INSRVR,^INRHB("RUN","SRVR",INBPN,INSRVR)=$H_"^Attempting to start server"
  1. . ; get program to build job code
  1. . N INPROG S INPROG=$G(^INTHPC(INBPN,"ROU"))
  1. . ; verify program and execute, $T should be set from JOB command
  1. . I $L(INPROG) D @INPROG I 1 X INJCODE S T=$T Q
  1. . S T=0
  1. L -^INRHB("RUN","SRVR",INBPN,S)
  1. Q '(T&INSRVR)
  1. ;
  1. PWSSRVR ; build executable code to start PWS server
  1. ;
  1. ; INV - array of inbound msg values to pass to server
  1. ; ZIL2 = IP address of remote system
  1. ; ZIL3 = port of remote system
  1. ; INOA - array of outbound msg values to pass to server
  1. ; ZIL4 = remote user (DUZ)
  1. ; ZIL10 = key/ticket value for verification
  1. ;
  1. S INJCODE=$$REPLACE^UTIL(^INTHOS(1,1),"*","EN^INHVCRA("_INBPN_","_INSRVR_","""_@INV@("ZIL2")_""","_@INV@("ZIL3")_","""_INOA("ZIL10")_""","_INOA("ZIL4")_")")
  1. Q