Community
Participate
Working Groups
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.
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 } }
I might be missing something but why wouldn't we simply include the original task as part of SubmitTaskEvent?
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.
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?
You're right. Sorry, I had noticed that at the beginning and forgot about it. I'm marking this invalid.