Description of problem: When you change the name of a task and then try to get this name through TaskSummary interface, you will get the old one. Version-Release number of selected component (if applicable): 6.1.0 ER2 Steps to Reproduce: 1. Create a process which contains a user task. 2. Execute the process and change task name: ((InternalI18NText)task.getNames().get(0)).setText("New task name"); 3. Try to get task name through TaskSummary: taskService.getTasksAssignedAsPotentialOwner("john", "en-UK").get(0).getName() Actual results: There is still old task name if you access the task through TaskSummary interface. Expected results: Although new task name is accessible through Task interface, it should also be propagated to TaskSummary.
For performance reasons (to avoid table join), the name of the task is (also) stored as part of the task itself, so you should do: ((InternalTask) task).setName(..) Does this work for you?
Yes, this works. But the result is that the name is only changed directly in Task table and not in the other one with names.
you should use setTaskNames method on taskService that will set both instead of directly modifying task instance https://github.com/droolsjbpm/droolsjbpm-knowledge/blob/master/kie-internal/src/main/java/org/kie/internal/task/api/InternalTaskService.java#L140
Looking at the comments this seems to be already resolved, if not can you please update the bug with the pending issues?
Kris and Maciej, thanks for the explanation. According to the discussion above, a task name is stored in two different tables because of performance reasons and it can be easily changed in both of them by calling InternalTaskService.setTaskNames(..), so this is not a bug. However, I would recommend to mention this (and maybe other attributes with similar behavior?) somewhere in the documentation. Because as you can see for example in bug 1018173, customers sometimes change the task attributes directly and not by calling InternalTaskService methods.