Bug 370772 - [api] Allow clients to listen to TaskMigrator
Summary: [api] Allow clients to listen to TaskMigrator
Status: RESOLVED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Mylyn Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-06 16:24 EST by Sam Davis CLA
Modified: 2012-02-07 16:45 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Davis CLA 2012-02-06 16:24:41 EST
This relates to bug 333930. When using that mechanism to listen for submits, if the user creates and submits a new task, you have no way of knowing, when you get a submit event, whether it's for the same task that they created. One way to fix that would be to allow clients to be notified when TaskMigrator executes. For my purposes, I think I only need to listen to TaskMigrator, and don't actually need to listen to submit events.
Comment 1 Sam Davis CLA 2012-02-06 16:54:00 EST
Actually, what I need isn't so much to be informed when TaskMigrator executes as to be able, when informed of a submission, to get the ITask that the user created that corresponds to the just submitted ITask. So I need a method like @ITask getOriginalNewTask(ITask repositoryTask)@. Then I could write code like:

bc.. 
private Set<ITask> tasksICareAbout;
			
public void someAction() {
	ITask newTask = openNewTaskWizardAndReturnTask();
	tasksICareAbout.add(newTask);
}

private TaskJobListener listener =	new TaskJobListener() {
		public void taskSubmitted(SubmitTaskEvent e) {
		  ITask originalTask = getOriginalNewTask(e.getTask());
			if(tasksICareAbout.contains(originalTask) {
				// do something
			}
		}
Comment 2 Steffen Pingel CLA 2012-02-07 10:33:49 EST
I might be missing something but why wouldn't we simply include the original task as part of SubmitTaskEvent?
Comment 3 Sam Davis CLA 2012-02-07 12:23:38 EST
If that is possible, it would be great. But it seems this information is only available in ui, but the event is fired in core? I guess the ui could attach a SubmitJobListener that notifies the SubmitTaskListeners and includes the original task.
Comment 4 Steffen Pingel CLA 2012-02-07 16:25:22 EST
I may not quite grasp what kind of notification you are looking for exactly. As far as I can tell SubmitTaskJob has references to both, the old and new task?
Comment 5 Sam Davis CLA 2012-02-07 16:45:22 EST
You're right. Sorry, I had noticed that at the beginning and forgot about it. I'm marking this invalid.