MAC-PAC Homecontact ussupport login 
Documentation > MAC-PAC Reference Library > Reference > Common Features > Key Concepts and Procedures > Creating a BPM Extract Program or Query

Creating a BPM Extract Program or Query

 

 

Once an event to be monitored by the Business Process Manager (BPM) has been identified and defined in the Event Maintenance conversation, an extract program or query needs to be created.  Many of the details and specifications to be built into the extract are defined in the Event Maintenance conversation.  The functional expert who defined the event may also have included comments as part of the event definition.  When you are creating an extract for a new event type, it will be useful to have printed copies of the Event Maintenance Detail and Dispatch screens, as well as the comments for the event type.

NOTE:  The instructions in this section assume a familiarity and good working knowledge of coding RPG programs and/or using Query/400.

It is recommended that you use one of the eight sample RPG extract programs and one of the nine sample extract calling programs as a model for your new extract program.  A sample query can be obtained by requesting one from the MAC-PAC OPEN Support Help Desk.

After you have written and tested the extract program or query and are satisfied with the results, define the event in the Event Maintenance conversation if it has not yet been created.  If the event has already been created, update the event definition with the correct extract information, including the extract name, extract type, and the next extract date and time.

If you are concerned about the effect a new extract will have on system performance if it runs multiple times per day, you can test it by initially defining the extract frequency as daily and directing the extracted information to your mailbox.

Use a copy of the Extracted Data Workfile layout (CF201AP1) to format the extract information.  At a minimum, the extract should retrieve the detail information, control value, and routing information specific to the event type.  In addition, the extract can retrieve any fast path information required for action code processing.

The following list identifies the information the extract will need to retrieve, the name of the field on the Extracted Data Workfile to which each piece of information should be extracted, and where you can find each piece of information.

Event Detail Information     D0WCRT

The event detail information is a 40-character concatenated field.  This information displays on the Event Manager Detail screen and prints on the Event Manager report (CF305A).

The type of information to be extracted is identified in the Headings field on the Event Maintenance Detail screen.

Control Value Amount        D0WVCE

The control value amount is a signed numeric field with 12 significant digits and 3 decimal places.  This information displays on the Event Manager Detail screen and prints on the Event Manager report (CF305A).  When the BPM monitor is routing event information to BPM mailboxes, this amount is compared to minimum and maximum tolerance levels defined on the Event Maintenance Dispatch screen to determine whether the event should be routed to a specific mailbox.

When extracting information from large files, you may wish to define a “standard” minimum value in the logic of the RPG extract program or in the Select Records specifications in the query definition to limit the number of records extracted.

The type of information to be extracted is identified in the Control Value Description field on the Event Maintenance Detail screen.

Route Based On Data         D0WDTM

The route based on data is used by the BPM monitor in determining how the information for an event occurrence should be routed.

The type of information to be extracted is identified in the Route Based On Description field on the Event Maintenance Detail screen.

Extract Input Files

The driving files for the extract program or query.  These are the input files from MAC-PAC from which the event information is to be extracted.

When extracting information from a large file, you may wish to use a logical view of the input file which only selects a subset of the records from the physical file (for example, only manufacturing orders with a status of open or firmed).  Doing so will limit the number of records that need to be read.

The input files for the extract may be identified in the event comments.

Action Code Fast Path Key Information

      The key information to be passed to the programs called by the action codes defined for the event type.  Each action code defined for an event type corresponds to a MAC-PAC conversation.  When a user selects an action code, they are in effect performing a fast path to the chosen conversation.  The key information allows fast path data to be passed to the target conversation.  For example, if the user selects the action code for the Purchase Order Maintenance conversation, the purchase order number will be passed to that conversation as part of the key information.

      The standard fast path data structure (MPFPDS), which is the input to most online MAC-PAC programs, is used as the model for the key information fields.  The fields on this data structure are repeated ten times, once for each action code to be defined for the event.

      The required key information for each action code may be identified in the event comments.  You may need to identify the fast path information the program accepts by checking the required fast path information in the housekeeping subroutine of the program that the action code is calling.

An extract can be one of three types:  program (a CL program and RPG program combination), a query that outputs to a file, or a query that outputs to a report.  The extract is responsible for retrieving the required information from MAC-PAC and formatting it in the Extracted Data Workfile (CF201AP1).


 

Related