Question

How can I display several sequential Jobs in a single UI ?

My use case is the following one:

  1. User Action
  2. Start first Job (unknown length)
  3. Wait for first Job to finish and start second Job (known length)
  4. Wait for second Job to finish and start third Job (known length)

I want to show this to the user in the following way:

  1. Have a main "User Action" dialog without global progress bar (because of the 1st job unknown and really variable upon executions length I can't get an accurate total length)
  2. In this dialog have 3 sub parts one for each job with one progress bar for each one of this jobs and off course with IProgressMonitor.UNKNOWN style for the first job.
  3. In this dialog the progress bars will be updated sequentially as the underlying jobs.

This will allow the end user to immediately see that its action is spitted into 3 sub-tasks (the sub-tasks are meaningful for end users) and each time a new sub-task is started he can see the length of this sub-task (unknown of course for the first).

After many searches I was not able to implement that, and today I am reporting these 3 sub-tasks as 3 individual successive dialogs with the drawback that the end user may initially thinks that his action will be completed at the end of the first unknown sub-task.

Was it helpful?

Solution

Can't you implement your own scheduling rules to control the order of execution of your jobs, and effectively block the second job while the first one is being executed, and the third one while the second one is running?

Look at http://www.eclipse.org/articles/Article-Concurrency/jobs-api.html for details and code snippets.

From the article above:

Any time a scheduling rule is acquired, execution of that thread might be blocked until the rule can be obtained. In situations like these, the user would benefit from seeing a dialog that shows the progress for the running task and provides feedback if the task is blocked by some other task.

While I haven't implemented this myself, I have seen this in Eclipse. When the workbench is saving its state, while a project is still building, for example, Eclipse is reporting progress on the build, while blocking the state persistence job until the build has finished. It displays the jobs as separate entries within the same dialog, and makes it clear that the second job is blocked by the first one.

OTHER TIPS

Why not just divide one process bar into three parts. The first third for the first job, then the second and the third.

Anyway it's simple! :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top