Monitoring pipeline progress

Testing the Start function’s return value is not the only way to monitor the status of pipeline execution. Another technique you can use is to retrieve statistics that your supporting user object keeps concerning the number of rows processed. They provide a live count of:

By retrieving these statistics from the supporting user object, you can dynamically display them in the window and enable users to watch the pipeline’s progress.

StepsTo display pipeline row statistics:

  1. Open your supporting user object in the User Object painter.

    The User Object painter workspace displays, enabling you to edit your user object.

  2. Declare three instance variables of type StaticText:

    statictext ist_status_read, ist_status_written, &
    
          ist_status_error
    

    You will use these instance variables later to hold three StaticText controls from your window. This will enable the user object to manipulate those controls directly and make them dynamically display the various pipeline row statistics.

  3. In the user object’s PipeMeter event script, code statements to assign the values of properties inherited from the pipeline system object to the Text property of your three StaticText instance variables.

    ist_status_read.text    = string(RowsRead)
    
    ist_status_written.text = string(RowsWritten)
    
    ist_status_error.text   = string(RowsInError)
    
  4. Save your changes to the user object, then close the User Object painter.

  5. Open your window in the Window painter.

  6. Insert three StaticText controls in the window:

    • One to display the RowsRead value

    • One to display the RowsWritten value

    • One to display the RowsInError value

    The sample Window painter screen shows the layout of the Operation and Status areas of w _ sales _ extract. In the Status area are three StaticText controls labeled Rows red, Rows written, and Rows in error.
  7. Edit the window’s Open event script (or some other script that executes right after the window opens).

    In it, code statements to assign the three StaticText controls (which you just inserted in the window) to the three corresponding StaticText instance variables you declared earlier in the user object. This enables the user object to manipulate these controls directly.

    In the sample order entry application, this logic is in a user event named uevent_pipe_setup (which is posted from the Open event of the w_sales_extract window):

    iuo_pipe_logistics.ist_status_read =                st_status_read
    
    iuo_pipe_logistics.ist_status_written = &
    
          st_status_written
    
    iuo_pipe_logistics.ist_status_error = &
    
          st_status_error
    
  8. Save your changes to the window. Then close the Window painter.

    When you start a pipeline in the w_sales_extract window of the order entry application, the user object’s PipeMeter event triggers and executes its code to display pipeline row statistics in the three StaticText controls:

    The Status area of the sample Write Extract Table screen displays data in the status boxes for database connections, Rows read, written, and in error, and shows the contents of the extract table in a scrollable display.