HP 3000 Manuals

How Does It Work? [ HP DeskManager Customization ] MPE/iX 5.0 Documentation


HP DeskManager Customization

How Does It Work? 

Starting the Application 

The application runs as a son process of the HP Desk user interface
program HPMAIL.HPMAIL.SYS. Most of the time, the application is running
and HP Desk is suspended.

The user starts the application from within HP Desk using one of the
following:

   *   :RUN
   *   EXECUTE
   *   An installed abbreviation
   *   A script file

Once running, the application then has control of the user's session.

To return to HP Desk, the application can do one of two things.

   1.  The son process (the application) can suspend to allow HP Desk to
       perform a task and then resume again, without having to re-create
       the son.

   2.  The son process can terminate and be killed by the father.  In
       this case, complete control is returned to HP Desk.  If the user
       starts up the application again, the son process has to be created
       again.

Suspending the Application 

The application can be suspended in several different ways, called
Interrupt Modes.  There are 17 Interrupt Modes (that is 16 plus Mode 0).

These can be divided into two main areas.

   1.  The user is put into HP Desk at the SUSPEND prompt.

       The user can move around HP Desk as normal, and is returned to the
       application by pressing the  Resume key.  The user may or may not
       take information, via the Clipboard, depending on the Interrupt
       Mode being used.

   2.  The user stays in the application, and does not see the HP Desk
       User Interface.

       The application asks HP Desk for some information, or to perform a
       particular task, such as displaying a Help screen or passing an
       item to or from the Work Area.  HP Desk completes whatever it was
       asked to do and returns control to the application again.

Communication Between HP Desk and the Application 

Once you have started up your application, it and HP Desk can communicate
with each other.  Two JCWs and an Extra Data Segment (XDS) are used to
allow the application and HP DeskManager to exchange data during a
program interrupt.  This is what we mean by "Application Data Passing".
It means, for example, that a user could run an application to generate a
report and when the report is complete and the application terminated, a
copy of the report could be automatically placed in the Work Area for
mailing.  (If the application is started from a script file, the script
file could then mail the message.)  Similarly, an application may require
the use of a piece of data from the user's Filing Cabinet, this can be
easily accessed by the Application Data Passing scheme.

When the application needs to interact with HP Desk (to give or get
information) it suspends back to HP Desk using one of the Interrupt (or
Suspend) Modes.  The application starts the interrupt by suspending and
activating HP Desk using the MPE intrinsic ACTIVATE.

Obviously, the application has to have some way of telling HP Desk what
to do, and finding out whether HP Desk has successfully done what it was
asked.  This is done by setting two JCWs:

   *   HPDESKPROCCONTROL to tell HP Desk what to do.

   *   HPDESKERR to tell the application of any errors encountered by HP
       Desk.

The type of interrupt required is shown by a value (from 1 to 16
corresponding to the number of the Interrupt Modes) in the JCW
HPDESKPROCCONTROL, which is set by the application via the MPE intrinsic
PUTJCW. HP Desk reads the JCW to find out what action is required next.
When the requested action has been carried out, HP Desk writes whether it
has been successful or not to the JCW HPDESKERR. HP Desk then reactivates
the son, and suspends itself.

For most of the Interrupt Modes, extra information is required, for
example:

   *   The identity of the item in the Work Area which the application
       wants, and the name of the MPE file HP Desk has put it in.
   *   The name of the file which is to be passed to the Library, and the
       name of the catalog to put it in.
   *   Where HP Desk has put the forms batch file the application is to
       process.
   *   The help page which is to be displayed.

All this information is passed from the application to HP Desk and from
HP Desk to the application via an XDS which is shared by the two
processes.  The XDS used to pass the information is a session-wide XDS
called "EX" created by HP Desk.

In order to communicate with HP Desk, the application must know the
format of the XDS. A Pascal definition of the XDS can be found in the
file EXPORTDF.MAILLIB.HPOFFICE. Pascal, COBOL and FORTRAN definitions are
described later in "Examples of XDS Structure" .

The MPE application can use various intrinsics GETDSEG, DMOVIN and
DMOVOUT to access the information in the XDS. Once the information has
been provided, there are 16 different Interrupt Modes which can be used
to suit your application's needs.  They can be divided into two main
categories; those which:

   *   Put users into HP Desk at the Suspend prompt.  Users can then move
       around their desks as normal.  They are returned to the
       application when they press the  Resume key or use the RESUME
       command.  It depends on the Interrupt Mode being used whether
       users can take information with them via their Clipboard.

   *   Leave users in the application, they do not see the HP Desk user
       interface.  In this situation, the application asks HP Desk for
       some information, or to perform a particular task.  This may be
       for example, to display a help screen or pass an item to the Work
       Area.  HP Desk completes what it was asked to do and then returns
       control to the application.

Terminating the Application 

When the application has completely finished, it is killed, and control
is returned to the HP Desk user interface.

The user will be returned to wherever he was when he originally started
the application, for example in the Work Area, or in a message.  If the
application was started from a script file, then the execution of the
script will continue.

Normally, when the application has completed its task, it either kills
itself or sets the HPDESKPROCCONTROL JCW to 0 and suspends.  Control is
returned to the HP Desk user interface which kills the son if it was
suspended.

However, the application can be run with the NOKILL option.  If this
is the case, when it has finished processing it should set the
HPDESKPROCCONTROL JCW to 0 and suspend.  Since the application was run
with NOKILL, HP Desk does not kill it, and the process remains suspended.
The next time the application is started (provided the NOKILL option is
used again) HP Desk reactivates the suspended process rather than
creating a new one.  Again, after termination, users are returned to
wherever they were when they originally started the application.



MPE/iX 5.0 Documentation