How can I display several sequential Jobs in a single UI ?
My use case is the following one:
- User Action
- Start first Job (unknown length)
- Wait for first Job to finish and start second Job (known length)
- Wait for second Job to finish and start third Job (known length)
I want to show this to the user in the following way:
- 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)
- 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.UNKNOWNstyle for the first job. - 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.
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:
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.