Distributed Systems Network Management (DSNM) Subsystem Interface Development Guide

I Process Development Process
Distributed Systems Network Management (DSNM) Subsystem Interface Development
Guide109759 3-33
Example: List Processing Library Services
STRUCT command^context^def (*);
BEGIN
_COMMAND^CONTEXT^HEADER;
INT .EXT inobj (input^lm^def);
INT .EXT outobj (output^lm^def);
END;
!Thread proc locals!
INT .EXT cx (command^context^def) = _THREAD^CONTEXT^ADDRESS;
INT .EXT in (input^lm^def) := @cx._INPUT;
INT .EXT out (output^lm^def) := @cx._OUTPUT;
...
! Get the next input object
IF _ISNULL (@cx.inobj := _GET^LM (in.OBJECTLIST))
THEN ... <No more input> ;
!Create output list member
IF _ISNULL (@cx.outobj := _PUT^LM (out.OBJECTLIST,,
$LEN (cx.outobj)))
THEN ... <out of available memory> ;
! Now cx.inobj.fobj and cx.outobj.fobj are the current
! input and output objects. Since the output object is the
! same as an input object, use the same-fobject parameter:
IF (error := _FOBJECT^INIT (cx.outobj.FOBJ,cx.inobj.FOBJ))
THEN ... <error exit> ;
! Send to CI, determine status of input object and its
! subordinates.
! Use state variables to return to this point after the
! _EV^IODONE event occurs.
cx.outobj.FOBJ.Z^RESULT := <status of input object>;
! Since this completes the current output object, release it
_RELEASE^OUTPUT (cx.outobj);
! Enter subordinates and their status into output list
! (Assuming one CI communication returns all subordinates)
WHILE <more subordinate objects>
DO
BEGIN
IF _ISNULL (@cx.outobj := _PUT^LM (out.OBJECTLIST,,
$LEN (cx.outobj)))
THEN ... <out of available memory> ;
! Next output object
! Since the output object is not the same as the input
! object, use the parent-fobject parameter: