Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 225292

Summary: Take account the Eclipse Progress Monitor
Product: z_Archived Reporter: Stephane Moline <stephane.moline>
Component: BIRTAssignee: Haojun Chu <hchu>
Status: VERIFIED FIXED QA Contact: Maggie Shen <lshen>
Severity: critical    
Priority: P4 CC: bluesoldier, bvitale3002, stephane.moline, wenfeng.fwd, whe, wyan, xxue
Version: 2.3.0Keywords: plan
Target Milestone: 2.5.0 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard: Obsolete

Description Stephane Moline CLA 2008-04-02 06:03:02 EDT
We need to use the Progress Monitor capability during the report generation.
The classes ReportEngine and UnAndRenderTask doesn't contain method to set 
a IProgressMonitor object.
Thanks.
Comment 1 Wei Yan CLA 2008-04-02 21:55:41 EDT
For RunTask, we have a IPageHandler callback. It is invoked for each page. 

We can add such a interface to the IRunAndRenderTask, do you think it is acceptable?
Comment 2 Haojun Chu CLA 2008-04-11 02:35:24 EDT
To obtain some new page-based functionality, like Progress Monitor, implement IPageHandler and set its instance to IRunAndRenderTask. This task will be invoked when a page is generated.

Following is an example of using IProgressMonitor.

// defining IPageHandler
  class PageHandler implements IPageHandler {
    IProgressMonitor progressMonitor;
    public void onPage(int pageNumber, boolean checkpoint, IReportDocumentInfo doc)
    {
      // Do something with progressMonitor;
    }
  }

// defining task
  runAndRenderTask.setPageHandler( new PageHandler() );
Comment 3 Stephane Moline CLA 2008-07-07 05:19:56 EDT
The IPageHandler method does not respond to our need.
The html report only contains one page and the task take a lot of time.
Also we really need that you use the eclipse Progress Monitor.
Thanks.
Comment 4 Wenfeng Li CLA 2008-12-08 18:19:46 EST
Need to make sure BIRT engine component doesn't depends on Eclipse UI code, since it has to be able to run on app servers such Webshpere.

Maybe engine can add a progress monitor extension point, where engine will call to report progress at various execution steps.

BIRT report designer can then implement an BIRT engine progress monitor extension point that calls Eclipse's IProgressMonitor.   While on Web server, one can implement such an extension to log report execution performance/progress.
Comment 5 Wei Yan CLA 2009-02-02 01:36:08 EST
It is hard to implement a accurate progress monitor as BIRT doesn't known the total time before finish the task.

Take the run task as example. The run task is divided into several phrases:

1. parser the design
2. for each element in the report design,
   2.1 acquire the data set used by the element
   2.2 for each row in the result set
       a.generate the content using the result set
       b.layout the content into pages 
       c.save the paged content into document.

from the step 2, BIRT can't calculate the accurate progress of a task as the total row in the result set is unknown while the most time is used in step 2. So i think the page (final output) is a well define unit for multiple paged report generation.

BIRT's page handle is only a simple interface and doesn't depend on the Eclipse's progress monitor. The user should adapter the Eclipse's progress monitor to BIRT's page handler to receive the task progress.


Comment 6 Ben Vitale CLA 2009-02-02 09:02:08 EST
(In reply to comment #5)
> Take the run task as example. The run task is divided into several phrases:
> 
> 1. parser the design
> 2. for each element in the report design,

So if there are 10 design elements, use that as the total amount of work, and increment it as each design element is processed. I would think that level of granularity would be more useful than the current page-level implementation.
Comment 7 Wenfeng Li CLA 2009-02-02 11:59:46 EST
(In reply to comment #6)
> (In reply to comment #5)
> > Take the run task as example. The run task is divided into several phrases:
> > 
> > 1. parser the design
> > 2. for each element in the report design,
> So if there are 10 design elements, use that as the total amount of work, and
> increment it as each design element is processed. I would think that level of
> granularity would be more useful than the current page-level implementation.

If a report design element is in the detail section of a table or list, they will be repeated N times,  N = the number of rows in the result set of the table or list.   So the progress of a report execution can not be measured by the number of elements that has been processed.

Comment 8 Wenfeng Li CLA 2009-02-02 12:05:31 EST
(In reply to comment #5)
> It is hard to implement a accurate progress monitor as BIRT doesn't known the
> total time before finish the task.
> Take the run task as example. The run task is divided into several phrases:
> 1. parser the design
> 2. for each element in the report design,
>    2.1 acquire the data set used by the element
>    2.2 for each row in the result set
>        a.generate the content using the result set
>        b.layout the content into pages 
>        c.save the paged content into document.
> from the step 2, BIRT can't calculate the accurate progress of a task as the
> total row in the result set is unknown while the most time is used in step 2.
> So i think the page (final output) is a well define unit for multiple paged
> report generation.
> BIRT's page handle is only a simple interface and doesn't depend on the
> Eclipse's progress monitor. The user should adapter the Eclipse's progress
> monitor to BIRT's page handler to receive the task progress.

In addition to page generation, BIRT engine can also report progress during report design parsing, data set query execution and data binding calculations, since some of these steps could take significant time too.

Also, it would be easier for an application to incroporate a progress monitoring feature if BIRT engine use a single extension point (such as org.eclipse.birt.IprogressMonitor) for all execution steps, so that developer does not need to implement different extension points (iPageHandler for page progress, iDataSetHandler for query execution, iDomParsing handler for parsing progress etc...) for different steps.

Comment 9 Wei Yan CLA 2009-02-04 03:31:50 EST
need more time to resolve those issues.
Comment 10 Wei Yan CLA 2009-03-12 03:01:09 EDT
defer to RC0 as we don't have the final solution yet.
Comment 11 Haojun Chu CLA 2009-03-16 04:35:26 EDT
Please check if the following solution satisfies.

Provide this API:  onProgress(ProgressType, Object value).
The parameter ProgressType specifies the measure unit, for example, Page, ExecutingQuery, FetchingData, ParsingReport, GeneratingReport. The value parameter is a value proper to the ProgressType.

For example,
1) which page:  onProgress(Page, 1)
2) which query:  onProgress(FetchingData, "result set name")
3) which element:  onProgress(GeneratingReport, "element name")

Thanks
Comment 12 Wenfeng Li CLA 2009-03-16 14:07:57 EDT
(In reply to comment #11)
> Please check if the following solution satisfies.
> Provide this API:  onProgress(ProgressType, Object value).
> The parameter ProgressType specifies the measure unit, for example, Page,
> ExecutingQuery, FetchingData, ParsingReport, GeneratingReport. The value
> parameter is a value proper to the ProgressType.
> For example,
> 1) which page:  onProgress(Page, 1)
> 2) which query:  onProgress(FetchingData, "result set name")
> 3) which element:  onProgress(GeneratingReport, "element name")
> Thanks

Suggest to have the ProgressType all refers to an action.  for example, 
page-->generatingPageContent or renderingPageToHtml or renderingPageToPDF, 
GeneratingReport-->generatingElementContent 

Comment 13 Haojun Chu CLA 2009-04-22 23:44:46 EDT
Provide IProgressMonitor to trace BIRT's progress.
Comment 14 Maggie Shen CLA 2009-04-30 04:40:54 EDT
verified on April 30. You can set monitor on RunAndRender task now.Seven events are monitored: START_TASK,END_TASK,START_PAGE,END_PAGE,START_QUERY,END_QUERY,FETCH_ROW.