Monitoring Batch Processes
A batch process is a process that is run to completion without any user interaction after it is launched. Typical examples of batch processes are reports and end-of-month updates. During a batch process, users usually wish to monitor the status of the process and be able to interrupt and possibly cancel the process at any time. A special package (StatPnl.pkg) provides a predefined object, Status_Panel, to automate this process. While the status panel is very easy to deploy, it must be used properly. The usage of the status panel actually starts a second DataFlex process (program) that runs concurrently with the monitored (batch) process. These two processes must communicate properly.
The status panel will create and pop up a modal dialog that contains the following different areas:
-
Caption bar: This is the text that is displayed in the caption bar (e.g., "Running Process").
-
Title area: This is an area below the caption bar that contains text for a title (e.g., "End-of-Month Update").
-
Message area: This is another area, situated below the title area, that may be used to display message text (e.g., "Archiving All Orders"). This is often blank.
-
Status area: This should show the extent and rate of progress. This should change on a regular-enough basis for users to know that the update is progressing (e.g., "Processing Order: 12343 Dated: 1/1/2006").
-
Cancel button: Optionally, a single button is created that may be selected to stop the process. By default, it contains the text "Cancel".
Normally, text for the caption bar, title area, message area, and cancel button are defined once when the status panel is invoked at the start of the batch process. As the process proceeds, it will continually update the status area and check to see if the cancel button has been pressed. The status panel is removed when the process is complete or if the process is canceled.