For example, to set the Unix environment variable DSQUERY to DBSERVER for the process FOO, an entry in FOO.RESOURCE would need to be added as follows:
ENV.DSQUERY = DBSERVER ! override the process' environment version of DSQUERY
If there were an entry like
DBSERVER = mydb
in the path file in which the task is started, then the DSQUERY variable value would be = "mydb" instead.
Unix: bubba@foobar
- A "NULL" XPOLL_STATE is defined that does nothing except
clear the
present event. For example, an external process' resource file might
contain the line:
XPOLL_STATE.05 = NULL
If the external process were to exit with a return value of 5, the "NULL"
state would be chosen and no modifications to the item that triggered
the
external process would occur.
- XPOLL supports multiple triggering items per event (more
than one file
or OSF can be processed per execution of the external process). For
each
OSF_TRIGGER, the resource item OSF_TRIGGERn.MAXTARGS, where n is the
trigger definition number, specifies the maximum number of OSF's, matching
the trigger definition, that will be passed to the external process.
Similarly, for file pollers the resource item FILE_MAXTARGSn, where
n is the
trigger definition number, determines the maximum number of files,
matching
the trigger definition, that will be passed to the external process.
By
default, both "MAXTARGS" resource values are set to 1 to provide backward
compatibility with existing OPUS software.
Information about each triggering item in an event is conveyed to the
external process through the environment, as is presently the case.
However,
in order to support multiple triggering items per event, the environment
variable "EVENT_NUM" is set to the number of triggering items for the
current event. For OSF pollers, xpoll sets the following variables
related
to the triggering items in the environment:
OSF_DATASET
OSF_DATA_ID
OSF_DCF_NUM
OSF_START_TIME
OSF_DATASET1
OSF_DATA_ID1
OSF_DCF_NUM1
OSF_START_TIME1
.
.
.
OSF_DATASET(n-1)
OSF_DATA_ID(n-1)
OSF_DCF_NUM(n-1)
OSF_START_TIME(n-1)
for n items. For file pollers, the triggering items environment variables are:
EVENT_NAME
EVENT_NAME1
.
.
.
EVENT_NAME(n-1)
for n items. The external process can choose to return an exit status
that
updates all items in the event with the same end state, or it can specify
a
different end state for each event item. The former option is equivalent
to
the current functionality of XPOLL-- the external process would exit
with a
return status that is mapped to a status in the resource file. For
example,
OSF_SUCCESS.CA = 'C'
XPOLL_STATE.06 = OSF_SUCCESS
The latter option is new, and requires that the external process specify
the end state for all triggering items in the event through the text
file
indicated in the environment variable "EVENT_STATE_FILE"; the file
should
be created in OPUS_HOME_DIR. The external process should place entries
in
the indicated file of the form:
OSF_STATUS = s0
OSF_STATUS1 = s1
.
.
.
OSF_STATUS(n-1) = s(n-1)
for OSF events and
EVENT_STATUS = s0
EVENT_STATUS1 = s1
.
.
.
EVENT_STATUS(n-1) = s(n-1)
for FILE events where n is the number of triggering items and s0, s1,
...,
s(n-1) are exit status values that map to an XPOLL_STATE item in the
process'
resource file. There MUST be entries for each triggering item in the
event in
this file, and the item number n in EVENT_STATE_FILE will map to the
item
number n in the environment variables OSF_DATASETn or EVENT_NAMEn.
The external process signals to xpoll that the end states should be
read
from the state file by exiting with a status value that maps to the
XPOLL_STATE "CHECK_FILE". For example, an external OSF poller might
exit
with the return status 5 which would be mapped to "CHECK_FILE" in the
process resource file:
XPOLL_STATE.05 = CHECK_FILE
Xpoll would then read and update the status for each OSF in the current
event based on the contents of the file indicated in EVENT_STATE_FILE.
Xpoll deletes the state file after processing the entries.
NOTE: external processes that are configured to accept events containing
more than one triggering item MUST use EVENT_NUM to determine the number
of
items in the current event. The environment is not cleared between
events
and there may be variables defined in the external process' environment
that are left-over from previous events.
- A test driver, xpltst, now exists that verifies that
xpoll is functioning
normally. Instructions for running the test driver can be found in
the
resource file xpltst.resource