Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide
Sample User-Written Code for SPIFFY Subsystem
Interface Process
D-20
109759—Distributed Systems Network Management (DSNM) Subsystem Interface
Development Guide
Sample I Process Program Code
st^new^object ->
! Enter this state each time we need a new object from the
! frame's input object list, which occurs initially and after
! the preceding object has been processed completely.
! Get the next object from the _INPUT.OBJECTLIST; when it’s _NULL,
! we've processed them all.
if _ISNULL (@cx.inobj := @inobj := _GET^LM (cx._INPUT.OBJECTLIST))
THEN RETURN _RC^STOP;
! As soon as we get the next input object, process its hmod and
! set the command flags in the object lm. We must analyze the hmod
! now because it is redefined by the result code.
inobj.cf := cx.cf + (IF inobj.FOBJ.Z^HMOD
THEN hmodflags (inobj.FOBJ.Z^HMOD)
ELSE cx.hmodf);
inobj.FOBJ.Z^RESULT := 0;
! Set up the command elements and open the manager
IF inobj.FOBJ.Z^SUBSYS <> "SPIFFY " THEN
BEGIN
! Found an error. Put out an error object and redispatch
! this proc in the current state to process the next one.
! If format^error^object returns anything but _RC^NULL, it
! found an error of its own which supersedes this one to
! abort the thread.
inobj.er := ZDSN^ERR^BADSUBSYS;
IF (rc := format^error^object (inobj)) <> _RC^NULL THEN
RETURN rc;
_DISPATCH^THREAD (,,_EV^CONTINUE);
END;
IF (inobj.thing.type := typecode (inobj.FOBJ.Z^OBJTYPE)) = other
THEN BEGIN
inobj.er := ZDSN^ERR^OBJTYPE^NOT^SUPPORTED;
IF (rc := format^error^object (inobj)) <> _RC^NULL THEN
RETURN rc;
_DISPATCH^THREAD (,,_EV^CONTINUE);
END;
IF NOT has^subordinates (inobj.thing.type) THEN
BEGIN
! If object has no subordinates, don't look for them no
! matter what the hmod says. If further the hmod says not
! to process the object, there isn't much to do with it...
_TURNOFF (inobj.cf,c^subobj);
IF _OFF (inobj.cf,c^cmdobj) THEN
_DISPATCH^THREAD (,,_EV^CONTINUE);
END;
IF inobj.FOBJ.Z^OBJNAME = starname THEN
_TURNON (inobj.cf,c^starobj);
IF (inobj.er := _OPEN^CI (spifmon, cx.spif, inobj.FOBJ.Z^MANAGER))
THEN BEGIN
IF (rc := format^error^object (inobj)) <> _RC^NULL THEN
RETURN rc;
_DISPATCH^THREAD (,,_EV^CONTINUE);
END;