Work Management APIs: Putting the Pieces Together

Support all list actions and retrieve and identify messages.

In previous APIs by Example columns, I’ve thoroughly covered the Work Management APIs. To add a practical aspect to the explanations, these articles addressed many new CL commands that deal with job information and management. In this article, I’ll put all these pieces together to present an updated version of the Work with Jobs (WRKJOBS) command, which in this incarnation provides access to a whole suite of native as well as APIs by Example job commands.

In addition, I’ll briefly discuss the programming technique involved in supporting more commands in a User Interface Manager (UIM) list panel than the panel’s list options space permits. I’ll also present the Work Management API support introduced in recent releases for identifying and handling jobs in a message wait state. Displaying and optionally replying to the message require a bit of coding on your part, but I’ve included an Additional Message Information panel to relieve most of that burden.

Supporting All List Actions

The number of job commands you can access from the Work with Jobs list panel greatly exceeds the space available for the list options in the display panel and, therefore, requires a special technique to support all list option commands and functions. In contrast with the F24=More keys functionality, which the UIM handles automatically, there’s no corresponding UIM support for F23=More options. The method I’ll present in this article is based on examples and discussions of the approach contributed by Ed Fischel and the late Simon Coulter, both former IBM associates.

UIM panel groups easily support conditional panel elements such as the option list and associated list actions. You simply specify the name of the condition, declare a condition statement, and indicate the condition name for the condition tag on the list action keyword. Consequently, the list action will appear and be accessible only when the UIM evaluates the condition to be true or not when it displays the panel. A UIM truth table defines certain conditions to be mutually exclusive, letting the UIM avoid reserving panel space for all defined list actions simultaneously.

The challenge in making the More options dialog work is keeping all list actions available and active, because the panel displays only some of the list actions. To achieve this, you define all list actions for each condition but specify a text attribute only for those list actions that are to appear in the respective list action sets.

Download the save file containing the source code.

Read the entire article.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s